opal 0.10.0.beta2 → 0.10.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -1
  3. data/lib/opal/compiler.rb +15 -9
  4. data/lib/opal/fragment.rb +8 -1
  5. data/lib/opal/nodes/args/restarg.rb +6 -1
  6. data/lib/opal/nodes/base.rb +1 -1
  7. data/lib/opal/nodes/call.rb +4 -0
  8. data/lib/opal/nodes/def.rb +20 -25
  9. data/lib/opal/nodes/hash.rb +89 -17
  10. data/lib/opal/nodes/iter.rb +30 -2
  11. data/lib/opal/nodes/logic.rb +54 -4
  12. data/lib/opal/nodes/node_with_args.rb +72 -0
  13. data/lib/opal/parser.rb +16 -0
  14. data/lib/opal/parser/grammar.rb +2555 -2562
  15. data/lib/opal/parser/grammar.y +28 -20
  16. data/lib/opal/parser/lexer.rb +4 -4
  17. data/lib/opal/regexp_anchors.rb +13 -5
  18. data/lib/opal/source_map.rb +2 -1
  19. data/lib/opal/version.rb +1 -1
  20. data/opal/corelib/array.rb +4 -0
  21. data/opal/corelib/basic_object.rb +3 -1
  22. data/opal/corelib/constants.rb +1 -1
  23. data/opal/corelib/file.rb +196 -4
  24. data/opal/corelib/hash.rb +7 -7
  25. data/opal/corelib/kernel.rb +7 -4
  26. data/opal/corelib/marshal.rb +31 -0
  27. data/opal/corelib/marshal/read_buffer.rb +427 -0
  28. data/opal/corelib/marshal/write_buffer.rb +383 -0
  29. data/opal/corelib/method.rb +8 -0
  30. data/opal/corelib/module.rb +21 -0
  31. data/opal/corelib/number.rb +19 -5
  32. data/opal/corelib/proc.rb +33 -6
  33. data/opal/corelib/range.rb +6 -0
  34. data/opal/corelib/regexp.rb +5 -1
  35. data/opal/corelib/runtime.js +69 -17
  36. data/opal/corelib/string.rb +8 -0
  37. data/opal/corelib/string/inheritance.rb +4 -0
  38. data/opal/corelib/struct.rb +5 -0
  39. data/opal/corelib/unsupported.rb +0 -18
  40. data/opal/opal/full.rb +1 -0
  41. data/spec/filters/bugs/basicobject.rb +0 -2
  42. data/spec/filters/bugs/compiler_opal.rb +5 -0
  43. data/spec/filters/bugs/enumerable.rb +1 -0
  44. data/spec/filters/bugs/enumerator.rb +0 -2
  45. data/spec/filters/bugs/exception.rb +0 -1
  46. data/spec/filters/bugs/kernel.rb +0 -5
  47. data/spec/filters/bugs/language.rb +7 -27
  48. data/spec/filters/bugs/marshal.rb +43 -0
  49. data/spec/filters/bugs/method.rb +0 -56
  50. data/spec/filters/bugs/module.rb +0 -1
  51. data/spec/filters/bugs/proc.rb +0 -46
  52. data/spec/filters/bugs/regexp.rb +1 -0
  53. data/spec/filters/bugs/unboundmethod.rb +0 -13
  54. data/spec/filters/unsupported/bignum.rb +5 -0
  55. data/spec/filters/unsupported/freeze.rb +2 -0
  56. data/spec/filters/unsupported/marshal.rb +46 -0
  57. data/spec/filters/unsupported/symbol.rb +5 -0
  58. data/spec/lib/compiler/call_spec.rb +29 -29
  59. data/spec/lib/compiler_spec.rb +7 -1
  60. data/spec/opal/core/kernel/instance_variables_spec.rb +40 -0
  61. data/spec/opal/core/language/ternary_operator_spec.rb +6 -0
  62. data/spec/opal/core/marshal/dump_spec.rb +53 -0
  63. data/spec/opal/core/marshal/load_spec.rb +7 -0
  64. data/spec/opal/core/source_map_spec.rb +35 -1
  65. data/spec/opal/javascript_api_spec.rb +16 -0
  66. data/spec/opal/stdlib/source_map_spec.rb +8 -0
  67. data/spec/ruby_specs +7 -4
  68. data/spec/support/match_helpers.rb +57 -0
  69. data/spec/support/mspec_rspec_adapter.rb +1 -1
  70. data/stdlib/opal-parser.rb +3 -1
  71. data/stdlib/pathname.rb +105 -7
  72. data/stdlib/racc/parser.rb +551 -138
  73. data/stdlib/source_map/vlq.rb +3 -2
  74. data/tasks/testing.rake +4 -2
  75. metadata +22 -2
@@ -28,12 +28,13 @@ module SourceMap
28
28
  result = []
29
29
  ary.each do |n|
30
30
  vlq = n < 0 ? ((-n) << 1) + 1 : n << 1
31
- begin
31
+ loop do
32
32
  digit = vlq & VLQ_BASE_MASK
