Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still error: ‘class v8::Maybe<double>’ has no member named ‘ToChecked’ with nan 2.14.1 #896

Closed
matburnham opened this issue Jul 28, 2020 · 2 comments

Comments

@matburnham
Copy link

I'm trying to make node-osmium work on node 12 and 14. That I'm somewhere with, but now the build breaks on node 6:

../src/buffer_wrap.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE node_osmium::BufferWrap::filter_point_in_time(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/buffer_wrap.cpp:138:146: error: ‘class v8::Maybe<double>’ has no member named ‘ToChecked’
  138 | tic_cast<int32_t>(v8::Date::Cast(*info[0])->NumberValue(info.GetIsolate()->GetCurrentContext()).ToChecked() / 1000));
      |                                                                                                 ^~~~~~~~~

buffer_wrap.cpp#L138:

    NAN_METHOD(BufferWrap::filter_point_in_time) {
        INSTANCE_CHECK(BufferWrap, "Buffer", "filter_point_in_time");
        if (info.Length() != 1) {
            Nan::ThrowTypeError(Nan::New("please provide a point in time as first and only argument").ToLocalChecked());
            return;
        }

        osmium::Timestamp point_in_time;
        if (info[0]->IsInt32()) {
            point_in_time = Nan::To<int32_t>(info[0]).ToChecked();
        } else if (info[0]->IsString()) {
            Nan::Utf8String time_string { info[0] };
            point_in_time = osmium::Timestamp(*time_string);
        } else if (info[0]->IsDate()) {
            point_in_time = osmium::Timestamp(static_cast<int32_t>(v8::Date::Cast(*info[0])->NumberValue(info.GetIsolate()->GetCurrentContext()).ToChecked() / 1000));
        }

I've upgraded to nan 2.14.1 to ensure #852 is applied, but I'm still getting similar errors to #851 when building with Node 6.

@addaleax
Copy link
Member

@matburnham This is happening because they use the V8 methods, not the nan ones, so there’s nothing we can do about it on nan’s side. Can you report this to the node-osmium project instead?

@matburnham
Copy link
Author

Oh, duh. Of course it isn't anything to do with nan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants