Skip to content

Update to Node 18: libv8 API change (ScriptOrigin) #258

Description

@lloeki

I added a node-18 branch to rubyjs/libv8-node based on Node 18.8.0 / libv8 10.2.something, which mostly built successfully (except the ruby platform but right now I fail to understand why since it built fine otherwise).

Here's the result when testing on current mini_racer:

../../../../ext/mini_racer_extension/mini_racer_extension.cc:525:22: error: no matching constructor for initialization of 'v8::ScriptOrigin'
[87](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:88)
        origin = new v8::ScriptOrigin(*eval_params->filename);
[88](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:89)
                     ^                ~~~~~~~~~~~~~~~~~~~~~~
[89](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:90)
/usr/local/lib/ruby/gems/2.7.0/gems/libv8-node-18.8.0.0-x86_64-darwin/vendor/v8/include/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'Local<v8::String>' to 'const v8::ScriptOrigin' for 1st argument
[90](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:91)
class V8_EXPORT ScriptOrigin {
[91](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:92)
                ^
[92](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:93)
/usr/local/lib/ruby/gems/2.7.0/gems/libv8-node-18.8.0.0-x86_64-darwin/vendor/v8/include/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'Local<v8::String>' to 'v8::ScriptOrigin' for 1st argument
[93](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:94)
/usr/local/lib/ruby/gems/2.7.0/gems/libv8-node-18.8.0.0-x86_64-darwin/vendor/v8/include/v8-message.h:64:13: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
[94](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:95)
  V8_INLINE ScriptOrigin(Isolate* isolate, Local<Value> resource_name,
[95](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:96)
            ^
[96](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:97)
../../../../ext/mini_racer_extension/mini_racer_extension.cc:802:18: error: no matching constructor for initialization of 'v8::ScriptOrigin'
[97](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:98)
    ScriptOrigin origin(resource_name);
[98](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:99)
                 ^      ~~~~~~~~~~~~~
[99](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:100)
/usr/local/lib/ruby/gems/2.7.0/gems/libv8-node-18.8.0.0-x86_64-darwin/vendor/v8/include/v8-message.h:62:17: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'Local<v8::String>' to 'const v8::ScriptOrigin' for 1st argument
[100](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:101)
class V8_EXPORT ScriptOrigin {
[101](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:102)
                ^
[102](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:103)
/usr/local/lib/ruby/gems/2.7.0/gems/libv8-node-18.8.0.0-x86_64-darwin/vendor/v8/include/v8-message.h:62:17: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'Local<v8::String>' to 'v8::ScriptOrigin' for 1st argument
[103](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:104)
/usr/local/lib/ruby/gems/2.7.0/gems/libv8-node-18.8.0.0-x86_64-darwin/vendor/v8/include/v8-message.h:64:13: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
[104](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:105)
  V8_INLINE ScriptOrigin(Isolate* isolate, Local<Value> resource_name,
[105](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:106)
            ^
[106](https://github.com/rubyjs/libv8-node/runs/8025962683?check_suite_focus=true#step:5:107)
2 errors generated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions