Skip to content

Commit

Permalink
syncing with edge master
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Jun 20, 2017
1 parent 7c8e733 commit 69cf921
Show file tree
Hide file tree
Showing 63 changed files with 67 additions and 74 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ os:
dist: trusty

node_js:
- "0.12.0"
- "4.1.1"
- "5.1.0"
- "6.4.0"
- "7.8.0"
- "7.10.0"

install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF ; fi
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:
- nodejs_version: "4.1.1"
- nodejs_version: "5.1.0"
- nodejs_version: "6.4.0"
- nodejs_version: "7.8.0"
- nodejs_version: "7.10.0"

install:
- ps: Install-Product node $env:nodejs_version
Expand Down
17 changes: 8 additions & 9 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
##
# Portions Copyright (c) Microsoft Corporation. All rights reserved.
#
# Portions Copyright (c) Microsoft Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
# ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR
# PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
# OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
# ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR
# PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
#
# See the Apache Version 2.0 License for specific language governing
# See the Apache Version 2.0 License for specific language governing
# permissions and limitations under the License.
##
{
Expand Down Expand Up @@ -270,7 +270,6 @@
}
}
}

},
{
'target_name': 'build_managed',
Expand Down Expand Up @@ -335,7 +334,7 @@
],
'outputs': [
'lib/bootstrap/bin/$(BUILDTYPE)/netstandard1.6/bootstrap.dll'
],
],
'action': [
'bash',
'-c',
Expand Down
5 changes: 1 addition & 4 deletions lib/edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ var fs = require('fs')
, edge;

var versionMap = [
[ /^0\.8\./, '0.8.22' ],
[ /^0\.10\./, '0.10.0' ],
[ /^0\.12\./, '0.12.0' ],
[ /^4\./, '4.1.1' ],
[ /^5\./, '5.1.0' ],
[ /^6\./, '6.4.0' ],
[ /^7\./, '7.8.0' ]
[ /^7\./, '7.10.0' ],
];

function determineVersion() {
Expand Down
2 changes: 0 additions & 2 deletions lib/native/win32/ia32/0.10.0/.gitignore

This file was deleted.

Binary file removed lib/native/win32/ia32/0.10.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/ia32/0.10.0/edge_nativeclr.node
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/native/win32/ia32/0.12.0/.gitignore

This file was deleted.

Binary file removed lib/native/win32/ia32/0.12.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/ia32/0.12.0/edge_nativeclr.node
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/native/win32/ia32/0.8.22/.gitignore

This file was deleted.

Binary file removed lib/native/win32/ia32/0.8.22/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/ia32/0.8.22/edge_nativeclr.node
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/native/win32/ia32/4.1.1/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ms*.dll
node.exe
node.exe
*140*.dll
Binary file modified lib/native/win32/ia32/4.1.1/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/4.1.1/edge_nativeclr.node
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/native/win32/ia32/5.1.0/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ms*.dll
node.exe
node.exe
*140*.dll
Binary file modified lib/native/win32/ia32/5.1.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/5.1.0/edge_nativeclr.node
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/native/win32/ia32/6.4.0/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ms*.dll
node.exe
node.exe
*140*.dll
Binary file modified lib/native/win32/ia32/6.4.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/6.4.0/edge_nativeclr.node
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/native/win32/ia32/7.8.0/.gitignore

This file was deleted.

Binary file removed lib/native/win32/ia32/7.8.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/ia32/7.8.0/edge_nativeclr.node
Binary file not shown.
Binary file removed lib/native/win32/ia32/msvcp120.dll
Binary file not shown.
Binary file removed lib/native/win32/ia32/msvcr120.dll
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/native/win32/x64/0.10.0/.gitignore

This file was deleted.

Binary file removed lib/native/win32/x64/0.10.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/0.10.0/edge_nativeclr.node
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/native/win32/x64/0.12.0/.gitignore

This file was deleted.

Binary file removed lib/native/win32/x64/0.12.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/0.12.0/edge_nativeclr.node
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/native/win32/x64/0.8.22/.gitignore

This file was deleted.

Binary file removed lib/native/win32/x64/0.8.22/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/0.8.22/edge_nativeclr.node
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/native/win32/x64/4.1.1/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ms*.dll
node.exe
node.exe
*140*.dll
Binary file modified lib/native/win32/x64/4.1.1/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/4.1.1/edge_nativeclr.node
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/native/win32/x64/5.1.0/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ms*.dll
node.exe
node.exe
*140*.dll
Binary file modified lib/native/win32/x64/5.1.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/5.1.0/edge_nativeclr.node
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/native/win32/x64/6.4.0/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ms*.dll
node.exe
node.exe
*140*.dll
Binary file modified lib/native/win32/x64/6.4.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/6.4.0/edge_nativeclr.node
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/native/win32/x64/7.8.0/.gitignore

This file was deleted.

Binary file removed lib/native/win32/x64/7.8.0/edge_coreclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/7.8.0/edge_nativeclr.node
Binary file not shown.
Binary file removed lib/native/win32/x64/msvcp120.dll
Binary file not shown.
Binary file removed lib/native/win32/x64/msvcr120.dll
Binary file not shown.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "http://tomasz.janczuk.org",
"twitter": "tjanczuk"
},
"version": "6.6.4",
"version": "6.6.5",
"description": "Edge.js: run .NET and Node.js in-process on Windows, Mac OS, and Linux",
"tags": [
"owin",
Expand Down Expand Up @@ -36,13 +36,13 @@
"mocha": "3.2.0",
"mocha-junit-reporter": "^1.13.0"
},
"homepage": "https://github.com/agracio/edge",
"homepage": "https://github.com/agracio/edge-js",
"repository": {
"type": "git",
"url": "[email protected]:agracio/edge.git"
"url": "[email protected]:agracio/edge-js.git"
},
"bugs": {
"url": "http://github.com/agracio/edge/issues"
"url": "http://github.com/agracio/edge-js/issues"
},
"scripts": {
"install": "node tools/install.js",
Expand Down
2 changes: 1 addition & 1 deletion src/CoreCLREmbedding/coreclrfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ v8::Local<v8::Function> CoreClrFunc::InitializeInstance(CoreClrGcHandle function

v8::Local<v8::Value> factoryArgv[] = { Nan::New(proxyFunction), Nan::New<v8::External>((void*)wrap) };
v8::Local<v8::Function> funcProxy =
(Nan::New(proxyFactory)->Call(Nan::GetCurrentContext()->Global(), 2, factoryArgv)).As<v8::Function>();
(Nan::Call(Nan::New(proxyFactory), Nan::GetCurrentContext()->Global(), 2, factoryArgv)).ToLocalChecked().As<v8::Function>();
Nan::Persistent<v8::Function> funcProxyPersistent(funcProxy);
funcProxyPersistent.SetWeak((void*)wrap, &coreClrFuncProxyNearDeath, Nan::WeakCallbackType::kParameter);

Expand Down
20 changes: 9 additions & 11 deletions src/CoreCLREmbedding/coreclrfuncinvokecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ CoreClrFuncInvokeContext::CoreClrFuncInvokeContext(v8::Local<v8::Value> callback
{
DBG("CoreClrFuncInvokeContext::CoreClrFuncInvokeContext");

this->callback = new Nan::Persistent<Function>();
v8::Local<v8::Function> callbackFunction = v8::Local<v8::Function>::Cast(callback);
this->callback->Reset(callbackFunction);
this->callback = new Nan::Callback(v8::Local<v8::Function>::Cast(callback));
}

CoreClrFuncInvokeContext::~CoreClrFuncInvokeContext()
Expand Down Expand Up @@ -87,15 +85,15 @@ void CoreClrFuncInvokeContext::InvokeCallback(void* data)
int argc = 2;

Nan::TryCatch tryCatch;
Nan::New<v8::Function>(*(context->callback))->Call(Nan::GetCurrentContext()->Global(), argc, argv);

DBG("CoreClrFuncInvokeContext::InvokeCallback - Callback function invoked");
delete context;

if (tryCatch.HasCaught())
{
Nan::FatalException(tryCatch);
}
DBG("CoreClrFuncInvokeContext::InvokeCallback - calling JS callback");
context->callback->Call(argc, argv);
delete context;
if (tryCatch.HasCaught())
{
DBG("CoreClrFuncInvokeContext::InvokeCallback - exception in callback");
Nan::FatalException(tryCatch);
}

DBG("CoreClrFuncInvokeContext::InvokeCallback - Complete");
}
7 changes: 6 additions & 1 deletion src/CoreCLREmbedding/coreclrnodejsfuncinvokecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void CoreClrNodejsFuncInvokeContext::InvokeCallback(void* data)
TryCatch tryCatch;

DBG("CoreClrNodejsFuncInvokeContext::InvokeCallback - Calling JavaScript function");
Nan::New(*(context->FunctionContext->Func))->Call(Nan::GetCurrentContext()->Global(), 2, argv);
Nan::Call(Nan::New(*(context->FunctionContext->Func)), Nan::GetCurrentContext()->Global(), 2, argv);
DBG("CoreClrNodejsFuncInvokeContext::InvokeCallback - Called JavaScript function");

if (tryCatch.HasCaught())
Expand All @@ -110,4 +110,9 @@ void CoreClrNodejsFuncInvokeContext::InvokeCallback(void* data)

context->Complete(TaskStatusFaulted, exceptionData, V8TypeException);
}
else
{
// Kick the next tick
CallbackHelper::KickNextTick();
}
}
2 changes: 1 addition & 1 deletion src/CoreCLREmbedding/edge.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef enum v8Type
class CoreClrFuncInvokeContext
{
private:
Nan::Persistent<Function>* callback;
Nan::Callback* callback;
CoreClrGcHandle task;
uv_edge_async_t* uv_edge_async;
void* resultData;
Expand Down
4 changes: 3 additions & 1 deletion src/dotnet/nodejsfuncinvokecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ NodejsFuncInvokeContext::!NodejsFuncInvokeContext()
}
}


