Skip to content

Commit

Permalink
update electron 9
Browse files Browse the repository at this point in the history
  • Loading branch information
summeroff committed Jun 16, 2020
1 parent 80e6c9c commit 76372b7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

SET(NODEJS_URL "https://atom.io/download/atom-shell" CACHE STRING "Node.JS URL")
SET(NODEJS_NAME "iojs" CACHE STRING "Node.JS Name")
SET(NODEJS_VERSION "v6.0.3" CACHE STRING "Node.JS Version")
SET(NODEJS_VERSION "v9.0.4" CACHE STRING "Node.JS Version")


include(NodeJS)
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ strategy:
Electron5:
RuntimeURL: https://atom.io/download/atom-shell
RuntimeName: iojs
RuntimeVersion: v6.0.3
RuntimeVersion: v9.0.4

pool:
vmImage: 'vs2017-win2016'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Provides access to the system font catalog",
"main": "main.js",
"devDependencies": {
"nan": "2.14.0",
"nan": "2.14.1",
"mocha": "*"
},
"keywords": [
Expand Down
28 changes: 14 additions & 14 deletions src/FontDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ struct FontDescriptor {
Local<Object> toJSObject() {
Nan::EscapableHandleScope scope;
Local<Object> res = Nan::New<Object>();
res->Set(Nan::New<String>("path").ToLocalChecked(), Nan::New<String>(path).ToLocalChecked());
res->Set(Nan::New<String>("postscriptName").ToLocalChecked(), Nan::New<String>(postscriptName).ToLocalChecked());
res->Set(Nan::New<String>("family").ToLocalChecked(), Nan::New<String>(family).ToLocalChecked());
res->Set(Nan::New<String>("style").ToLocalChecked(), Nan::New<String>(style).ToLocalChecked());
res->Set(Nan::New<String>("weight").ToLocalChecked(), Nan::New<Number>(weight));
res->Set(Nan::New<String>("width").ToLocalChecked(), Nan::New<Number>(width));
res->Set(Nan::New<String>("italic").ToLocalChecked(), Nan::New<v8::Boolean>(italic));
res->Set(Nan::New<String>("oblique").ToLocalChecked(), Nan::New<v8::Boolean>(oblique));
res->Set(Nan::New<String>("monospace").ToLocalChecked(), Nan::New<v8::Boolean>(monospace));
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("path").ToLocalChecked(), Nan::New<String>(path).ToLocalChecked());
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("postscriptName").ToLocalChecked(), Nan::New<String>(postscriptName).ToLocalChecked());
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("family").ToLocalChecked(), Nan::New<String>(family).ToLocalChecked());
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("style").ToLocalChecked(), Nan::New<String>(style).ToLocalChecked());
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("weight").ToLocalChecked(), Nan::New<Number>(weight));
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("width").ToLocalChecked(), Nan::New<Number>(width));
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("italic").ToLocalChecked(), Nan::New<v8::Boolean>(italic));
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("oblique").ToLocalChecked(), Nan::New<v8::Boolean>(oblique));
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>("monospace").ToLocalChecked(), Nan::New<v8::Boolean>(monospace));
return scope.Escape(res);
}

Expand All @@ -141,7 +141,7 @@ struct FontDescriptor {

char *getString(Local<Object> obj, const char *name) {
Nan::HandleScope scope;
Local<Value> value = obj->Get(Nan::New<String>(name).ToLocalChecked());
Local<Value> value = obj->Get(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>(name).ToLocalChecked()).ToLocalChecked();

if (value->IsString()) {
return copyString(*Nan::Utf8String(value));
Expand All @@ -152,21 +152,21 @@ struct FontDescriptor {

int getNumber(Local<Object> obj, const char *name) {
Nan::HandleScope scope;
Local<Value> value = obj->Get(Nan::New<String>(name).ToLocalChecked());
Local<Value> value = obj->Get(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>(name).ToLocalChecked()).ToLocalChecked();

if (value->IsNumber()) {
return value->Int32Value();
return value->Int32Value(v8::Isolate::GetCurrent()->GetCurrentContext()).ToChecked();
}

return 0;
}

bool getBool(Local<Object> obj, const char *name) {
Nan::HandleScope scope;
Local<Value> value = obj->Get(Nan::New<String>(name).ToLocalChecked());
Local<Value> value = obj->Get(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New<String>(name).ToLocalChecked()).ToLocalChecked();

if (value->IsBoolean()) {
return value->BooleanValue();
return value->BooleanValue(v8::Isolate::GetCurrent());
}

return false;
Expand Down
4 changes: 2 additions & 2 deletions src/FontManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Local<Array> collectResults(ResultSet *results) {

int i = 0;
for (ResultSet::iterator it = results->begin(); it != results->end(); it++) {
res->Set(i++, (*it)->toJSObject());
res->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), i++, (*it)->toJSObject());
}

delete results;
Expand Down Expand Up @@ -221,4 +221,4 @@ NAN_MODULE_INIT(Init) {
Nan::Export(target, "substituteFontSync", substituteFont<false>);
}

NODE_MODULE(node_fontmanager, Init)
NAN_MODULE_WORKER_ENABLED(node_fontmanager, Init)

0 comments on commit 76372b7

Please sign in to comment.