Skip to content

Commit

Permalink
Update to libv8-node 17.x Take 2 (#271)
Browse files Browse the repository at this point in the history
* Upgrade to v8 9.6.180.15 / node 17.3.1

* bump libv8-node version

* Split locale tests for regression testing

* Reinstate aarch64 musl CI testing

* Add Ruby 3.2 to CI

---------

Co-authored-by: nightpool <eg1290@gmail.com>
Co-authored-by: Loic Nageleisen <loic.nageleisen@gmail.com>
Co-authored-by: Sam <sam.saffron@gmail.com>
  • Loading branch information
4 people committed May 26, 2023
1 parent 46fe327 commit 7193406
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ jobs:
libc:
- "gnu"
- "musl"
exclude:
# there's no libv8-node (v16) for aarch64-linux-musl at the moment
- platform: "arm64"
libc: "musl"

name: linux-${{ matrix.platform }} - ruby-${{ matrix.ruby }} - ${{ matrix.libc }}
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion ext/mini_racer_extension/mini_racer_extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ static VALUE convert_v8_to_ruby(Isolate* isolate, Local<Context> context,

if (value->IsSymbol()) {
v8::String::Utf8Value symbol_name(isolate,
Local<Symbol>::Cast(value)->Name());
Local<Symbol>::Cast(value)->Description(isolate));

VALUE str_symbol = rb_utf8_str_new(*symbol_name, symbol_name.length());

Expand Down
4 changes: 2 additions & 2 deletions lib/mini_racer/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module MiniRacer
VERSION = "0.6.4"
LIBV8_NODE_VERSION = "~> 16.19.0.0"
VERSION = "0.6.5"
LIBV8_NODE_VERSION = "~> 17.9.1.0"
end
13 changes: 12 additions & 1 deletion test/mini_racer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@ class MiniRacerTest < Minitest::Test
# see `test_platform_set_flags_works` below
MiniRacer::Platform.set_flags! :use_strict

def test_locale
def test_locale_mx
skip "TruffleRuby does not have all js timezone by default" if RUBY_ENGINE == "truffleruby"
val = MiniRacer::Context.new.eval("new Date('April 28 2021').toLocaleDateString('es-MX');")
assert_equal '28/4/2021', val
end

def test_locale_us
skip "TruffleRuby does not have all js timezone by default" if RUBY_ENGINE == "truffleruby"
val = MiniRacer::Context.new.eval("new Date('April 28 2021').toLocaleDateString('en-US');")
assert_equal '4/28/2021', val
end

def test_locale_fr
# TODO: this causes a segfault on Linux

skip "TruffleRuby does not have all js timezone by default" if RUBY_ENGINE == "truffleruby"
val = MiniRacer::Context.new.eval("new Date('April 28 2021').toLocaleDateString('fr-FR');")
assert_equal '28/04/2021', val
end

def test_segfault
skip "running this test is very slow"
# 5000.times do
Expand Down

0 comments on commit 7193406

Please sign in to comment.