diff --git a/src/node.cc b/src/node.cc index 50835ebc1db..0e3024b4b04 100644 --- a/src/node.cc +++ b/src/node.cc @@ -4790,7 +4790,7 @@ inline int Start_TTDReplay(Isolate* isolate, void* isolate_context, // Start debug agent when argv has --debug StartDebug(&env, nullptr, debug_options); - if (debug_options.inspector_enabled()) + if (debug_options.inspector_enabled() && !v8_platform.InspectorStarted(&env)) return 12; // Signal internal error. { diff --git a/src/node_api_jsrt.cc b/src/node_api_jsrt.cc index ef4275374bf..49423880088 100644 --- a/src/node_api_jsrt.cc +++ b/src/node_api_jsrt.cc @@ -552,34 +552,31 @@ napi_status napi_define_class(napi_env env, } } - std::vector descriptors; - descriptors.reserve(std::max(instancePropertyCount, staticPropertyCount)); + std::vector staticDescriptors; + std::vector instanceDescriptors; + staticDescriptors.reserve(staticPropertyCount); + instanceDescriptors.reserve(instancePropertyCount); - if (instancePropertyCount > 0) { - for (size_t i = 0; i < property_count; i++) { - if ((properties[i].attributes & napi_static) == 0) { - descriptors.push_back(properties[i]); - } + for (size_t i = 0; i < property_count; i++) { + if ((properties[i].attributes & napi_static) != 0) { + staticDescriptors.push_back(properties[i]); + } else { + instanceDescriptors.push_back(properties[i]); } - - CHECK_NAPI(napi_define_properties(env, - reinterpret_cast(prototype), - descriptors.size(), - descriptors.data())); } if (staticPropertyCount > 0) { - descriptors.clear(); - for (size_t i = 0; i < property_count; i++) { - if (!(properties[i].attributes & napi_static) != 0) { - descriptors.push_back(properties[i]); - } - } - CHECK_NAPI(napi_define_properties(env, reinterpret_cast(constructor), - descriptors.size(), - descriptors.data())); + staticDescriptors.size(), + staticDescriptors.data())); + } + + if (instancePropertyCount > 0) { + CHECK_NAPI(napi_define_properties(env, + reinterpret_cast(prototype), + instanceDescriptors.size(), + instanceDescriptors.data())); } *result = reinterpret_cast(constructor); diff --git a/test/inspector/inspector.status b/test/inspector/inspector.status index ed6a782b903..3901398d53a 100644 --- a/test/inspector/inspector.status +++ b/test/inspector/inspector.status @@ -7,3 +7,6 @@ prefix inspector [true] # This section applies to all platforms [$system==win32] + +[$jsEngine==chakracore] +test-bindings : PASS,FLAKY \ No newline at end of file diff --git a/test/message/vm_display_runtime_error.chakracore.out b/test/message/vm_display_runtime_error.chakracore.out index 4413b1d59ba..01231a1e218 100644 --- a/test/message/vm_display_runtime_error.chakracore.out +++ b/test/message/vm_display_runtime_error.chakracore.out @@ -1,5 +1,16 @@ beginning Error: boo! + at Global code (test.vm:*) + at Script.prototype.runInThisContext (vm.js:*:*) + at runInThisContext (vm.js:*) + at Anonymous function (*test*message*vm_display_runtime_error.js:*) + at Module.prototype._compile (module.js:*) + at Module._extensions[.js] (module.js:*) + at Module.prototype.load (module.js:*) + at tryModuleLoad (module.js:*) + at Module._load (module.js:*) + at Module.runMain (module.js:*) +Error: spooky! at Global code (test.vm:*) at Script.prototype.runInThisContext (vm.js:*:*) at runInThisContext (vm.js:*) diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status index a07128d91f3..8a23a0fd93a 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -19,6 +19,7 @@ prefix sequential [$system==aix] [$jsEngine==chakracore] +test-vm-timeout-rethrow : PASS,FLAKY [$jsEngine==chakracore && $system==linux] test-child-process-pass-fd : PASS,FLAKY