Bug 1089079. Make .length on interface objects configurable. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 24 Nov 2014 12:56:32 +0000
changeset 241541 bb06fb2e19831c89ec57e2442f311b3165fdc87a
parent 241540 8c990d08ba00f55a02dd056f1c0c8673d697e71f
child 241542 3f6d72b1214e039b0acfecdbeb0e2a80669f2ff2
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1089079
milestone36.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 1089079. Make .length on interface objects configurable. r=peterv
dom/bindings/BindingUtils.cpp
dom/imptests/idlharness.js
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -454,17 +454,17 @@ CreateInterfaceObject(JSContext* cx, JS:
     JS::Rooted<JSFunction*> toString(cx,
       JS_DefineFunction(cx, constructor, "toString", InterfaceObjectToString,
                         0, 0));
     if (!toString) {
       return nullptr;
     }
 
     if (!JS_DefineProperty(cx, constructor, "length", ctorNargs,
-                           JSPROP_READONLY | JSPROP_PERMANENT)) {
+                           JSPROP_READONLY)) {
       return nullptr;
     }
 
     // Might as well intern, since we're going to need an atomized
     // version of name anyway when we stick our constructor on the
     // global.
     JS::Rooted<JSString*> nameStr(cx, JS_InternString(cx, name));
     if (!nameStr) {
--- a/dom/imptests/idlharness.js
+++ b/dom/imptests/idlharness.js
@@ -1145,33 +1145,33 @@ IdlInterface.prototype.test_self = funct
             assert_throws(new TypeError(), function() {
                 new window[this.name]();
             }.bind(this), "interface object didn't throw TypeError when called as a constructor");
         }
     }.bind(this), this.name + " interface: existence and properties of interface object");
 
     if (!this.is_callback()) {
         test(function() {
-            // This function tests WebIDL as of 2013-08-25.
-            // http://dev.w3.org/2006/webapi/WebIDL/#es-interface-call
+            // This function tests WebIDL as of 2014-10-25.
+            // https://heycam.github.io/webidl/#es-interface-call
 
             assert_own_property(window, this.name,
                                 "window does not have own property " + format_value(this.name));
 
             // "Interface objects for non-callback interfaces MUST have a
             // property named “length” with attributes { [[Writable]]: false,
-            // [[Enumerable]]: false, [[Configurable]]: false } whose value is
+            // [[Enumerable]]: false, [[Configurable]]: true } whose value is
             // a Number."
             assert_own_property(window[this.name], "length");
             var desc = Object.getOwnPropertyDescriptor(window[this.name], "length");
             assert_false("get" in desc, this.name + ".length has getter");
             assert_false("set" in desc, this.name + ".length has setter");
             assert_false(desc.writable, this.name + ".length is writable");
             assert_false(desc.enumerable, this.name + ".length is enumerable");
-            assert_false(desc.configurable, this.name + ".length is configurable");
+            assert_true(desc.configurable, this.name + ".length is not configurable");
 
             var constructors = this.extAttrs
                 .filter(function(attr) { return attr.name == "Constructor"; });
             var expected_length;
             if (!constructors.length) {
                 // "If the [Constructor] extended attribute, does not appear on
                 // the interface definition, then the value is 0."
                 expected_length = 0;