Bug 649570 - |delete window.NaN| should be a TypeError. This got fixed...sometime. Add a a test so we don't regress this in the future. r=sparky
authorJeff Walden <jwalden@mit.edu>
Tue, 14 May 2013 12:56:26 -0700
changeset 143769 23d6197df2dd64759dbd719c3c8182453393cbbb
parent 143768 5c4392f60d581c4294d42aaff80887cb2b00828e
child 143770 23741f85220a7a3dcce1c1ca65d44ae7ff2761a7
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssparky
bugs649570
milestone24.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 649570 - |delete window.NaN| should be a TypeError. This got fixed...sometime. Add a a test so we don't regress this in the future. r=sparky
js/src/tests/ecma_5/Global/delete-global-NaN-property.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_5/Global/delete-global-NaN-property.js
@@ -0,0 +1,32 @@
+// Any copyright is dedicated to the Public Domain.
+// http://creativecommons.org/licenses/publicdomain/
+"use strict"
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 649570;
+var summary = "|delete window.NaN| should throw a TypeError";
+
+print(BUGNUMBER + ": " + summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var g = this, v = false;
+try
+{
+  delete this.NaN;
+  throw new Error("no exception thrown");
+}
+catch (e)
+{
+  assertEq(e instanceof TypeError, true,
+           "Expected a TypeError, got: " + e);
+}
+
+/******************************************************************************/
+
+if (typeof reportCompare === "function")
+  reportCompare(true, true);
+
+print("Tests complete");