From 1520afd33619eed24e8a5df92128f58efa41e584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 19 Nov 2016 14:35:49 +0100 Subject: [PATCH] deps: update V8 to 5.4.500.43 PR-URL: https://github.com/nodejs/node/pull/9697 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina Reviewed-By: Anna Henningsen --- deps/v8/include/v8-version.h | 2 +- deps/v8/src/debug/debug.cc | 5 +++++ deps/v8/src/lookup.cc | 8 ++++++++ deps/v8/src/property.h | 3 +++ .../test/debugger/debug/regress/regress-662674.js | 14 ++++++++++++++ deps/v8/test/mjsunit/harmony/private.js | 4 ++-- .../mjsunit/regress/regress-private-enumerable.js | 8 ++++++++ 7 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 deps/v8/test/debugger/debug/regress/regress-662674.js create mode 100644 deps/v8/test/mjsunit/regress/regress-private-enumerable.js diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 01b10d1d68edbb..beb8042d37b576 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 4 #define V8_BUILD_NUMBER 500 -#define V8_PATCH_LEVEL 41 +#define V8_PATCH_LEVEL 43 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/debug/debug.cc b/deps/v8/src/debug/debug.cc index e04695771bf1f1..cce167f942934f 100644 --- a/deps/v8/src/debug/debug.cc +++ b/deps/v8/src/debug/debug.cc @@ -1701,6 +1701,11 @@ MaybeHandle Debug::PromiseHasUserDefinedRejectHandler( void Debug::OnException(Handle exception, Handle promise) { + // We cannot generate debug events when JS execution is disallowed. + // TODO(5530): Reenable debug events within DisallowJSScopes once relevant + // code (MakeExceptionEvent and ProcessDebugEvent) have been moved to C++. + if (!AllowJavascriptExecution::IsAllowed(isolate_)) return; + Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); // Don't notify listener of exceptions that are internal to a desugaring. diff --git a/deps/v8/src/lookup.cc b/deps/v8/src/lookup.cc index 54015d44c6826e..727465ee80eade 100644 --- a/deps/v8/src/lookup.cc +++ b/deps/v8/src/lookup.cc @@ -308,6 +308,11 @@ void LookupIterator::PrepareTransitionToDataProperty( PropertyAttributes attributes, Object::StoreFromKeyed store_mode) { DCHECK(receiver.is_identical_to(GetStoreTarget())); if (state_ == TRANSITION) return; + + if (!IsElement() && name()->IsPrivate()) { + attributes = static_cast(attributes | DONT_ENUM); + } + DCHECK(state_ != LookupIterator::ACCESSOR || (GetAccessors()->IsAccessorInfo() && AccessorInfo::cast(*GetAccessors())->is_special_data_property())); @@ -447,6 +452,9 @@ void LookupIterator::TransitionToAccessorProperty( // handled via a trap. Adding properties to primitive values is not // observable. Handle receiver = GetStoreTarget(); + if (!IsElement() && name()->IsPrivate()) { + attributes = static_cast(attributes | DONT_ENUM); + } if (!IsElement() && !receiver->map()->is_dictionary_map()) { Handle old_map(receiver->map(), isolate_); diff --git a/deps/v8/src/property.h b/deps/v8/src/property.h index add9e4d11bfca0..ebe7d3b6732a4b 100644 --- a/deps/v8/src/property.h +++ b/deps/v8/src/property.h @@ -36,6 +36,7 @@ class Descriptor BASE_EMBEDDED { void Init(Handle key, Handle value, PropertyDetails details) { DCHECK(key->IsUniqueName()); + DCHECK_IMPLIES(key->IsPrivate(), !details.IsEnumerable()); key_ = key; value_ = value; details_ = details; @@ -44,6 +45,7 @@ class Descriptor BASE_EMBEDDED { Descriptor(Handle key, Handle value, PropertyDetails details) : key_(key), value_(value), details_(details) { DCHECK(key->IsUniqueName()); + DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable()); } Descriptor(Handle key, Handle value, @@ -53,6 +55,7 @@ class Descriptor BASE_EMBEDDED { value_(value), details_(attributes, type, representation, field_index) { DCHECK(key->IsUniqueName()); + DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable()); } friend class DescriptorArray; diff --git a/deps/v8/test/debugger/debug/regress/regress-662674.js b/deps/v8/test/debugger/debug/regress/regress-662674.js new file mode 100644 index 00000000000000..46054a5cd97880 --- /dev/null +++ b/deps/v8/test/debugger/debug/regress/regress-662674.js @@ -0,0 +1,14 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --stack-size=100 + +Debug = debug.Debug + +function overflow() { + return overflow(); +} + +Debug.setBreakOnException(); +assertThrows(overflow, RangeError); diff --git a/deps/v8/test/mjsunit/harmony/private.js b/deps/v8/test/mjsunit/harmony/private.js index d44ff33aca446e..7d34db40a8bf74 100644 --- a/deps/v8/test/mjsunit/harmony/private.js +++ b/deps/v8/test/mjsunit/harmony/private.js @@ -278,8 +278,8 @@ function TestKeyDescriptor(obj) { assertEquals(i|0, desc.value) assertTrue(desc.configurable) assertEquals(i % 2 == 0, desc.writable) - assertEquals(i % 2 == 0, desc.enumerable) - assertEquals(i % 2 == 0, + assertEquals(false, desc.enumerable) + assertEquals(false, Object.prototype.propertyIsEnumerable.call(obj, symbols[i])) } } diff --git a/deps/v8/test/mjsunit/regress/regress-private-enumerable.js b/deps/v8/test/mjsunit/regress/regress-private-enumerable.js new file mode 100644 index 00000000000000..ad41b51baec6f0 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-private-enumerable.js @@ -0,0 +1,8 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +class A {} +class B {} +Object.assign(B, A); +assertEquals("class B {}", B.toString());