diff options
Diffstat (limited to 'js/src/tests/e4x/extensions/extensibility.js')
-rw-r--r-- | js/src/tests/e4x/extensions/extensibility.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/js/src/tests/e4x/extensions/extensibility.js b/js/src/tests/e4x/extensions/extensibility.js new file mode 100644 index 0000000..3ac33be --- /dev/null +++ b/js/src/tests/e4x/extensions/extensibility.js @@ -0,0 +1,42 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + * Contributor: + * Jeff Walden <jwalden+code@mit.edu> + */ + +var gTestfile = 'extensibility.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 492849; +var summary = 'XML values cannot have their [[Extensible]] property changed'; + +print(BUGNUMBER + ": " + summary); + +/************** + * BEGIN TEST * + **************/ + +var x = <foo/>; + +assertEq(Object.isExtensible(x), true); + +try +{ + Object.preventExtensions(x); + throw new Error("didn't throw"); +} +catch (e) +{ + assertEq(e instanceof TypeError, true, + "xmlValue.[[Extensible]] cannot be changed"); +} + +assertEq(Object.isExtensible(x), true); + + +/******************************************************************************/ + +if (typeof reportCompare === "function") + reportCompare(true, true); + +print("All tests passed!"); |