diff options
-rw-r--r-- | common.gypi | 4 | ||||
-rw-r--r-- | src/node.cc | 5 | ||||
-rw-r--r-- | src/node.h | 2 | ||||
-rw-r--r-- | src/node_buffer.cc | 6 | ||||
-rw-r--r-- | src/node_contextify.cc | 42 | ||||
-rw-r--r-- | src/node_crypto.cc | 14 | ||||
-rw-r--r-- | src/util.cc | 2 | ||||
-rw-r--r-- | test/simple/test-abort-fatal-error.js | 2 | ||||
-rw-r--r-- | test/simple/test-vm-harmony-symbols.js | 2 |
9 files changed, 44 insertions, 35 deletions
diff --git a/common.gypi b/common.gypi index 6aa485bada..8886b74392 100644 --- a/common.gypi +++ b/common.gypi @@ -26,10 +26,10 @@ }], ['GENERATOR == "ninja" or OS== "mac"', { 'OBJ_DIR': '<(PRODUCT_DIR)/obj', - 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.<(target_arch).a', + 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a', }, { 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target', - 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.<(target_arch).a', + 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a', }], ], }, diff --git a/src/node.cc b/src/node.cc index 1736f9fbb5..db22ea9a2d 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2603,7 +2603,7 @@ void StopProfilerIdleNotifier(const FunctionCallbackInfo<Value>& args) { #define READONLY_PROPERTY(obj, str, var) \ do { \ - obj->Set(OneByteString(env->isolate(), str), var, v8::ReadOnly); \ + obj->ForceSet(OneByteString(env->isolate(), str), var, v8::ReadOnly); \ } while (0) @@ -3483,7 +3483,8 @@ void Init(int* argc, // Fetch a reference to the main isolate, so we have a reference to it // even when we need it to access it from another (debugger) thread. - node_isolate = Isolate::GetCurrent(); + node_isolate = Isolate::New(); + Isolate::Scope isolate_scope(node_isolate); #ifdef __POSIX__ // Raise the open file descriptor limit. diff --git a/src/node.h b/src/node.h index ca7cec0c45..384b790c97 100644 --- a/src/node.h +++ b/src/node.h @@ -219,7 +219,7 @@ NODE_EXTERN void RunAtExit(Environment* env); v8::Number::New(isolate, static_cast<double>(constant)); \ v8::PropertyAttribute constant_attributes = \ static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete); \ - (target)->Set(constant_name, constant_value, constant_attributes); \ + (target)->ForceSet(constant_name, constant_value, constant_attributes); \ } \ while (0) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 822c4f868d..cd66a8ac74 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -624,9 +624,9 @@ void SetupBufferJS(const FunctionCallbackInfo<Value>& args) { NODE_SET_METHOD(proto, "copy", Copy); // for backwards compatibility - proto->Set(env->offset_string(), - Uint32::New(env->isolate(), 0), - v8::ReadOnly); + proto->ForceSet(env->offset_string(), + Uint32::New(env->isolate(), 0), + v8::ReadOnly); assert(args[1]->IsObject()); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index bb43536d87..3f190a407b 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -537,18 +537,24 @@ class ContextifyScript : public BaseObject { Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope scope(env->isolate()); + int64_t timeout; + bool display_errors; + // Assemble arguments - TryCatch try_catch; if (!args[0]->IsObject()) { return env->ThrowTypeError( "contextifiedSandbox argument must be an object."); } + Local<Object> sandbox = args[0].As<Object>(); - int64_t timeout = GetTimeoutArg(args, 1); - bool display_errors = GetDisplayErrorsArg(args, 1); - if (try_catch.HasCaught()) { - try_catch.ReThrow(); - return; + { + TryCatch try_catch; + timeout = GetTimeoutArg(args, 1); + display_errors = GetDisplayErrorsArg(args, 1); + if (try_catch.HasCaught()) { + try_catch.ReThrow(); + return; + } } // Get the context from the sandbox @@ -563,14 +569,22 @@ class ContextifyScript : public BaseObject { if (contextify_context->context().IsEmpty()) return; - // Do the eval within the context - Context::Scope context_scope(contextify_context->context()); - if (EvalMachine(contextify_context->env(), - timeout, - display_errors, - args, - try_catch)) { - contextify_context->CopyProperties(); + { + TryCatch try_catch; + // Do the eval within the context + Context::Scope context_scope(contextify_context->context()); + if (EvalMachine(contextify_context->env(), + timeout, + display_errors, + args, + try_catch)) { + contextify_context->CopyProperties(); + } + + if (try_catch.HasCaught()) { + try_catch.ReThrow(); + return; + } } } diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 44ed4e09a0..7a35314a94 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1022,9 +1022,12 @@ void SSLWrap<Base>::AddMethods(Environment* env, Handle<FunctionTemplate> t) { #ifdef OPENSSL_NPN_NEGOTIATED NODE_SET_PROTOTYPE_METHOD(t, "getNegotiatedProtocol", GetNegotiatedProto); - NODE_SET_PROTOTYPE_METHOD(t, "setNPNProtocols", SetNPNProtocols); #endif // OPENSSL_NPN_NEGOTIATED +#ifdef OPENSSL_NPN_NEGOTIATED + NODE_SET_PROTOTYPE_METHOD(t, "setNPNProtocols", SetNPNProtocols); +#endif + NODE_SET_EXTERNAL( t->PrototypeTemplate(), "_external", @@ -2057,15 +2060,6 @@ void Connection::Initialize(Environment* env, Handle<Object> target) { SSLWrap<Connection>::AddMethods(env, t); -#ifdef OPENSSL_NPN_NEGOTIATED - NODE_SET_PROTOTYPE_METHOD(t, - "getNegotiatedProtocol", - Connection::GetNegotiatedProto); - NODE_SET_PROTOTYPE_METHOD(t, - "setNPNProtocols", - Connection::SetNPNProtocols); -#endif - #ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB NODE_SET_PROTOTYPE_METHOD(t, "getServername", Connection::GetServername); diff --git a/src/util.cc b/src/util.cc index 7459dbb7b8..67c9664530 100644 --- a/src/util.cc +++ b/src/util.cc @@ -31,6 +31,8 @@ Utf8Value::Utf8Value(v8::Handle<v8::Value> value) return; v8::Local<v8::String> val_ = value->ToString(); + if (val_.IsEmpty()) + return; // Allocate enough space to include the null terminator size_t len = StringBytes::StorageSize(val_, UTF8) + 1; diff --git a/test/simple/test-abort-fatal-error.js b/test/simple/test-abort-fatal-error.js index 64d31d9e88..79e3d72e86 100644 --- a/test/simple/test-abort-fatal-error.js +++ b/test/simple/test-abort-fatal-error.js @@ -30,7 +30,7 @@ if (process.platform === 'win32') { var exec = require('child_process').exec; var cmdline = 'ulimit -c 0; ' + process.execPath; -cmdline += ' --max-old-space-size=4 --max-new-space-size=1'; +cmdline += ' --max-old-space-size=4 --max-semi-space-size=1'; cmdline += ' -e "a = []; for (i = 0; i < 1e9; i++) { a.push({}) }"'; exec(cmdline, function(err, stdout, stderr) { diff --git a/test/simple/test-vm-harmony-symbols.js b/test/simple/test-vm-harmony-symbols.js index 4aa4161266..200084fdf4 100644 --- a/test/simple/test-vm-harmony-symbols.js +++ b/test/simple/test-vm-harmony-symbols.js @@ -19,8 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// Flags: --harmony_symbols - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); |