diff --git a/.node-version b/.node-version index ed15bef9ae26..dffc266d6a8b 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v6.1.0 +v6.3.0 diff --git a/atom/app/node_main.cc b/atom/app/node_main.cc index 6f71d39f5740..e711f48e32f5 100644 --- a/atom/app/node_main.cc +++ b/atom/app/node_main.cc @@ -7,7 +7,6 @@ #include "atom/app/uv_task_runner.h" #include "atom/browser/javascript_environment.h" #include "atom/browser/node_debugger.h" -#include "atom/common/node_includes.h" #include "base/command_line.h" #include "base/feature_list.h" #include "base/thread_task_runner_handle.h" @@ -15,6 +14,8 @@ #include "gin/public/isolate_holder.h" #include "gin/v8_initializer.h" +#include "atom/common/node_includes.h" + namespace atom { int NodeMain(int argc, char *argv[]) { @@ -69,7 +70,7 @@ int NodeMain(int argc, char *argv[]) { exit_code = node::EmitExit(env); node::RunAtExit(env); - env->Dispose(); + node::FreeEnvironment(env); } v8::V8::Dispose(); diff --git a/atom/common/native_mate_converters/v8_value_converter.cc b/atom/common/native_mate_converters/v8_value_converter.cc index 37e09aec5750..ddff43924400 100644 --- a/atom/common/native_mate_converters/v8_value_converter.cc +++ b/atom/common/native_mate_converters/v8_value_converter.cc @@ -12,7 +12,8 @@ #include "base/memory/scoped_ptr.h" #include "base/values.h" #include "native_mate/dictionary.h" -#include "vendor/node/src/node_buffer.h" + +#include "atom/common/node_includes.h" namespace atom { @@ -110,32 +111,31 @@ base::Value* V8ValueConverter::FromV8Value( v8::Local V8ValueConverter::ToV8ValueImpl( v8::Isolate* isolate, const base::Value* value) const { - CHECK(value); switch (value->GetType()) { case base::Value::TYPE_NULL: return v8::Null(isolate); case base::Value::TYPE_BOOLEAN: { bool val = false; - CHECK(value->GetAsBoolean(&val)); + value->GetAsBoolean(&val); return v8::Boolean::New(isolate, val); } case base::Value::TYPE_INTEGER: { int val = 0; - CHECK(value->GetAsInteger(&val)); + value->GetAsInteger(&val); return v8::Integer::New(isolate, val); } case base::Value::TYPE_DOUBLE: { double val = 0.0; - CHECK(value->GetAsDouble(&val)); + value->GetAsDouble(&val); return v8::Number::New(isolate, val); } case base::Value::TYPE_STRING: { std::string val; - CHECK(value->GetAsString(&val)); + value->GetAsString(&val); return v8::String::NewFromUtf8( isolate, val.c_str(), v8::String::kNormalString, val.length()); } @@ -163,10 +163,9 @@ v8::Local V8ValueConverter::ToV8Array( for (size_t i = 0; i < val->GetSize(); ++i) { const base::Value* child = nullptr; - CHECK(val->Get(i, &child)); + val->Get(i, &child); v8::Local child_v8 = ToV8ValueImpl(isolate, child); - CHECK(!child_v8.IsEmpty()); v8::TryCatch try_catch; result->Set(static_cast(i), child_v8); @@ -186,7 +185,6 @@ v8::Local V8ValueConverter::ToV8Object( !iter.IsAtEnd(); iter.Advance()) { const std::string& key = iter.key(); v8::Local child_v8 = ToV8ValueImpl(isolate, &iter.value()); - CHECK(!child_v8.IsEmpty()); v8::TryCatch try_catch; result.Set(key, child_v8); @@ -210,8 +208,6 @@ base::Value* V8ValueConverter::FromV8ValueImpl( FromV8ValueState* state, v8::Local val, v8::Isolate* isolate) const { - CHECK(!val.IsEmpty()); - FromV8ValueState::Level state_level(state); if (state->HasReachedMaxRecursionDepth()) return nullptr; diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 40fa6bdb6e28..2a999ea79bc9 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -11,7 +11,6 @@ #include "atom/common/api/locker.h" #include "atom/common/atom_command_line.h" #include "atom/common/native_mate_converters/file_path_converter.h" -#include "atom/common/node_includes.h" #include "base/command_line.h" #include "base/base_paths.h" #include "base/environment.h" @@ -22,6 +21,8 @@ #include "content/public/common/content_paths.h" #include "native_mate/dictionary.h" +#include "atom/common/node_includes.h" + using content::BrowserThread; // 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)); node::Environment* env = uv_env(); - CHECK(env); // Use Locker in browser process. mate::Locker locker(env->isolate()); diff --git a/atom/common/node_includes.h b/atom/common/node_includes.h index 46b6fa058ebb..01efa6b15470 100644 --- a/atom/common/node_includes.h +++ b/atom/common/node_includes.h @@ -19,6 +19,7 @@ #undef CHECK_GT #undef CHECK_LE #undef CHECK_LT +#undef UNLIKELY #undef DISALLOW_COPY_AND_ASSIGN #undef NO_RETURN #undef arraysize diff --git a/atom/node/osfhandle.h b/atom/node/osfhandle.h index 6ebb2ab11e9d..3933236e5091 100644 --- a/atom/node/osfhandle.h +++ b/atom/node/osfhandle.h @@ -7,8 +7,6 @@ #include -#include "node_extern.h" - namespace node { // 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. // Followings wrappers are compiled in node.dll, and all code in electron.exe // should call these wrappers instead of calling _open_osfhandle directly. -NODE_EXTERN int open_osfhandle(intptr_t osfhandle, int flags); -NODE_EXTERN int close(int fd); +__declspec(dllexport) int open_osfhandle(intptr_t osfhandle, int flags); +__declspec(dllexport) int close(int fd); } // namespace node diff --git a/common.gypi b/common.gypi index 3389e18690a2..b2ee5e50811f 100644 --- a/common.gypi +++ b/common.gypi @@ -14,11 +14,13 @@ 'python': 'python', 'openssl_fips': '', 'openssl_no_asm': 1, + 'OPENSSL_PRODUCT': 'libopenssl.a', 'node_release_urlbase': 'https://atom.io/download/atom-shell', 'node_byteorder': '