33
33
  vlq >>= VLQ_BASE_SHIFT
34
34
  digit |= VLQ_CONTINUATION_BIT if vlq > 0
35
35
  result << BASE64_DIGITS[digit]
36
- end while vlq > 0
36
+ break unless vlq > 0
37
+ end
37
38
  end
38
39
  result.join
39
40
  end
@@ -18,6 +18,7 @@ module Testing
18
18
  mspec/guards/block_device
19
19
  mspec/guards/endian
20
20
  a_file
21
+ lib/spec_helper
21
22
  ]
22
23
  end
23
24
 
@@ -35,7 +36,7 @@ module Testing
35
36
  File.directory?(path) ? Dir[path+'/*.rb'] : "#{path}.rb"
36
37
  end - excepting
37
38
 
38
- opalspecs = Dir['spec/{opal,lib/parser}/**/*_spec.rb'] + ['spec/lib/lexer_spec.rb']
39
+ opalspecs = Dir['spec/{opal,lib/parser}/**/*_spec.rb'] + ['spec/lib/lexer_spec.rb', 'spec/lib/compiler_spec.rb']
39
40
  userspecs = Dir[pattern] if pattern
40
41
  userspecs &= rubyspecs if whitelist_pattern
41
42
 
@@ -85,6 +86,7 @@ module Testing
85
86
  File.write filename, <<-RUBY
86
87
  require 'spec_helper'
87
88
  require 'opal/platform'
89
+ require 'opal/full'
88
90
  OSpecRunner.main.will_start
89
91
  #{enter_benchmarking_mode}
90
92
  #{requires.join("\n ")}
@@ -125,7 +127,7 @@ DESC
125
127
  mkdir_p File.dirname(filename)
126
128
  Testing.write_file filename, Testing.specs(ENV.to_hash.merge 'SUITE' => suite)
127
129
 
128
- Testing.stubs.each {|s| ::Opal::Processor.stub_file s }
130
+ Testing.stubs.each {|s| ::Opal::Config.stubbed_files << s }
129
131
 
130
132
  Opal::Config.arity_check_enabled = true
131
133
  Opal::Config.freezing_stubs_enabled = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0.beta2
4
+ version: 0.10.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Beynon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sourcemap
@@ -462,6 +462,9 @@ files:
462
462
  - opal/corelib/io.rb
463
463
  - opal/corelib/kernel.rb
464
464
  - opal/corelib/main.rb
465
+ - opal/corelib/marshal.rb
466
+ - opal/corelib/marshal/read_buffer.rb
467
+ - opal/corelib/marshal/write_buffer.rb
465
468
  - opal/corelib/math.rb
466
469
  - opal/corelib/method.rb
467
470
  - opal/corelib/module.rb
@@ -483,12 +486,14 @@ files:
483
486
  - opal/corelib/variables.rb
484
487
  - opal/opal.rb
485
488
  - opal/opal/base.rb
489
+ - opal/opal/full.rb
486
490
  - opal/opal/mini.rb
487
491
  - spec/README.md
488
492
  - spec/filters/bugs/array.rb
489
493
  - spec/filters/bugs/basicobject.rb
490
494
  - spec/filters/bugs/bigdecimal.rb
491
495
  - spec/filters/bugs/class.rb
496
+ - spec/filters/bugs/compiler_opal.rb
492
497
  - spec/filters/bugs/complex.rb
493
498
  - spec/filters/bugs/date.rb
494
499
  - spec/filters/bugs/enumerable.rb
@@ -501,6 +506,7 @@ files:
501
506
  - spec/filters/bugs/kernel.rb
502
507
  - spec/filters/bugs/language.rb
503
508
  - spec/filters/bugs/language_opal.rb
509
+ - spec/filters/bugs/marshal.rb
504
510
  - spec/filters/bugs/method.rb
505
511
  - spec/filters/bugs/module.rb
506
512
  - spec/filters/bugs/numeric.rb
@@ -529,6 +535,7 @@ files:
529
535
  - spec/filters/unsupported/integer.rb
530
536
  - spec/filters/unsupported/kernel.rb
531
537
  - spec/filters/unsupported/language.rb
538
+ - spec/filters/unsupported/marshal.rb
532
539
  - spec/filters/unsupported/matchdata.rb
533
540
  - spec/filters/unsupported/math.rb
534
541
  - spec/filters/unsupported/module.rb
@@ -731,6 +738,8 @@ files:
731
738
  - spec/opal/core/language/versions/symbol_1.9.rb
732
739
  - spec/opal/core/language/versions/variables_1.9.rb
733
740
  - spec/opal/core/language_spec.rb
741
+ - spec/opal/core/marshal/dump_spec.rb
742
+ - spec/opal/core/marshal/load_spec.rb
734
743
  - spec/opal/core/method/to_proc_spec.rb
735
744
  - spec/opal/core/module/alias_method_spec.rb
736
745
  - spec/opal/core/module/ancestors_spec.rb
@@ -810,6 +819,7 @@ files:
810
819
  - spec/opal/core/runtime_spec.rb
