Merge pull request #6559 from electron/node-6-3

Update to Node.js 6.3.0
This commit is contained in:
Cheng Zhao 2016-07-21 03:28:37 -06:00 committed by GitHub
commit 9cdc74e431
11 changed files with 29 additions and 25 deletions

View file

@ -1 +1 @@
v6.1.0 v6.3.0

View file

@ -7,7 +7,6 @@
#include "atom/app/uv_task_runner.h" #include "atom/app/uv_task_runner.h"
#include "atom/browser/javascript_environment.h" #include "atom/browser/javascript_environment.h"
#include "atom/browser/node_debugger.h" #include "atom/browser/node_debugger.h"
#include "atom/common/node_includes.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/thread_task_runner_handle.h" #include "base/thread_task_runner_handle.h"
@ -15,6 +14,8 @@
#include "gin/public/isolate_holder.h" #include "gin/public/isolate_holder.h"
#include "gin/v8_initializer.h" #include "gin/v8_initializer.h"
#include "atom/common/node_includes.h"
namespace atom { namespace atom {
int NodeMain(int argc, char *argv[]) { int NodeMain(int argc, char *argv[]) {
@ -69,7 +70,7 @@ int NodeMain(int argc, char *argv[]) {
exit_code = node::EmitExit(env); exit_code = node::EmitExit(env);
node::RunAtExit(env); node::RunAtExit(env);
env->Dispose(); node::FreeEnvironment(env);
} }
v8::V8::Dispose(); v8::V8::Dispose();

View file

@ -12,7 +12,8 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/values.h" #include "base/values.h"
#include "native_mate/dictionary.h" #include "native_mate/dictionary.h"
#include "vendor/node/src/node_buffer.h"
#include "atom/common/node_includes.h"
namespace atom { namespace atom {
@ -110,32 +111,31 @@ base::Value* V8ValueConverter::FromV8Value(
v8::Local<v8::Value> V8ValueConverter::ToV8ValueImpl( v8::Local<v8::Value> V8ValueConverter::ToV8ValueImpl(
v8::Isolate* isolate, const base::Value* value) const { v8::Isolate* isolate, const base::Value* value) const {
CHECK(value);
switch (value->GetType()) { switch (value->GetType()) {
case base::Value::TYPE_NULL: case base::Value::TYPE_NULL:
return v8::Null(isolate); return v8::Null(isolate);
case base::Value::TYPE_BOOLEAN: { case base::Value::TYPE_BOOLEAN: {
bool val = false; bool val = false;
CHECK(value->GetAsBoolean(&val)); value->GetAsBoolean(&val);
return v8::Boolean::New(isolate, val); return v8::Boolean::New(isolate, val);
} }
case base::Value::TYPE_INTEGER: { case base::Value::TYPE_INTEGER: {
int val = 0; int val = 0;
CHECK(value->GetAsInteger(&val)); value->GetAsInteger(&val);
return v8::Integer::New(isolate, val); return v8::Integer::New(isolate, val);
} }
case base::Value::TYPE_DOUBLE: { case base::Value::TYPE_DOUBLE: {
double val = 0.0; double val = 0.0;
CHECK(value->GetAsDouble(&val)); value->GetAsDouble(&val);
return v8::Number::New(isolate, val); return v8::Number::New(isolate, val);
} }
case base::Value::TYPE_STRING: { case base::Value::TYPE_STRING: {
std::string val; std::string val;
CHECK(value->GetAsString(&val)); value->GetAsString(&val);
return v8::String::NewFromUtf8( return v8::String::NewFromUtf8(
isolate, val.c_str(), v8::String::kNormalString, val.length()); isolate, val.c_str(), v8::String::kNormalString, val.length());
} }
@ -163,10 +163,9 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Array(
for (size_t i = 0; i < val->GetSize(); ++i) { for (size_t i = 0; i < val->GetSize(); ++i) {
const base::Value* child = nullptr; const base::Value* child = nullptr;
CHECK(val->Get(i, &child)); val->Get(i, &child);
v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, child); v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, child);
CHECK(!child_v8.IsEmpty());
v8::TryCatch try_catch; v8::TryCatch try_catch;
result->Set(static_cast<uint32_t>(i), child_v8); result->Set(static_cast<uint32_t>(i), child_v8);
@ -186,7 +185,6 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Object(
!iter.IsAtEnd(); iter.Advance()) { !iter.IsAtEnd(); iter.Advance()) {
const std::string& key = iter.key(); const std::string& key = iter.key();
v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, &iter.value()); v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, &iter.value());
CHECK(!child_v8.IsEmpty());
v8::TryCatch try_catch; v8::TryCatch try_catch;
result.Set(key, child_v8); result.Set(key, child_v8);
@ -210,8 +208,6 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
FromV8ValueState* state, FromV8ValueState* state,
v8::Local<v8::Value> val, v8::Local<v8::Value> val,
v8::Isolate* isolate) const { v8::Isolate* isolate) const {
CHECK(!val.IsEmpty());
FromV8ValueState::Level state_level(state); FromV8ValueState::Level state_level(state);
if (state->HasReachedMaxRecursionDepth()) if (state->HasReachedMaxRecursionDepth())
return nullptr; return nullptr;

View file

@ -11,7 +11,6 @@
#include "atom/common/api/locker.h" #include "atom/common/api/locker.h"
#include "atom/common/atom_command_line.h" #include "atom/common/atom_command_line.h"
#include "atom/common/native_mate_converters/file_path_converter.h" #include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/node_includes.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/base_paths.h" #include "base/base_paths.h"
#include "base/environment.h" #include "base/environment.h"
@ -22,6 +21,8 @@
#include "content/public/common/content_paths.h" #include "content/public/common/content_paths.h"
#include "native_mate/dictionary.h" #include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
using content::BrowserThread; using content::BrowserThread;
// Force all builtin modules to be referenced so they can actually run their // Force all builtin modules to be referenced so they can actually run their
@ -216,7 +217,6 @@ void NodeBindings::UvRunOnce() {
DCHECK(!is_browser_ || BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!is_browser_ || BrowserThread::CurrentlyOn(BrowserThread::UI));
node::Environment* env = uv_env(); node::Environment* env = uv_env();
CHECK(env);
// Use Locker in browser process. // Use Locker in browser process.
mate::Locker locker(env->isolate()); mate::Locker locker(env->isolate());

View file

@ -19,6 +19,7 @@
#undef CHECK_GT #undef CHECK_GT
#undef CHECK_LE #undef CHECK_LE
#undef CHECK_LT #undef CHECK_LT
#undef UNLIKELY
#undef DISALLOW_COPY_AND_ASSIGN #undef DISALLOW_COPY_AND_ASSIGN
#undef NO_RETURN #undef NO_RETURN
#undef arraysize #undef arraysize

View file

@ -7,8 +7,6 @@
#include <windows.h> #include <windows.h>
#include "node_extern.h"
namespace node { namespace node {
// The _open_osfhandle and _close functions on Windows are provided by the // The _open_osfhandle and _close functions on Windows are provided by the
@ -20,8 +18,8 @@ namespace node {
// we always create fd in one instance of VC++ library. // we always create fd in one instance of VC++ library.
// Followings wrappers are compiled in node.dll, and all code in electron.exe // Followings wrappers are compiled in node.dll, and all code in electron.exe
// should call these wrappers instead of calling _open_osfhandle directly. // should call these wrappers instead of calling _open_osfhandle directly.
NODE_EXTERN int open_osfhandle(intptr_t osfhandle, int flags); __declspec(dllexport) int open_osfhandle(intptr_t osfhandle, int flags);
NODE_EXTERN int close(int fd); __declspec(dllexport) int close(int fd);
} // namespace node } // namespace node

View file

@ -14,11 +14,13 @@
'python': 'python', 'python': 'python',
'openssl_fips': '', 'openssl_fips': '',
'openssl_no_asm': 1, 'openssl_no_asm': 1,
'OPENSSL_PRODUCT': 'libopenssl.a',
'node_release_urlbase': 'https://atom.io/download/atom-shell', 'node_release_urlbase': 'https://atom.io/download/atom-shell',
'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)', 'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)',
'node_target_type': 'shared_library', 'node_target_type': 'shared_library',
'node_install_npm': 'false', 'node_install_npm': 'false',
'node_prefix': '', 'node_prefix': '',
'node_shared': 'true',
'node_shared_cares': 'false', 'node_shared_cares': 'false',
'node_shared_http_parser': 'false', 'node_shared_http_parser': 'false',
'node_shared_libuv': 'false', 'node_shared_libuv': 'false',
@ -31,17 +33,20 @@
'node_use_mdb': 'false', 'node_use_mdb': 'false',
'node_use_openssl': 'true', 'node_use_openssl': 'true',
'node_use_perfctr': 'false', 'node_use_perfctr': 'false',
'node_use_v8_platform': 'false',
'node_use_bundled_v8': 'false',
'uv_library': 'static_library', 'uv_library': 'static_library',
'uv_parent_path': 'vendor/node/deps/uv', 'uv_parent_path': 'vendor/node/deps/uv',
'uv_use_dtrace': 'false', 'uv_use_dtrace': 'false',
'V8_BASE': '', 'V8_BASE': '',
'v8_postmortem_support': 'false', 'v8_postmortem_support': 'false',
'v8_enable_i18n_support': 'false', 'v8_enable_i18n_support': 'false',
'v8_inspector': 'false',
}, },
# Settings to compile node under Windows. # Settings to compile node under Windows.
'target_defaults': { 'target_defaults': {
'target_conditions': [ 'target_conditions': [
['_target_name in ["libuv", "http_parser", "openssl", "cares", "node", "zlib"]', { ['_target_name in ["libuv", "http_parser", "openssl", "openssl-cli", "cares", "node", "zlib"]', {
'msvs_disabled_warnings': [ 'msvs_disabled_warnings': [
4003, # not enough actual parameters for macro 'V' 4003, # not enough actual parameters for macro 'V'
4013, # 'free' undefined; assuming extern returning int 4013, # 'free' undefined; assuming extern returning int

View file

@ -207,6 +207,9 @@
'vendor/node/node.gyp:node', 'vendor/node/node.gyp:node',
], ],
'defines': [ 'defines': [
# We need to access internal implementations of Node.
'NODE_WANT_INTERNALS=1',
'NODE_SHARED_MODE',
# This is defined in skia/skia_common.gypi. # This is defined in skia/skia_common.gypi.
'SK_SUPPORT_LEGACY_GETTOPDEVICE', 'SK_SUPPORT_LEGACY_GETTOPDEVICE',
# Disable warnings for g_settings_list_schemas. # Disable warnings for g_settings_list_schemas.

View file

@ -63,12 +63,12 @@ describe('webContents module', function () {
const specWebContents = remote.getCurrentWebContents() const specWebContents = remote.getCurrentWebContents()
assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId()) assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId())
specWebContents.on('devtools-opened', function () { specWebContents.once('devtools-opened', function () {
assert.equal(specWebContents.devToolsWebContents.getId(), webContents.getFocusedWebContents().getId()) assert.equal(specWebContents.devToolsWebContents.getId(), webContents.getFocusedWebContents().getId())
specWebContents.closeDevTools() specWebContents.closeDevTools()
}) })
specWebContents.on('devtools-closed', function () { specWebContents.once('devtools-closed', function () {
assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId()) assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId())
done() done()
}) })

2
vendor/native_mate vendored

@ -1 +1 @@
Subproject commit a1efa285204cb2fbbed450c317fb535a38ea8480 Subproject commit d9bfe6a49d8585916bd8dc77165154afeee4e5b6

2
vendor/node vendored

@ -1 +1 @@
Subproject commit d4528c219df8f442d769bae054883e1af79f105e Subproject commit 69c579f33a9b0835c5ec0bb56c0ba4d3f5397d35