Bug 978229 - Part 2: Remove IsSealed() from Proxy.[[Delete]]. (r=jorendorff)
authorEric Faust <efaustbmo@gmail.com>
Fri, 25 Apr 2014 17:10:54 -0700
changeset 180711 159a32e886d0371f74953ab43aa6fedf4194d7c6
parent 180710 21d545a5ac3ff647c623358d7df541e08605004c
child 180712 d1b899e683c2b31a1cbe46da8f96525bf7884c8a
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersjorendorff
bugs978229
milestone31.0a1
Bug 978229 - Part 2: Remove IsSealed() from Proxy.[[Delete]]. (r=jorendorff)
js/src/jsproxy.cpp
--- a/js/src/jsproxy.cpp
+++ b/js/src/jsproxy.cpp
@@ -1830,20 +1830,21 @@ ScriptedDirectProxyHandler::delete_(JSCo
         value
     };
     RootedValue trapResult(cx);
     if (!Invoke(cx, ObjectValue(*handler), trap, ArrayLength(argv), argv, &trapResult))
         return false;
 
     // step 6-7
     if (ToBoolean(trapResult)) {
-        bool sealed;
-        if (!IsSealed(cx, target, id, &sealed))
+        Rooted<PropertyDescriptor> desc(cx);
+        if (!GetOwnPropertyDescriptor(cx, target, id, &desc))
             return false;
-        if (sealed) {
+
+        if (desc.object() && desc.isPermanent()) {
             RootedValue v(cx, IdToValue(id));
             js_ReportValueError(cx, JSMSG_CANT_DELETE, JSDVG_IGNORE_STACK, v, js::NullPtr());
             return false;
         }
 
         *bp = true;
         return true;
     }