Bug 1384244 - Remove hasDynamicPrototype check from MaybeHasInterestingSymbolProperty because only proxies can have dynamic prototypes. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 28 Jul 2017 12:55:37 -0700
changeset 420610 74d5a19b281479b5c52a9bfb9ff283bad3b74451
parent 420609 81c056ef9e195ac1d93ac4f4f56b04fb3614a7d5
child 420611 3bceabbf445d41049258415796c2961a04b7ef9d
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1384244
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1384244 - Remove hasDynamicPrototype check from MaybeHasInterestingSymbolProperty because only proxies can have dynamic prototypes. r=jandem And proxies are already filtered by the preceding obj->maybeHasInterestingSymbolProperty() call.
js/src/builtin/Object.cpp
js/src/jsobjinlines.h
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -578,33 +578,33 @@ js::obj_toString(JSContext* cx, unsigned
 
     // Step 16.
     if (!tag.isString()) {
         // Non-standard (bug 1277801): Use ClassName as a fallback in the interim
         if (!builtinTag) {
             const char* className = GetObjectClassName(cx, obj);
             StringBuffer sb(cx);
             if (!sb.append("[object ") || !sb.append(className, strlen(className)) ||
-                !sb.append("]"))
+                !sb.append(']'))
             {
                 return false;
             }
 
             builtinTag = sb.finishAtom();
             if (!builtinTag)
                 return false;
         }
 
         args.rval().setString(builtinTag);
         return true;
     }
 
     // Step 17.
     StringBuffer sb(cx);
-    if (!sb.append("[object ") || !sb.append(tag.toString()) || !sb.append("]"))
+    if (!sb.append("[object ") || !sb.append(tag.toString()) || !sb.append(']'))
         return false;
 
     JSString* str = sb.finishAtom();
     if (!str)
         return false;
 
     args.rval().setString(str);
     return true;
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -268,17 +268,16 @@ MOZ_ALWAYS_INLINE bool
 js::MaybeHasInterestingSymbolProperty(JSContext* cx, JSObject* obj, Symbol* symbol,
                                       JSObject** holder)
 {
     MOZ_ASSERT(symbol->isInterestingSymbol());
 
     jsid id = SYMBOL_TO_JSID(symbol);
     do {
         if (obj->maybeHasInterestingSymbolProperty() ||
-            obj->hasDynamicPrototype() ||
             MOZ_UNLIKELY(ClassMayResolveId(cx->names(), obj->getClass(), id, obj) ||
                          obj->getClass()->getGetProperty()))
         {
             if (holder)
                 *holder = obj;
             return true;
         }
         obj = obj->staticPrototype();