mini_racer 0.2.8 → 0.2.9

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: 8f6c48eedae322fc66e7dc1f816d63d8d093a18a02167a16cada1cd04a34e821
4
- data.tar.gz: 0b4de89162986b4d729abff697c04de4f54216bb1a94c5d7737b7cf011fca85e
3
+ metadata.gz: 97112de9fedf9f005d85b2325d129a6689ac7b878da020db8caf13c4921e0a92
4
+ data.tar.gz: 20cdb63b3661c0626ff4edcf033380a6f59317265d84ecaa24df279d1a7acc39
5
5
  SHA512:
6
- metadata.gz: ce21ef957f04319ed5109e6f5ddbc2c17be7f657d9beed5941950ccf57d36054341c5f6685c790ab217d8445e1af1758e7d16c1745d47955042453c6294784c3
7
- data.tar.gz: 4e58fdfde4f8f78ade9c470510296cb8dcd30e3c02a8827f4c4ba68ee49e41dee66de5419938c52c98d9df41d1dd02433b5b0d5389f0d0664da100f5087e0db1
6
+ metadata.gz: e2db9f72fa5869a7e9c31ee1b9ef8215e07afb672f6142bf67fc3b509627c594f0e7282fd71bf62b64efb2cbe560a9bdf54615a0e522bc8d57e919746861dc02
7
+ data.tar.gz: dc844371d224fbbb7eebdc638282f5c9ee0250d3a09fd4a1fc1de1a7f0ef741bfb87e485f17048017ab7d1c4e34bed0a582d367ac0c603cb0ee738ea108e3d26
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ - 0.2.9
2
+
3
+ - 09-01-2020
4
+
5
+ - FIX: correct segfault when JS returns a Symbol and properly cast to ruby symbol
6
+
1
7
  - 0.2.8
2
8
 
3
9
  - 11-11-2019
@@ -444,8 +444,27 @@ static VALUE convert_v8_to_ruby(Isolate* isolate, Local<Context> context,
444
444
  return rb_hash;
445
445
  }
446
446
 
447
- Local<String> rstr = value->ToString(context).ToLocalChecked();
448
- return rb_enc_str_new(*String::Utf8Value(isolate, rstr), rstr->Utf8Length(isolate), rb_enc_find("utf-8"));
447
+ if (value->IsSymbol()) {
448
+ v8::String::Utf8Value symbol_name(isolate,
449
+ Local<Symbol>::Cast(value)->Name());
450
+
451
+ VALUE str_symbol = rb_enc_str_new(
452
+ *symbol_name,
453
+ symbol_name.length(),
454
+ rb_enc_find("utf-8")
455
+ );
456
+
457
+ return ID2SYM(rb_intern_str(str_symbol));
458
+ }
459
+
460
+ MaybeLocal<String> rstr_maybe = value->ToString(context);
461
+
462
+ if (rstr_maybe.IsEmpty()) {
463
+ return Qnil;
464
+ } else {
465
+ Local<String> rstr = rstr_maybe.ToLocalChecked();
466
+ return rb_enc_str_new(*String::Utf8Value(isolate, rstr), rstr->Utf8Length(isolate), rb_enc_find("utf-8"));
467
+ }
449
468
  }
450
469
 
451
470
  static VALUE convert_v8_to_ruby(Isolate* isolate,
@@ -1,3 +1,3 @@
1
1
  module MiniRacer
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
@@ -14,6 +14,12 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/discourse/mini_racer"
15
15
  spec.license = "MIT"
16
16
 
17
+ spec.metadata = {
18
+ "bug_tracker_uri" => "https://github.com/discourse/mini_racer/issues",
19
+ "changelog_uri" => "https://github.com/discourse/mini_racer/blob/v#{spec.version}/CHANGELOG",
20
+ "documentation_uri" => "https://www.rubydoc.info/gems/mini_racer/#{spec.version}",
21
+ "source_code_uri" => "https://github.com/discourse/mini_racer/tree/v#{spec.version}",
22
+ }
17
23
 
18
24
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(benchmark|test|spec|features|examples)/}) }
19
25
  spec.bindir = "exe"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_racer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-11 00:00:00.000000000 Z
11
+ date: 2020-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,7 +106,11 @@ files:
106
106
  homepage: https://github.com/discourse/mini_racer
107
107
  licenses:
108
108
  - MIT
109
- metadata: {}
109
+ metadata:
110
+ bug_tracker_uri: https://github.com/discourse/mini_racer/issues
111
+ changelog_uri: https://github.com/discourse/mini_racer/blob/v0.2.9/CHANGELOG
112
+ documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.2.9
113
+ source_code_uri: https://github.com/discourse/mini_racer/tree/v0.2.9
110
114
  post_install_message:
111
115
  rdoc_options: []
112
116
  require_paths: