opal 1.1.0.rc1 → 1.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +4 -4
  3. data/.github/ISSUE_TEMPLATE/bug-report.md +47 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. data/.github/workflows/build.yml +11 -5
  6. data/.gitignore +1 -0
  7. data/.jshintrc +1 -1
  8. data/CHANGELOG.md +42 -1
  9. data/Gemfile +0 -4
  10. data/HACKING.md +1 -1
  11. data/LICENSE +1 -1
  12. data/README.md +20 -16
  13. data/UNRELEASED.md +32 -95
  14. data/benchmark-ips/bm_array_unshift.rb +7 -0
  15. data/benchmark-ips/bm_js_symbols_vs_strings.rb +7 -2
  16. data/bin/build-browser-source-map-support +2 -3
  17. data/bin/opal-mspec +2 -0
  18. data/docs/compiler.md +1 -1
  19. data/examples/rack/Gemfile +0 -1
  20. data/examples/rack/Gemfile.lock +0 -4
  21. data/lib/opal/cli.rb +1 -0
  22. data/lib/opal/cli_options.rb +4 -0
  23. data/lib/opal/cli_runners/nodejs.rb +5 -1
  24. data/lib/opal/cli_runners/source-map-support-browser.js +8 -2
  25. data/lib/opal/cli_runners/source-map-support-node.js +3706 -0
  26. data/lib/opal/cli_runners/source-map-support.js +3 -1
  27. data/lib/opal/compiler.rb +2 -2
  28. data/lib/opal/nodes/args/arity_check.rb +1 -0
  29. data/lib/opal/nodes/args/parameters.rb +6 -0
  30. data/lib/opal/nodes/class.rb +1 -13
  31. data/lib/opal/nodes/literal.rb +14 -7
  32. data/lib/opal/nodes/module.rb +13 -9
  33. data/lib/opal/nodes/variables.rb +13 -4
  34. data/lib/opal/nodes/while.rb +54 -17
  35. data/lib/opal/parser.rb +1 -5
  36. data/lib/opal/parser/patch.rb +34 -0
  37. data/lib/opal/repl.rb +7 -0
  38. data/lib/opal/rewriter.rb +2 -0
  39. data/lib/opal/rewriters/arguments.rb +4 -1
  40. data/lib/opal/rewriters/forward_args.rb +54 -0
  41. data/lib/opal/rewriters/logical_operator_assignment.rb +5 -2
  42. data/lib/opal/rewriters/opal_engine_check.rb +5 -7
  43. data/lib/opal/version.rb +1 -1
  44. data/opal.gemspec +1 -1
  45. data/opal/corelib/array.rb +42 -20
  46. data/opal/corelib/array/pack.rb +6 -1
  47. data/opal/corelib/complex.rb +2 -0
  48. data/opal/corelib/constants.rb +3 -3
  49. data/opal/corelib/hash.rb +36 -38
  50. data/opal/corelib/module.rb +2 -7
  51. data/opal/corelib/number.rb +2 -180
  52. data/opal/corelib/numeric.rb +156 -0
  53. data/opal/corelib/object_space.rb +102 -0
  54. data/opal/corelib/random.rb +31 -66
  55. data/opal/corelib/random/formatter.rb +122 -0
  56. data/opal/corelib/range.rb +50 -19
  57. data/opal/corelib/runtime.js +82 -21
  58. data/opal/corelib/string.rb +86 -52
  59. data/opal/corelib/string/encoding.rb +140 -25
  60. data/opal/corelib/string/unpack.rb +26 -40
  61. data/opal/opal.rb +1 -0
  62. data/opal/opal/full.rb +1 -0
  63. data/package.json +1 -1
  64. data/spec/filters/bugs/array.rb +0 -22
  65. data/spec/filters/bugs/basicobject.rb +3 -0
  66. data/spec/filters/bugs/encoding.rb +0 -2
  67. data/spec/filters/bugs/exception.rb +1 -0
  68. data/spec/filters/bugs/float.rb +0 -2
  69. data/spec/filters/bugs/hash.rb +2 -7
  70. data/spec/filters/bugs/integer.rb +0 -2
  71. data/spec/filters/bugs/kernel.rb +16 -3
  72. data/spec/filters/bugs/language.rb +6 -14
  73. data/spec/filters/bugs/marshal.rb +1 -3
  74. data/spec/filters/bugs/module.rb +16 -1
  75. data/spec/filters/bugs/numeric.rb +4 -12
  76. data/spec/filters/bugs/objectspace.rb +67 -0
  77. data/spec/filters/bugs/pack_unpack.rb +0 -9
  78. data/spec/filters/bugs/pathname.rb +1 -0
  79. data/spec/filters/bugs/proc.rb +8 -0
  80. data/spec/filters/bugs/random.rb +3 -6
  81. data/spec/filters/bugs/range.rb +83 -113
  82. data/spec/filters/bugs/set.rb +2 -0
  83. data/spec/filters/bugs/string.rb +31 -70
  84. data/spec/filters/bugs/struct.rb +2 -0
  85. data/spec/filters/bugs/time.rb +8 -2
  86. data/spec/filters/unsupported/float.rb +3 -0
  87. data/spec/filters/unsupported/freeze.rb +1 -0
  88. data/spec/filters/unsupported/integer.rb +3 -0
  89. data/spec/filters/unsupported/refinements.rb +5 -0
  90. data/spec/filters/unsupported/string.rb +100 -95
  91. data/spec/filters/unsupported/time.rb +4 -0
  92. data/spec/lib/compiler_spec.rb +16 -0
  93. data/spec/lib/rewriters/forward_args_spec.rb +61 -0
  94. data/spec/lib/rewriters/logical_operator_assignment_spec.rb +1 -1
  95. data/spec/lib/rewriters/numblocks_spec.rb +44 -0
  96. data/spec/lib/rewriters/opal_engine_check_spec.rb +49 -4
  97. data/spec/opal/core/language/forward_args_spec.rb +53 -0
  98. data/spec/opal/core/language/infinite_range_spec.rb +13 -0
  99. data/spec/opal/core/language/memoization_spec.rb +16 -0
  100. data/spec/opal/core/module_spec.rb +38 -2
  101. data/spec/opal/core/number/to_i_spec.rb +28 -0
  102. data/spec/opal/core/runtime/bridged_classes_spec.rb +16 -0
  103. data/spec/opal/core/runtime/constants_spec.rb +20 -1
  104. data/spec/opal/core/string/subclassing_spec.rb +16 -0
  105. data/spec/opal/core/string/unpack_spec.rb +22 -0
  106. data/spec/opal/core/string_spec.rb +4 -4
  107. data/spec/ruby_specs +4 -1
  108. data/stdlib/json.rb +3 -1
  109. data/stdlib/securerandom.rb +55 -35
  110. data/tasks/testing.rake +6 -3
  111. data/test/nodejs/test_string.rb +25 -0
  112. data/vendored-minitest/minitest/assertions.rb +2 -0
  113. metadata +35 -12
  114. data/lib/opal/parser/with_c_lexer.rb +0 -15
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # There's no compatible c_lexer for parser 3.0.0.0 at this point...
4
- begin
5
- require 'c_lexer'
6
- rescue LoadError
7
- $stderr.puts 'Failed to load WithCLexer, using pure Ruby lexer' if $DEBUG
8
- end
9
-
10
- if defined? Parser::Ruby25WithWithCLexer
11
- class Opal::Parser::WithCLexer < Parser::Ruby25WithWithCLexer
12
- include Opal::Parser::DefaultConfig
13
- Opal::Parser.default_parser_class = self
14
- end
15
- end