opal-js_wrap-three 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8d337f64fdef8fce80b4854e1b83ab6fe4e7b2e6ad7270c1909cf83a014affe
4
- data.tar.gz: c51972e3cef54207fb35a822aacf6e80d3c4c2093f64017b051d362f5a4b6f16
3
+ metadata.gz: 8cadbc524a8e47cb01c019ca493fe26f39e55830ed8a97b277137e68610521f9
4
+ data.tar.gz: 25be6fcee99f405bbc92e67b95d135196c8e0f30efd35f89eeab6cb0960d4336
5
5
  SHA512:
6
- metadata.gz: b58472f8c2f80feda8032e0cc5c802b91f34981a8dbe9f3b13467b1294abb92ff917a199c9bd734fe3f67a55730dd9041dda2abafffddc412b1049f6c917d2d6
7
- data.tar.gz: 65a2139d05986733e902ee42a4de3970413f6a465db1a0352775f2bceedc6b52bd961fcb29fd61b32cee6c0c31795755cbaff08dbc31c120038a97a463af62e9
6
+ metadata.gz: 17b61356a4c8845013ea98affd2efaed63c0fbcf1e470f6f376937731ca3d6bf02c9d65c14a104c9b01187a68b9430e8bd3727ef689ba0b69f0603cbda7785d9
7
+ data.tar.gz: 8819e91de6386498d111369e92fe3f65242e35a3c46c97eecb557b58939f412f11c7958ac0494752ac048029765cf8ad4874219bb922f6f647ad77286a1818c5
@@ -3,7 +3,7 @@
3
3
  module Opal
4
4
  module JSWrap
5
5
  module Three
6
- VERSION = "0.1.4"
6
+ VERSION = "0.1.5"
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  require "js_wrap"
2
4
  require "js_wrap/three/three" # JavaScript
3
5
 
data/lib-opal/js_wrap.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # helpers: native, defineProperty
2
+ # backtick_javascript: true
2
3
 
3
4
  `var inspect_stack = []`
4
5
 
@@ -675,24 +676,12 @@ class Hash
675
676
  # @return a JavaScript object with the same keys but calling #to_js on
676
677
  # all values.
677
678
  def to_js(parent=nil)
678
- %x{
679
- var result = {},
680
- keys = self.$$keys,
681
- smap = self.$$smap,
682
- key, value;
683
- for (var i = 0, length = keys.length; i < length; i++) {
684
- key = keys[i];
685
- if (key.$$is_string) {
686
- value = smap[key];
687
- } else {
688
- key = key.key;
689
- value = key.value;
690
- }
691
- key = #{parent.js_property_name_rb2js(`key`)}
692
- result[key] = #{JSWrap.unwrap(`value`, parent)}
693
- }
694
- return result;
695
- }
679
+ result = `{}`
680
+ each do |k,v|
681
+ key = parent ? parent.js_property_name_rb2js(k) : k
682
+ `result[key] = #{JSWrap.unwrap(`v`, parent)}`
683
+ end
684
+ result
696
685
  end
697
686
  end
698
687
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-js_wrap-three
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - hmdne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-18 00:00:00.000000000 Z
11
+ date: 2023-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -581,7 +581,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
581
581
  - !ruby/object:Gem::Version
582
582
  version: '0'
583
583
  requirements: []
584
- rubygems_version: 3.4.6
584
+ rubygems_version: 3.4.10
585
585
  signing_key:
586
586
  specification_version: 4
587
587
  summary: Wrapper for Three.js