void NodejsFuncInvokeContext::CallFuncOnV8Thread()
{
DBG("NodejsFuncInvokeContext::CallFuncOnV8Thread");
Expand Down Expand Up @@ -95,7 +94,10 @@ void NodejsFuncInvokeContext::CallFuncOnV8Thread()

v8::Local<v8::Value> argv[] = { jspayload, callback };
Nan::TryCatch tryCatch;

DBG("NodejsFuncInvokeContext::CallFuncOnV8Thread calling JavaScript function");
Nan::Call(Nan::New(*(this->functionContext->Func)), Nan::GetCurrentContext()->Global(), 2, argv);
DBG("NodejsFuncInvokeContext::CallFuncOnV8Thread called JavaScript function");
if (tryCatch.HasCaught())
{
DBG("NodejsFuncInvokeContext::CallFuncOnV8Thread caught JavaScript exception");
Expand Down
6 changes: 1 addition & 5 deletions src/mono/clrfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ v8::Local<v8::Function> ClrFunc::Initialize(MonoObject* func)

v8::Local<v8::Value> factoryArgv[] = { Nan::New(proxyFunction), Nan::New<v8::External>((void*)wrap) };
v8::Local<v8::Function> funcProxy =
(Nan::New(proxyFactory)->Call(Nan::GetCurrentContext()->Global(), 2, factoryArgv)).As<v8::Function>();
(Nan::Call(Nan::New(proxyFactory), Nan::GetCurrentContext()->Global(), 2, factoryArgv)).ToLocalChecked().As<v8::Function>();
Nan::Persistent<v8::Function> funcProxyPersistent(funcProxy);
funcProxyPersistent.SetWeak((void*)wrap, &clrFuncProxyNearDeath, Nan::WeakCallbackType::kParameter);

Expand Down Expand Up @@ -438,10 +438,6 @@ v8::Local<v8::Object> ClrFunc::MarshalCLRObjectToV8(MonoObject* netdata, MonoExc
}
}

// if (*exc)
// {
// return scope.Escape(v8::Local<v8::Object>::Cast(ClrFunc::MarshalCLRExceptionToV8(*exc)));
// }

return scope.Escape(result);
}
Expand Down
2 changes: 1 addition & 1 deletion src/mono/edge.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Dictionary
class ClrFuncInvokeContext {
private:
GCHandle _this;
Nan::Persistent<v8::Function>* callback;
Nan::Callback* callback;
uv_edge_async_t* uv_edge_async;

public:
Expand Down
4 changes: 4 additions & 0 deletions test/test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ set NODEEXE=node.exe
set EDGE_USE_CORECLR=
if "%1" neq "" if "%2" neq "" set NODEEXE=%~dp0\..\lib\native\win32\%1\%2\node.exe
echo Using node.js: %NODEEXE%
rmdir /s /q "%~dp0/bin"
rmdir /s /q "%~dp0/obj"
call "%~dp0\build.bat"
if %ERRORLEVEL% NEQ 0 exit /b -1;
pushd "%~dp0\.."
"%NODEEXE%" "%APPDATA%\npm\node_modules\mocha\bin\mocha" -R spec
set EDGE_USE_CORECLR=1
REM set EDGE_DEBUG=1
popd
rmdir /s /q "%~dp0/bin"
rmdir /s /q "%~dp0/obj"
call "%~dp0\build.bat"
if %ERRORLEVEL% NEQ 0 exit /b -1;
pushd "%~dp0\.."
Expand Down
8 changes: 2 additions & 6 deletions test/testall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ if "%1"=="" set run64=Y
if "%1"=="x64" set run64=Y

if "%run32%"=="Y" (
call "%SELF%\test.bat" ia32 7.10.0
call "%SELF%\test.bat" ia32 6.4.0
call "%SELF%\test.bat" ia32 4.1.1
call "%SELF%\test.bat" ia32 5.1.0
call "%SELF%\test.bat" ia32 0.12.0
call "%SELF%\test.bat" ia32 0.8.22
call "%SELF%\test.bat" ia32 0.10.0
)

if "%run64%"=="Y" (
call "%SELF%\test.bat" x64 7.10.0
call "%SELF%\test.bat" x64 6.4.0
call "%SELF%\test.bat" x64 4.1.1
call "%SELF%\test.bat" x64 5.1.0
call "%SELF%\test.bat" x64 0.12.0
call "%SELF%\test.bat" x64 0.8.22
call "%SELF%\test.bat" x64 0.10.0
)
4 changes: 2 additions & 2 deletions tools/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ if %ERRORLEVEL% neq 0 (
exit /b -1
)

copy /y "%DESTDIR%\..\msvcr120.dll" "%DESTDIR%"
copy /y "%DESTDIR%\..\*.dll" "%DESTDIR%"
if %ERRORLEVEL% neq 0 (
echo Error copying msvcr120.dll %FLAVOR% to %DESTDIR%
echo Error copying VC redist %FLAVOR% to %DESTDIR%
exit /b -1
)

Expand Down
2 changes: 1 addition & 1 deletion tools/buildall.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
"%~dp0\build.bat" release 0.8.22 0.10.0 0.12.0 4.1.1 5.1.0 6.4.0 7.8.0
"%~dp0\build.bat" release 4.1.1 5.1.0 6.4.0 7.10.0
11 changes: 9 additions & 2 deletions tools/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ if (process.platform === 'win32') {
.filter(isDirectory)
.map(getPath);

['msvcr120.dll', 'msvcp120.dll'].forEach(function (dllname) {
var redist = [
'concrt140.dll',
'msvcp140.dll',
'vccorlib140.dll',
'vcruntime140.dll',
];

redist.forEach(function (dllname) {
var dll32bit = path.resolve(lib32bit, dllname);
dest32dirs.forEach(copyFile(dll32bit, dllname));
});
Expand All @@ -48,7 +55,7 @@ if (process.platform === 'win32') {
.filter(isDirectory)
.map(getPath);

['msvcr120.dll', 'msvcp120.dll'].forEach(function (dllname) {
redist.forEach(function (dllname) {
var dll64bit = path.resolve(lib64bit, dllname);
dest64dirs.forEach(copyFile(dll64bit, dllname));
});
Expand Down

0 comments on commit 69cf921

Please sign in to comment.