Skip to content

Commit 96d0e92

Browse files
committedMay 7, 2015
Assume Encoding as we dropped 1.8 support
1 parent e408a1a commit 96d0e92

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed
 

Diff for: ‎lib/opal/parser/lexer.rb

+1-6
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,7 @@ def read_escape
258258
elsif scan(/x([0-9a-fA-F]{1,2})/)
259259
scanner[1].to_i(16).chr
260260
elsif scan(/u([0-9a-zA-Z]{1,4})/)
261-
if defined?(::Encoding)
262-
scanner[1].to_i(16).chr(Encoding::UTF_8)
263-
else
264-
# FIXME: no encoding on 1.8
265-
""
266-
end
261+
scanner[1].to_i(16).chr(Encoding::UTF_8)
267262
else
268263
# escaped char doesnt need escaping, so just return it
269264
scan(/./)

Diff for: ‎stdlib/opal-parser.rb

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'opal/compiler'
22
require 'opal/erb'
33
require 'opal/version'
4+
require 'encoding'
45

56
module Kernel
67
def eval(str)

0 commit comments

Comments
 (0)
Please sign in to comment.