summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug744285.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/jit-test/tests/basic/bug744285.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/jit-test/tests/basic/bug744285.js')
-rw-r--r--js/src/jit-test/tests/basic/bug744285.js71
1 files changed, 71 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/bug744285.js b/js/src/jit-test/tests/basic/bug744285.js
new file mode 100644
index 000000000..f5a9e4f36
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug744285.js
@@ -0,0 +1,71 @@
+// |jit-test| error: TypeError;
+var TZ_DIFF = getTimeZoneDiff();
+var now = new Date;
+var TZ_DIFF = getTimeZoneDiff();
+var now = new Date;
+var MAX_UNIX_TIMET = 2145859200;
+var RANGE_EXPANSION_AMOUNT = 60;
+function tzOffsetFromUnixTimestamp(timestamp) {
+ new Date
+ }
+function clearDSTOffsetCache(undesiredTimestamp) {
+ tzOffsetFromUnixTimestamp()
+ tzOffsetFromUnixTimestamp()
+ tzOffsetFromUnixTimestamp()
+ tzOffsetFromUnixTimestamp()
+ tzOffsetFromUnixTimestamp()
+ }
+function computeCanonicalTZOffset(timestamp) {
+ clearDSTOffsetCache()
+ tzOffsetFromUnixTimestamp()
+ }
+var TEST_TIMESTAMPS_SECONDS = [
+ 0,
+ RANGE_EXPANSION_AMOUNT,
+ MAX_UNIX_TIMET,
+ ];
+var TEST_TIMESTAMPS = TEST_TIMESTAMPS_SECONDS.map(function(v) { });
+var CORRECT_TZOFFSETS = TEST_TIMESTAMPS.map(computeCanonicalTZOffset);
+var TZ_DIFF = getTimeZoneDiff();
+var now = new Date;
+var TZ_DIFF = getTimeZoneDiff();
+var now = new Date;function getTimeZoneDiff() {
+ new Date/60
+}
+function check(b, desc) {
+ function classOf(obj) {
+ return Object.prototype.toString.call(obj);
+ }
+ function ownProperties(obj) {
+ return Object.getOwnPropertyNames(obj).
+ map(function (p) { return [p, Object.getOwnPropertyDescriptor(obj, p)]; });
+ }
+ function isCloneable(pair) { }
+ function assertIsCloneOf(a, b, path) {
+ ca = classOf(a)
+ assertEq(ca, classOf(b), path)
+ assertEq(Object.getPrototypeOf(a), ca == "[object Object]" ? Object.prototype : Array.prototype, path)
+ pb = ownProperties(b).filter(isCloneable)
+ pa = ownProperties(a)
+ function byName(a, b) 0
+ byName
+ (pa.length, pb.length, "should see the same number of properties " + path)
+ for (var i = 0; i < pa.length; i++) {
+ gczeal(4)
+ }
+ }
+ banner = desc || uneval()
+ a = deserialize(serialize(b))
+ var queue = [[a, b, banner]];
+ while (queue.length) {
+ var triple = queue.shift();
+ assertIsCloneOf(triple[0], triple[1], triple[2])
+ }
+}
+check({x: 0.7, p: "forty-two", y: null, z: undefined});
+check(Object.prototype);
+b=[, , 2, 3];
+b.expando=true;
+b[5]=5;
+b[0]=0;b[4]=4;
+check(b)([, , , , , , 6])