Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Update bindings for io.js 3.0.0 #1054

Merged
merged 15 commits into from
Aug 19, 2015
Merged

Update bindings for io.js 3.0.0 #1054

merged 15 commits into from
Aug 19, 2015

Conversation

saper
Copy link
Member

@saper saper commented Aug 5, 2015

Update to io.js 3.0.0, use nan 2.0

The code has been updated to meet
the requirements of the updated V8 engine
as provided by io.js.

In some cases additional EscapableHandleScope
has been provided.

SassValueWrapper<T>::New has been changed:
in case of instance construction via
the function call sass.types.Color(0,0,0)
(actually incorrect JavaScript...)
instead of new sass.types.Color(0,0,0)
the new part is no longer executed by
falling through. This should not be necessary
because the constructor is called by
the NewInstance call anyway.

This fixes the following error:

FATAL ERROR: v8::Object::SetAlignedPointerInInternalField() Internal field out of bounds

@saper
Copy link
Member Author

saper commented Aug 8, 2015

\o/

The code has been updated to meet
the requirements of the updated V8 engine
as provided by io.js.

In some cases additional EscapableHandleScope
has been provided.

SassValueWrapper<T>::New has been changed:
in case of instance construction via
the function call "sass.types.Color(0,0,0)"
instead of "new sass.types.Color(0,0,0)"
the "new" part is no longer executed by
falling through. This should not be necessary
because the constructor is called by
the NewInstance call anyway.

This fixes the following error:

FATAL ERROR: v8::Object::SetAlignedPointerInInternalField() Internal field out of bounds
@saper saper changed the title [WIP] Update bindings for io.js 3.0.0 Update bindings for io.js 3.0.0 Aug 8, 2015
@saper
Copy link
Member Author

saper commented Aug 8, 2015

It looks like this change is ready now for wider testing and review.

The coverage is down by one line in index.js which is interesting, because we no longer throw errors
as bare strings. This can be the consequence of the change in the SassValueWrapper<T>::New
to what I now believe is the correct behaviour.

@matryo you might want to have a look at this (I put my comments inline).

@xzyfer
Copy link
Contributor

xzyfer commented Aug 8, 2015

Amazing work @saper. I've just come back from my trip. Testing this on OSX now.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 8, 2015

Things look good on OSX. I'll give Windows a whirl and start prepping a new release.

@xzyfer xzyfer added this to the next.minor milestone Aug 8, 2015

struct Sass_Context* ctx;

NanAssignPersistent(ctx_w->result, options->Get(NanNew("result"))->ToObject());
ctx_w->result.Reset(Nan::Get(options, Nan::New("result").ToLocalChecked()).ToLocalChecked()->ToObject());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx_w->result.Reset(Nan::To<v8::Object>(Nan::Get(options, Nan::New("result").ToLocalChecked()).ToLocalChecked()).ToLocalChecked());

@saper
Copy link
Member Author

saper commented Aug 19, 2015

So, this is it, I think.

I have addressed almost all comments from @kkoopa (big thanks again!). In case I decided to go in the other direction - I have replied to the code review comment in this thread.

Every commit in this pull request is standalone and should be passing tests (bar whimsical AppVeyor behaviour), so I will not be squashing them. If we will find problems, I want to have one of those commits clearly identified.

I hope I will soon stop whispering <v8::Local<v8::Value>> in my dreams :)

@xzyfer
Copy link
Contributor

xzyfer commented Aug 19, 2015

😍

@saper
Copy link
Member Author

saper commented Aug 19, 2015

Looks like AppVeyor has some trouble installing node v0.10.40.

Use TypeError whenever argument count
or type do not match and RangeError
if the index is out of bounds.
xzyfer added a commit that referenced this pull request Aug 19, 2015
Update bindings for io.js 3.0.0
@xzyfer xzyfer merged commit 8d49972 into sass:master Aug 19, 2015
@dukex
Copy link

dukex commented Aug 19, 2015

Thank you @saper, @xzyfer and @kkoopa <3 <3

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

Successfully merging this pull request may close these issues.

4 participants