811
820
  - spec/opal/core/source_map_spec.rb
812
821
  - spec/opal/core/string_spec.rb
822
+ - spec/opal/javascript_api_spec.rb
813
823
  - spec/opal/stdlib/erb/erb_spec.rb
814
824
  - spec/opal/stdlib/erb/inline_block.opalerb
815
825
  - spec/opal/stdlib/erb/quoted.opalerb
@@ -840,6 +850,7 @@ files:
840
850
  - spec/opal/stdlib/promise/trace_spec.rb
841
851
  - spec/opal/stdlib/promise/value_spec.rb
842
852
  - spec/opal/stdlib/promise/when_spec.rb
853
+ - spec/opal/stdlib/source_map_spec.rb
843
854
  - spec/opal/stdlib/strscan/scan_spec.rb
844
855
  - spec/opal/stdlib/template/paths_spec.rb
845
856
  - spec/opal/stdlib/thread/mutex_spec.rb
@@ -847,6 +858,7 @@ files:
847
858
  - spec/opal/stdlib/thread/thread_spec.rb
848
859
  - spec/ruby_specs
849
860
  - spec/spec_helper.rb
861
+ - spec/support/match_helpers.rb
850
862
  - spec/support/mspec_rspec_adapter.rb
851
863
  - spec/support/parser_helpers.rb
852
864
  - stdlib/README.md
@@ -1153,6 +1165,7 @@ test_files:
1153
1165
  - spec/filters/bugs/basicobject.rb
1154
1166
  - spec/filters/bugs/bigdecimal.rb
1155
1167
  - spec/filters/bugs/class.rb
1168
+ - spec/filters/bugs/compiler_opal.rb
1156
1169
  - spec/filters/bugs/complex.rb
1157
1170
  - spec/filters/bugs/date.rb
1158
1171
  - spec/filters/bugs/enumerable.rb
@@ -1165,6 +1178,7 @@ test_files:
1165
1178
  - spec/filters/bugs/kernel.rb
1166
1179
  - spec/filters/bugs/language.rb
1167
1180
  - spec/filters/bugs/language_opal.rb
1181
+ - spec/filters/bugs/marshal.rb
1168
1182
  - spec/filters/bugs/method.rb
1169
1183
  - spec/filters/bugs/module.rb
1170
1184
  - spec/filters/bugs/numeric.rb
@@ -1193,6 +1207,7 @@ test_files:
1193
1207
  - spec/filters/unsupported/integer.rb
1194
1208
  - spec/filters/unsupported/kernel.rb
1195
1209
  - spec/filters/unsupported/language.rb
1210
+ - spec/filters/unsupported/marshal.rb
1196
1211
  - spec/filters/unsupported/matchdata.rb
1197
1212
  - spec/filters/unsupported/math.rb
1198
1213
  - spec/filters/unsupported/module.rb
@@ -1395,6 +1410,8 @@ test_files:
1395
1410
  - spec/opal/core/language/versions/symbol_1.9.rb
1396
1411
  - spec/opal/core/language/versions/variables_1.9.rb
1397
1412
  - spec/opal/core/language_spec.rb
1413
+ - spec/opal/core/marshal/dump_spec.rb
1414
+ - spec/opal/core/marshal/load_spec.rb
1398
1415
  - spec/opal/core/method/to_proc_spec.rb
1399
1416
  - spec/opal/core/module/alias_method_spec.rb
1400
1417
  - spec/opal/core/module/ancestors_spec.rb
@@ -1474,6 +1491,7 @@ test_files:
1474
1491
  - spec/opal/core/runtime_spec.rb
1475
1492
  - spec/opal/core/source_map_spec.rb
1476
1493
  - spec/opal/core/string_spec.rb
1494
+ - spec/opal/javascript_api_spec.rb
1477
1495
  - spec/opal/stdlib/erb/erb_spec.rb
1478
1496
  - spec/opal/stdlib/erb/inline_block.opalerb
1479
1497
  - spec/opal/stdlib/erb/quoted.opalerb
@@ -1504,6 +1522,7 @@ test_files:
1504
1522
  - spec/opal/stdlib/promise/trace_spec.rb
1505
1523
  - spec/opal/stdlib/promise/value_spec.rb
1506
1524
  - spec/opal/stdlib/promise/when_spec.rb
1525
+ - spec/opal/stdlib/source_map_spec.rb
1507
1526
  - spec/opal/stdlib/strscan/scan_spec.rb
1508
1527
  - spec/opal/stdlib/template/paths_spec.rb
1509
1528
  - spec/opal/stdlib/thread/mutex_spec.rb
@@ -1511,6 +1530,7 @@ test_files:
1511
1530
  - spec/opal/stdlib/thread/thread_spec.rb
1512
1531
  - spec/ruby_specs
1513
1532
  - spec/spec_helper.rb
1533
+ - spec/support/match_helpers.rb
1514
1534
  - spec/support/mspec_rspec_adapter.rb
1515
1535
  - spec/support/parser_helpers.rb
1516
1536
  - test/opal/test_keyword.rb