This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
From <http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces> and <http://es5.github.com/#x8.12.7>, I would assume 'delete window.Node' returns true and removes the property, but that doesn't seem to be the case in browsers. They seem to all return true and still keep the property around.
Testing with http://people.mozilla.org/~cmccormack/tests/interface-object-property.html, I find that Opera, Firefox and IE allow the property to be deleted, while Safari reports the property as non-configurable so refuses to delete it and Chrome reports the property as configurable but still refuses to delete it. Do you have a test case showing interface object properties being deleted in Opera/Firefox/IE?
OK, looks like the spec is correct in the general case. However, something goes wrong with window.Node in particular in Gecko; I'm assuming that's a Gecko bug. (See <http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1120>.) I'm satisfied with your response.
(And for people who are interested: <http://w3c-test.org/webapps/DOMCore/tests/submissions/Ms2ger/interfaces.html>.)
Here is your code: function testInterfaceDeletable(iface) { test(function() { assert_true(!!window[iface], "Interface should exist.") assert_true(delete window[iface], "The delete operator should return true.") assert_equals(window[iface], undefined, "Interface should be gone.") } Avoid getting bit by ASI bugs by consistently using explicit semicolons where they are required. The delete operator does not "return" anything. The delete operator is just what it is: an operator. It performs an operation which has a boolean result. test(function() { for (var p in window) { interfaces.forEach(function(i) { assert_not_equals(p, i) }) } }, "Interface objects properties should not be Enumerable") If `window` is specified to have own interface objects as own properties, then you can use: ({}).propertyIsEnumerable.call(window, "Node"); Otherwise, if interface objects can exist in `window` prototype chain, `propertyIsEnumerable`, which doesn't check the object's prototype, won't work there. Does WebIDL or HTML5 specify `window` to have `Object.prototype` on its prototype chain? If so, then the code could use `window.propertyIsEnumerable("Node")`.