opal 1.7.0 → 1.7.2
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/.github/workflows/build.yml +12 -4
- data/CHANGELOG.md +39 -1
- data/UNRELEASED.md +1 -0
- data/docs/cdp_common.md +1 -1
- data/docs/compiler.md +1 -1
- data/docs/releasing.md +24 -8
- data/exe/opal +5 -7
- data/lib/opal/builder.rb +13 -13
- data/lib/opal/builder_processors.rb +8 -2
- data/lib/opal/builder_scheduler/prefork.rb +64 -9
- data/lib/opal/cli.rb +60 -43
- data/lib/opal/cli_runners/compiler.rb +7 -6
- data/lib/opal/cli_runners/safari.rb +208 -0
- data/lib/opal/cli_runners.rb +1 -0
- data/lib/opal/nodes/literal.rb +16 -0
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/constants.rb +3 -3
- data/spec/filters/platform/.keep +0 -0
- data/spec/filters/platform/firefox/exception.rb +8 -0
- data/spec/filters/platform/firefox/kernel.rb +3 -0
- data/spec/filters/platform/safari/exception.rb +8 -0
- data/spec/filters/platform/safari/float.rb +4 -0
- data/spec/filters/platform/safari/kernel.rb +3 -0
- data/spec/filters/platform/safari/literal_regexp.rb +6 -0
- data/spec/lib/builder_spec.rb +32 -0
- data/spec/lib/cli_spec.rb +28 -6
- data/spec/lib/fixtures/build_order/file1.js +1 -0
- data/spec/lib/fixtures/build_order/file2.js +1 -0
- data/spec/lib/fixtures/build_order/file3.js +1 -0
- data/spec/lib/fixtures/build_order/file4.js +1 -0
- data/spec/lib/fixtures/build_order/file5.rb.erb +4 -0
- data/spec/lib/fixtures/build_order/file51.js +1 -0
- data/spec/lib/fixtures/build_order/file6.rb +10 -0
- data/spec/lib/fixtures/build_order/file61.rb +1 -0
- data/spec/lib/fixtures/build_order/file62.rb +4 -0
- data/spec/lib/fixtures/build_order/file63.rb +4 -0
- data/spec/lib/fixtures/build_order/file64.rb +1 -0
- data/spec/lib/fixtures/build_order/file7.rb +1 -0
- data/spec/lib/fixtures/build_order.rb +9 -0
- data/spec/lib/rake_dist_spec.rb +69 -0
- data/spec/lib/spec_helper.rb +2 -0
- data/spec/mspec-opal/runner.rb +1 -0
- data/spec/opal/core/io/read_spec.rb +12 -3
- data/stdlib/opal/platform.rb +1 -0
- data/stdlib/opal-platform.rb +3 -0
- data/stdlib/time.rb +21 -1
- data/tasks/building.rake +1 -1
- data/tasks/releasing.rake +46 -0
- data/tasks/testing.rake +3 -4
- metadata +30 -7
data/stdlib/time.rb
CHANGED
@@ -1,6 +1,26 @@
|
|
1
1
|
class Time
|
2
2
|
def self.parse(str)
|
3
|
-
|
3
|
+
%x{
|
4
|
+
var d = Date.parse(str);
|
5
|
+
if (d !== d) {
|
6
|
+
// parsing failed, d is a NaN
|
7
|
+
// probably str is not in ISO 8601 format, which is the only format, required to be supported by Javascript
|
8
|
+
// try to make the format more like ISO or more like Chrome and parse again
|
9
|
+
str = str.replace(/^(\d+)([\./])(\d+)([\./])?(\d+)?/, function(matched_sub, c1, c2, c3, c4, c5, offset, orig_string) {
|
10
|
+
if ((c2 === c4) && c5) {
|
11
|
+
// 2007.10.1 or 2007/10/1 are ok, but 2007/10.1 is not, convert to 2007-10-1
|
12
|
+
return c1 + '-' + c3 + '-' + c5;
|
13
|
+
} else if (c3 && !c4) {
|
14
|
+
// 2007.10 or 2007/10
|
15
|
+
// Chrome and Ruby can parse "2007/10", assuming its "2007-10-01", do the same
|
16
|
+
return c1 + '-' + c3 + '-01';
|
17
|
+
};
|
18
|
+
return matched_sub;
|
19
|
+
});
|
20
|
+
d = Date.parse(str);
|
21
|
+
}
|
22
|
+
return new Date(d);
|
23
|
+
}
|
4
24
|
end
|
5
25
|
|
6
26
|
def self.def_formatter(name, format, on_utc: false, utc_tz: nil, tz_format: nil, fractions: false, on: self)
|
data/tasks/building.rake
CHANGED
@@ -38,7 +38,7 @@ task :dist do
|
|
38
38
|
$stdout.flush
|
39
39
|
|
40
40
|
# Set requirable to true, unless building opal. This allows opal to be auto-loaded.
|
41
|
-
requirable = (%w[opal opal/mini opal/base].include? lib)
|
41
|
+
requirable = !(%w[opal opal/mini opal/base].include? lib)
|
42
42
|
builder = Opal::Builder.build(lib, requirable: requirable)
|
43
43
|
|
44
44
|
src = builder.to_s if (formats & %w[js min gz]).any?
|
data/tasks/releasing.rake
CHANGED
@@ -80,3 +80,49 @@ task :changelog do
|
|
80
80
|
|
81
81
|
File.write changelog_path, changelog_entries.join("\n\n\n\n\n")
|
82
82
|
end
|
83
|
+
|
84
|
+
namespace :release do
|
85
|
+
task :prepare do
|
86
|
+
version = ENV['VERSION'] or abort "please provide a version as the first argument, e.g.: #{$0} 1.2.3"
|
87
|
+
version = version[1..] if version.start_with? 'v'
|
88
|
+
gem_version = Gem::Version.new(version)
|
89
|
+
|
90
|
+
version_path = "#{__dir__}/../lib/opal/version.rb"
|
91
|
+
puts "== update #{version_path}"
|
92
|
+
require_relative version_path
|
93
|
+
File.write version_path, File.read(version_path).sub(Opal::VERSION, version)
|
94
|
+
|
95
|
+
constants_path = "#{__dir__}/../opal/corelib/constants.rb"
|
96
|
+
puts "== update #{constants_path}"
|
97
|
+
require_relative constants_path
|
98
|
+
File.write constants_path, File.read(constants_path).sub(Opal::VERSION, version).sub(
|
99
|
+
%r{(RUBY_RELEASE_DATE *= *')\d{4}-\d{2}-\d{2}(')},
|
100
|
+
'\1' + Time.now.strftime('%F') + '\2'
|
101
|
+
)
|
102
|
+
|
103
|
+
if gem_version.prerelease?
|
104
|
+
puts "== (skipping changlog update)"
|
105
|
+
else
|
106
|
+
puts "== update changelog"
|
107
|
+
|
108
|
+
system "bin/rake changelog VERSION=v#{version}" or abort('changelog update failed')
|
109
|
+
File.write "#{__dir__}/../UNRELEASED.md", <<~MARKDOWN
|
110
|
+
<!--
|
111
|
+
### Internal
|
112
|
+
### Changed
|
113
|
+
### Added
|
114
|
+
### Removed
|
115
|
+
### Deprecated
|
116
|
+
### Performance
|
117
|
+
### Fixed
|
118
|
+
-->
|
119
|
+
|
120
|
+
MARKDOWN
|
121
|
+
end
|
122
|
+
|
123
|
+
puts "== committing"
|
124
|
+
sh 'git add UNRELEASED.md CHANGELOG.md opal/corelib/constants.rb lib/opal/version.rb'
|
125
|
+
sh "git commit -m 'Release v#{version}'"
|
126
|
+
sh 'git show | cat'
|
127
|
+
end
|
128
|
+
end
|
data/tasks/testing.rake
CHANGED
@@ -80,7 +80,7 @@ module Testing
|
|
80
80
|
specs
|
81
81
|
end
|
82
82
|
|
83
|
-
def filters(suite)
|
83
|
+
def filters(suite, platform)
|
84
84
|
opalspec_filters = Dir['spec/filters/**/*_opal.rb']
|
85
85
|
|
86
86
|
if ENV['INVERT_RUNNING_MODE']
|
@@ -88,7 +88,7 @@ module Testing
|
|
88
88
|
# Unsupported features are not supported anyway
|
89
89
|
rubyspec_filters = Dir['spec/filters/bugs/*.rb'] - opalspec_filters
|
90
90
|
else
|
91
|
-
rubyspec_filters = Dir[
|
91
|
+
rubyspec_filters = Dir["spec/filters/{unsupported,bugs,platform/#{platform}}/*.rb"] - opalspec_filters
|
92
92
|
end
|
93
93
|
|
94
94
|
suite == 'opal' ? opalspec_filters : rubyspec_filters
|
@@ -310,8 +310,7 @@ platforms.each do |platform|
|
|
310
310
|
'FORMATTER' => platform, # Use the current platform as the default formatter
|
311
311
|
'BM_FILEPATH' => bm_filepath,
|
312
312
|
}.merge(ENV.to_hash)
|
313
|
-
|
314
|
-
Testing::MSpec.write_file filename, Testing::MSpec.filters(suite), Testing::MSpec.specs(specs_env), specs_env
|
313
|
+
Testing::MSpec.write_file filename, Testing::MSpec.filters(suite, platform), Testing::MSpec.specs(specs_env), specs_env
|
315
314
|
|
316
315
|
stubs = Testing::MSpec.stubs.map{|s| "-s#{s}"}.join(' ')
|
317
316
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-01-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ast
|
@@ -517,6 +517,7 @@ files:
|
|
517
517
|
- lib/opal/cli_runners/package-lock.json
|
518
518
|
- lib/opal/cli_runners/package.json
|
519
519
|
- lib/opal/cli_runners/quickjs.rb
|
520
|
+
- lib/opal/cli_runners/safari.rb
|
520
521
|
- lib/opal/cli_runners/server.rb
|
521
522
|
- lib/opal/cli_runners/source-map-support-browser.js
|
522
523
|
- lib/opal/cli_runners/source-map-support-node.js
|
@@ -747,6 +748,13 @@ files:
|
|
747
748
|
- spec/filters/bugs/trace_point.rb
|
748
749
|
- spec/filters/bugs/unboundmethod.rb
|
749
750
|
- spec/filters/bugs/warnings.rb
|
751
|
+
- spec/filters/platform/.keep
|
752
|
+
- spec/filters/platform/firefox/exception.rb
|
753
|
+
- spec/filters/platform/firefox/kernel.rb
|
754
|
+
- spec/filters/platform/safari/exception.rb
|
755
|
+
- spec/filters/platform/safari/float.rb
|
756
|
+
- spec/filters/platform/safari/kernel.rb
|
757
|
+
- spec/filters/platform/safari/literal_regexp.rb
|
750
758
|
- spec/filters/unsupported/array.rb
|
751
759
|
- spec/filters/unsupported/basicobject.rb
|
752
760
|
- spec/filters/unsupported/bignum.rb
|
@@ -783,6 +791,19 @@ files:
|
|
783
791
|
- spec/lib/config_spec.rb
|
784
792
|
- spec/lib/dependency_resolver_spec.rb
|
785
793
|
- spec/lib/deprecations_spec.rb
|
794
|
+
- spec/lib/fixtures/build_order.rb
|
795
|
+
- spec/lib/fixtures/build_order/file1.js
|
796
|
+
- spec/lib/fixtures/build_order/file2.js
|
797
|
+
- spec/lib/fixtures/build_order/file3.js
|
798
|
+
- spec/lib/fixtures/build_order/file4.js
|
799
|
+
- spec/lib/fixtures/build_order/file5.rb.erb
|
800
|
+
- spec/lib/fixtures/build_order/file51.js
|
801
|
+
- spec/lib/fixtures/build_order/file6.rb
|
802
|
+
- spec/lib/fixtures/build_order/file61.rb
|
803
|
+
- spec/lib/fixtures/build_order/file62.rb
|
804
|
+
- spec/lib/fixtures/build_order/file63.rb
|
805
|
+
- spec/lib/fixtures/build_order/file64.rb
|
806
|
+
- spec/lib/fixtures/build_order/file7.rb
|
786
807
|
- spec/lib/fixtures/complex_sprockets.js.rb.erb
|
787
808
|
- spec/lib/fixtures/file_with_directives.js
|
788
809
|
- spec/lib/fixtures/jst_file.js.jst
|
@@ -800,6 +821,7 @@ files:
|
|
800
821
|
- spec/lib/fixtures/sprockets_require_tree_test.rb
|
801
822
|
- spec/lib/path_reader_spec.rb
|
802
823
|
- spec/lib/paths_spec.rb
|
824
|
+
- spec/lib/rake_dist_spec.rb
|
803
825
|
- spec/lib/repl_spec.rb
|
804
826
|
- spec/lib/rewriters/base_spec.rb
|
805
827
|
- spec/lib/rewriters/binary_operator_assignment_spec.rb
|
@@ -1193,10 +1215,10 @@ licenses:
|
|
1193
1215
|
metadata:
|
1194
1216
|
homepage_uri: https://opalrb.com/
|
1195
1217
|
bug_tracker_uri: https://github.com/opal/opal/issues
|
1196
|
-
changelog_uri: https://github.com/opal/opal/blob/v1.7.
|
1197
|
-
readme_uri: https://github.com/opal/opal/blob/v1.7.
|
1198
|
-
api_documentation_uri: http://opalrb.com/docs/api/v1.7.
|
1199
|
-
guides_uri: http://opalrb.com/docs/guides/v1.7.
|
1218
|
+
changelog_uri: https://github.com/opal/opal/blob/v1.7.2/CHANGELOG.md
|
1219
|
+
readme_uri: https://github.com/opal/opal/blob/v1.7.2/README.md
|
1220
|
+
api_documentation_uri: http://opalrb.com/docs/api/v1.7.2/index.html
|
1221
|
+
guides_uri: http://opalrb.com/docs/guides/v1.7.2/index.html
|
1200
1222
|
chat_uri: https://gitter.im/opal/opal
|
1201
1223
|
source_code_uri: https://github.com/opal/opal
|
1202
1224
|
post_install_message:
|
@@ -1214,7 +1236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1214
1236
|
- !ruby/object:Gem::Version
|
1215
1237
|
version: '0'
|
1216
1238
|
requirements: []
|
1217
|
-
rubygems_version: 3.3
|
1239
|
+
rubygems_version: 3.4.3
|
1218
1240
|
signing_key:
|
1219
1241
|
specification_version: 4
|
1220
1242
|
summary: Ruby runtime and core library for JavaScript
|
@@ -1481,6 +1503,7 @@ test_files:
|
|
1481
1503
|
- lib/opal/cli_runners/package-lock.json
|
1482
1504
|
- lib/opal/cli_runners/package.json
|
1483
1505
|
- lib/opal/cli_runners/quickjs.rb
|
1506
|
+
- lib/opal/cli_runners/safari.rb
|
1484
1507
|
- lib/opal/cli_runners/server.rb
|
1485
1508
|
- lib/opal/cli_runners/source-map-support-browser.js
|
1486
1509
|
- lib/opal/cli_runners/source-map-support-node.js
|