minjs 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/minjs/compressor.rb +264 -162
- data/lib/minjs/ctype.rb +843 -829
- data/lib/minjs/ecma262/env.rb +1 -1
- data/lib/minjs/ecma262/exp.rb +84 -45
- data/lib/minjs/ecma262/lit.rb +272 -58
- data/lib/minjs/ecma262/st.rb +0 -4
- data/lib/minjs/lex.rb +3 -10
- data/lib/minjs/statement.rb +12 -11
- data/lib/minjs/version.rb +1 -1
- metadata +2 -2
data/lib/minjs/statement.rb
CHANGED
@@ -414,13 +414,14 @@ module Minjs
|
|
414
414
|
def try_statement(lex, context)
|
415
415
|
return nil unless lex.match_lit(ECMA262::ID_TRY)
|
416
416
|
lex.eval_lit {
|
417
|
-
catch_context = ECMA262::Context.new
|
418
417
|
#
|
419
|
-
# catch context must be executable lexical environment
|
418
|
+
# The catch argument context must be executable lexical environment.
|
419
|
+
# See compress_var
|
420
420
|
#
|
421
|
-
|
422
|
-
catch_context.lex_env =
|
423
|
-
catch_context.var_env = context.var_env
|
421
|
+
#catch_context = ECMA262::Context.new
|
422
|
+
#catch_context.lex_env = context.lex_env
|
423
|
+
#catch_context.var_env = context.var_env
|
424
|
+
catch_context = context
|
424
425
|
|
425
426
|
t = block(lex, context)
|
426
427
|
break nil unless t
|
@@ -442,12 +443,12 @@ module Minjs
|
|
442
443
|
return nil unless lex.match_lit(ECMA262::ID_CATCH)
|
443
444
|
|
444
445
|
if lex.match_lit(ECMA262::PUNC_LPARENTHESIS) and i=identifier(lex, catch_context) and lex.match_lit(ECMA262::PUNC_RPARENTHESIS) and b=block(lex, catch_context)
|
445
|
-
catch_context.lex_env.record.create_mutable_binding(i, nil)
|
446
|
-
catch_context.lex_env.record.set_mutable_binding(i, :undefined, nil, {:_parameter_list => true})
|
447
|
-
catch_context.var_env.record.create_mutable_binding(i, nil)
|
448
|
-
catch_context.var_env.record.set_mutable_binding(i, :undefined, nil, {:_parameter_list => true})
|
449
|
-
catch_context.var_env.record.binding.each do|k, v|
|
450
|
-
end
|
446
|
+
# catch_context.lex_env.record.create_mutable_binding(i, nil)
|
447
|
+
# catch_context.lex_env.record.set_mutable_binding(i, :undefined, nil, {:_parameter_list => true})
|
448
|
+
# catch_context.var_env.record.create_mutable_binding(i, nil)
|
449
|
+
# catch_context.var_env.record.set_mutable_binding(i, :undefined, nil, {:_parameter_list => true})
|
450
|
+
# catch_context.var_env.record.binding.each do|k, v|
|
451
|
+
# end
|
451
452
|
[i, b]
|
452
453
|
else
|
453
454
|
nil
|
data/lib/minjs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Issei Numata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|