From: rossberg@chromium.org Date: Tue, 20 May 2014 09:13:26 +0000 (+0000) Subject: Tighten HAS_PRIVATE to own properties X-Git-Tag: upstream/4.7.83~9073 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d9fa6af31ec8da9aa2cd504a15ef3dd5c674d73;p=platform%2Fupstream%2Fv8.git Tighten HAS_PRIVATE to own properties R=mstarzinger@chromium.org BUG= Review URL: https://codereview.chromium.org/290373002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/macros.py b/src/macros.py index 3eb906f..39881fe 100644 --- a/src/macros.py +++ b/src/macros.py @@ -166,10 +166,12 @@ macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null"); # 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 NEW_PRIVATE(name) = (%CreatePrivateSymbol(name)); macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym)); -macro HAS_PRIVATE(obj, sym) = (sym in obj); +macro HAS_PRIVATE(obj, sym) = (%HasLocalProperty(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]);