opal 0.8.0.rc1 → 0.8.0.rc2
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/.travis.yml +4 -0
- data/CHANGELOG.md +6 -0
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/hash.rb +47 -2
- data/opal/corelib/kernel.rb +1 -0
- data/opal/corelib/string.rb +4 -0
- data/opal/corelib/variables.rb +3 -3
- data/spec/filters/bugs/hash.rb +0 -11
- data/spec/opal/core/language/predefined_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e61445cf4e1d298823c1de6822ede17c133f10dc
|
4
|
+
data.tar.gz: dd4f67da6dde06a3f9ca8c82c15ff8f47b1957f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2788eb5f67b8e7d9c7d18b952ebcc2bd40fa32b7e858330de25b87e8ffbfd2993af6e83396a2c4ab9cbe59c2bac2032e3bafc84f938814e67bc8d84fb9fd5aab
|
7
|
+
data.tar.gz: 45c31850bda55bb31a838ed42186f354146f98915031fe80d2e0c481a5ca7074a3d66b70049d6173470c3fadfc4bc9cf72051fc6da5c19c525e5eadb671408ed
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## edge (upcoming 0.8.0)
|
2
2
|
|
3
|
+
* Fix `String#split` when no match is found and a limit is provided
|
4
|
+
|
5
|
+
* Fix `require_tree(".")` when used from file at the root of the assets paths
|
6
|
+
|
7
|
+
* `Hash[]` implementation fully compliant with rubyspec
|
8
|
+
|
3
9
|
* Removed minitest from stdlib. It's not part of MRI and it never belonged there, checkout the opal-minitest gem instead.
|
4
10
|
|
5
11
|
* Parser: Allow trailing comma in paren arglists, after normal args as
|
data/lib/opal/version.rb
CHANGED
data/opal/corelib/hash.rb
CHANGED
@@ -6,8 +6,53 @@ class Hash
|
|
6
6
|
# Mark all hash instances as valid hashes (used to check keyword args, etc)
|
7
7
|
`def.$$is_hash = true`
|
8
8
|
|
9
|
-
def self.[](*
|
10
|
-
|
9
|
+
def self.[](*argv)
|
10
|
+
%x{
|
11
|
+
var hash, i, argc = argv.length;
|
12
|
+
|
13
|
+
if (argc === 1) {
|
14
|
+
hash = #{Opal.coerce_to?(argv[0], Hash, :to_hash)};
|
15
|
+
if (hash !== nil) {
|
16
|
+
return #{allocate.merge!(`hash`)};
|
17
|
+
}
|
18
|
+
|
19
|
+
argv = #{Opal.coerce_to?(argv[0], Array, :to_ary)};
|
20
|
+
if (argv === nil) {
|
21
|
+
#{raise ArgumentError, 'odd number of arguments for Hash'}
|
22
|
+
}
|
23
|
+
|
24
|
+
argc = argv.length;
|
25
|
+
hash = #{allocate};
|
26
|
+
|
27
|
+
for (i = 0; i < argc; i++) {
|
28
|
+
if (!argv[i].$$is_array) continue;
|
29
|
+
switch(argv[i].length) {
|
30
|
+
case 1:
|
31
|
+
hash.$store(argv[i][0], nil);
|
32
|
+
break;
|
33
|
+
case 2:
|
34
|
+
hash.$store(argv[i][0], argv[i][1]);
|
35
|
+
break;
|
36
|
+
default:
|
37
|
+
#{raise ArgumentError, "invalid number of elements (#{`argv[i].length`} for 1..2)"}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
return hash;
|
42
|
+
}
|
43
|
+
|
44
|
+
if (argc % 2 !== 0) {
|
45
|
+
#{raise ArgumentError, 'odd number of arguments for Hash'}
|
46
|
+
}
|
47
|
+
|
48
|
+
hash = #{allocate};
|
49
|
+
|
50
|
+
for (i = 0; i < argc; i += 2) {
|
51
|
+
hash.$store(argv[i], argv[i + 1]);
|
52
|
+
}
|
53
|
+
|
54
|
+
return hash;
|
55
|
+
}
|
11
56
|
end
|
12
57
|
|
13
58
|
def self.allocate
|
data/opal/corelib/kernel.rb
CHANGED
@@ -1045,6 +1045,7 @@ module Kernel
|
|
1045
1045
|
# `path` should be the full path to be found in registered modules (`Opal.modules`)
|
1046
1046
|
def require_tree(path)
|
1047
1047
|
path = File.expand_path(path)
|
1048
|
+
path = '' if path == '.'
|
1048
1049
|
|
1049
1050
|
%x{
|
1050
1051
|
for (var name in Opal.modules) {
|
data/opal/corelib/string.rb
CHANGED
data/opal/corelib/variables.rb
CHANGED
data/spec/filters/bugs/hash.rb
CHANGED
@@ -1,15 +1,4 @@
|
|
1
1
|
opal_filter "Hash" do
|
2
|
-
fails "Hash.[] coerces a single argument which responds to #to_ary"
|
3
|
-
fails "Hash.[] ignores elements that are not arrays"
|
4
|
-
fails "Hash.[] calls to_hash"
|
5
|
-
fails "Hash.[] returns an instance of a subclass when passed an Array"
|
6
|
-
fails "Hash.[] returns instances of subclasses"
|
7
|
-
fails "Hash.[] returns an instance of the class it's called on"
|
8
|
-
fails "Hash.[] does not call #initialize on the subclass instance"
|
9
|
-
fails "Hash.[] passed an array treats elements that are 1 element arrays as keys with value nil"
|
10
|
-
fails "Hash.[] passed a single argument which responds to #to_hash coerces it and returns a copy"
|
11
|
-
fails "Hash.[] removes the default_proc"
|
12
|
-
|
13
2
|
fails "Hash#assoc only returns the first matching key-value pair for identity hashes"
|
14
3
|
|
15
4
|
fails "Hash#default_proc= uses :to_proc on its argument"
|
@@ -114,7 +114,7 @@ describe "The predefined global constants" do
|
|
114
114
|
|
115
115
|
it "includes RUBY_VERSION" do
|
116
116
|
Object.const_defined?(:RUBY_VERSION).should == true
|
117
|
-
RUBY_VERSION.should == "2.1.
|
117
|
+
RUBY_VERSION.should == "2.1.5"
|
118
118
|
end
|
119
119
|
|
120
120
|
it "includes RUBY_RELEASE_DATE" do
|
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.8.0.
|
4
|
+
version: 0.8.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Beynon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sourcemap
|
@@ -936,7 +936,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
936
936
|
version: 1.3.1
|
937
937
|
requirements: []
|
938
938
|
rubyforge_project:
|
939
|
-
rubygems_version: 2.4.
|
939
|
+
rubygems_version: 2.4.6
|
940
940
|
signing_key:
|
941
941
|
specification_version: 4
|
942
942
|
summary: Ruby runtime and core library for javascript
|