function ArrayIteratorNext() {
var iterator = ToObject(this);
- if (!HAS_PRIVATE(iterator, arrayIteratorObjectSymbol)) {
+ if (!HAS_DEFINED_PRIVATE(iterator, arrayIteratorNextIndexSymbol)) {
throw MakeTypeError('incompatible_method_receiver',
['Array Iterator.prototype.next']);
}
# Private names.
# GET_PRIVATE should only be used if the property is known to exists on obj
# itself (it should really use %GetOwnProperty, but that would be way slower).
-macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateSymbol(name));
+macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name));
macro NEW_PRIVATE(name) = (%CreatePrivateSymbol(name));
macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym));
+macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym]));
macro GET_PRIVATE(obj, sym) = (obj[sym]);
macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]);
// For bootstrapper.
IsPromise = function IsPromise(x) {
- return IS_SPEC_OBJECT(x) && HAS_PRIVATE(x, promiseStatus);
+ return IS_SPEC_OBJECT(x) && HAS_DEFINED_PRIVATE(x, promiseStatus);
}
PromiseCreate = function PromiseCreate() {
// Check promiseDebug property to avoid duplicate event.
if (DEBUG_IS_ACTIVE &&
GET_PRIVATE(promise, promiseStatus) == 0 &&
- !HAS_PRIVATE(promise, promiseDebug)) {
+ !HAS_DEFINED_PRIVATE(promise, promiseDebug)) {
%DebugPromiseRejectEvent(promise, r);
}
PromiseDone(promise, -1, r, promiseOnReject)
}
-RUNTIME_FUNCTION(Runtime_CreateGlobalPrivateSymbol) {
+RUNTIME_FUNCTION(Runtime_CreateGlobalPrivateOwnSymbol) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
DCHECK(symbol->IsUndefined());
symbol = isolate->factory()->NewPrivateSymbol();
Handle<Symbol>::cast(symbol)->set_name(*name);
+ Handle<Symbol>::cast(symbol)->set_is_own(true);
JSObject::SetProperty(Handle<JSObject>::cast(privates), name, symbol,
STRICT).Assert();
}
/* Harmony symbols */ \
F(CreateSymbol, 1, 1) \
F(CreatePrivateSymbol, 1, 1) \
- F(CreateGlobalPrivateSymbol, 1, 1) \
+ F(CreateGlobalPrivateOwnSymbol, 1, 1) \
F(CreatePrivateOwnSymbol, 1, 1) \
F(NewSymbolWrapper, 1, 1) \
F(SymbolDescription, 1, 1) \
function StringIteratorNext() {
var iterator = ToObject(this);
- if (!HAS_PRIVATE(iterator, stringIteratorIteratedStringSymbol)) {
+ if (!HAS_DEFINED_PRIVATE(iterator, stringIteratorNextIndexSymbol)) {
throw MakeTypeError('incompatible_method_receiver',
['String Iterator.prototype.next']);
}
var length = TO_UINT32(s.length);
if (position >= length) {
- SET_PRIVATE(iterator, stringIteratorIteratedStringSymbol, UNDEFINED);
+ SET_PRIVATE(iterator, stringIteratorIteratedStringSymbol,
+ UNDEFINED);
return CreateIteratorResultObject(UNDEFINED, true);
}
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony --harmony-proxies
var _name = "foo";
-%CreateGlobalPrivateSymbol(_name);
+%CreateGlobalPrivateOwnSymbol(_name);