2009-01-14 07:16:18 -08:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2008-08-13 23:58:36 -07:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is JavaScript Engine testing utilities.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2008
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): Mike Shaver
|
|
|
|
* Brendan Eich
|
|
|
|
* Andreas Gal
|
|
|
|
* David Anderson
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
* Boris Zbarsky
|
|
|
|
* Brian Crowder
|
|
|
|
* Blake Kaplan
|
|
|
|
* Robert Sayre
|
|
|
|
* Vladimir Vukicevic
|
2008-08-13 23:58:36 -07:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
var gTestfile = 'trace-test.js';
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
var BUGNUMBER = 'none';
|
|
|
|
var summary = 'trace-capability mini-testsuite';
|
|
|
|
|
|
|
|
printBugNumber(BUGNUMBER);
|
|
|
|
printStatus (summary);
|
2008-09-17 03:41:19 -07:00
|
|
|
|
|
|
|
jit(true);
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A number of the tests in this file depend on the setting of
|
|
|
|
* HOTLOOP. Define some constants up front, so they're easy to grep
|
|
|
|
* for.
|
|
|
|
*/
|
|
|
|
// The HOTLOOP constant we depend on; only readable from our stats
|
|
|
|
// object in debug builds.
|
|
|
|
const haveTracemonkey = !!(this.tracemonkey)
|
2009-01-14 07:16:18 -08:00
|
|
|
const HOTLOOP = haveTracemonkey ? tracemonkey.HOTLOOP : 2;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
// The loop count at which we trace
|
|
|
|
const RECORDLOOP = HOTLOOP;
|
|
|
|
// The loop count at which we run the trace
|
|
|
|
const RUNLOOP = HOTLOOP + 1;
|
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
var testName = null;
|
|
|
|
if ("arguments" in this && arguments.length > 0)
|
|
|
|
testName = arguments[0];
|
|
|
|
var fails = [], passes=[];
|
|
|
|
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
function jitstatHandler(f)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
if (!haveTracemonkey)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// XXXbz this is a nasty hack, but I can't figure out a way to
|
|
|
|
// just use jitstats.tbl here
|
|
|
|
f("recorderStarted");
|
|
|
|
f("recorderAborted");
|
|
|
|
f("traceCompleted");
|
|
|
|
f("sideExitIntoInterpreter");
|
|
|
|
f("typeMapMismatchAtEntry");
|
|
|
|
f("returnToDifferentLoopHeader");
|
|
|
|
f("traceTriggered");
|
|
|
|
f("globalShapeMismatchAtEntry");
|
|
|
|
f("treesTrashed");
|
|
|
|
f("slotPromoted");
|
|
|
|
f("unstableLoopVariable");
|
|
|
|
f("noCompatInnerTrees");
|
|
|
|
f("breakLoopExits");
|
|
|
|
f("returnLoopExits");
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
function test(f)
|
|
|
|
{
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
if (!testName || testName == f.name) {
|
|
|
|
// Collect our jit stats
|
|
|
|
var localJITstats = {};
|
|
|
|
jitstatHandler(function(prop, local, global) {
|
2009-01-14 07:16:18 -08:00
|
|
|
localJITstats[prop] = tracemonkey[prop];
|
|
|
|
});
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
check(f.name, f(), f.expected, localJITstats, f.jitstats);
|
|
|
|
}
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
function map_test(t, cases)
|
|
|
|
{
|
|
|
|
for (var i = 0; i < cases.length; i++) {
|
|
|
|
function c() { return t(cases[i].input); }
|
|
|
|
c.expected = cases[i].expected;
|
|
|
|
c.name = t.name + "(" + uneval(cases[i].input) + ")";
|
|
|
|
test(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Use this function to compare expected and actual test results.
|
|
|
|
// Types must match.
|
|
|
|
// For numbers, treat NaN as matching NaN, distinguish 0 and -0, and
|
|
|
|
// tolerate a certain degree of error for other values.
|
|
|
|
//
|
|
|
|
// These are the same criteria used by the tests in js/tests, except that
|
|
|
|
// we distinguish 0 and -0.
|
|
|
|
function close_enough(expected, actual)
|
|
|
|
{
|
|
|
|
if (typeof expected != typeof actual)
|
|
|
|
return false;
|
|
|
|
if (typeof expected != 'number')
|
|
|
|
return actual == expected;
|
|
|
|
|
|
|
|
// Distinguish NaN from other values. Using x != x comparisons here
|
|
|
|
// works even if tests redefine isNaN.
|
|
|
|
if (actual != actual)
|
|
|
|
return expected != expected
|
|
|
|
if (expected != expected)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Tolerate a certain degree of error.
|
|
|
|
if (actual != expected)
|
|
|
|
return Math.abs(actual - expected) <= 1E-10;
|
|
|
|
|
|
|
|
// Distinguish 0 and -0.
|
|
|
|
if (actual == 0)
|
|
|
|
return (1 / actual > 0) == (1 / expected > 0);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
function check(desc, actual, expected, oldJITstats, expectedJITstats)
|
2008-08-13 23:58:36 -07:00
|
|
|
{
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
var pass = false;
|
2009-01-14 07:16:18 -08:00
|
|
|
if (close_enough(expected, actual)) {
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
pass = true;
|
|
|
|
jitstatHandler(function(prop) {
|
2009-01-14 07:16:18 -08:00
|
|
|
if (expectedJITstats && prop in expectedJITstats &&
|
|
|
|
expectedJITstats[prop] !=
|
|
|
|
tracemonkey[prop] - oldJITstats[prop]) {
|
|
|
|
pass = false;
|
|
|
|
}
|
|
|
|
});
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
if (pass) {
|
|
|
|
reportCompare(expected + '', actual + '', desc);
|
2008-10-10 04:56:08 -07:00
|
|
|
passes.push(desc);
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
return print(desc, ": passed");
|
2008-10-10 04:56:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
if (expected instanceof RegExp) {
|
|
|
|
pass = reportMatch(expected, actual + '', desc);
|
|
|
|
if (pass) {
|
|
|
|
jitstatHandler(function(prop) {
|
2009-01-14 07:16:18 -08:00
|
|
|
if (expectedJITstats && prop in expectedJITstats &&
|
|
|
|
expectedJITstats[prop] !=
|
|
|
|
tracemonkey[prop] - oldJITstats[prop]) {
|
|
|
|
pass = false;
|
|
|
|
}
|
|
|
|
});
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
if (pass) {
|
|
|
|
passes.push(desc);
|
|
|
|
return print(desc, ": passed");
|
|
|
|
}
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
2008-10-10 04:56:08 -07:00
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
reportCompare(expected, actual, desc);
|
2009-01-14 07:16:18 -08:00
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
fails.push(desc);
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
var expectedStats = "";
|
|
|
|
if (expectedJITstats) {
|
2009-01-14 07:16:18 -08:00
|
|
|
jitstatHandler(function(prop) {
|
|
|
|
if (prop in expectedJITstats) {
|
|
|
|
if (expectedStats)
|
|
|
|
expectedStats += " ";
|
|
|
|
expectedStats +=
|
|
|
|
prop + ": " + expectedJITstats[prop];
|
|
|
|
}
|
|
|
|
});
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
var actualStats = "";
|
|
|
|
if (expectedJITstats) {
|
2009-01-14 07:16:18 -08:00
|
|
|
jitstatHandler(function(prop) {
|
|
|
|
if (prop in expectedJITstats) {
|
|
|
|
if (actualStats)
|
|
|
|
actualStats += " ";
|
|
|
|
actualStats += prop + ": " + (tracemonkey[prop]-oldJITstats[prop]);
|
|
|
|
}
|
|
|
|
});
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
print(desc, ": FAILED: expected", typeof(expected),
|
|
|
|
"(", uneval(expected), ")",
|
|
|
|
(expectedStats ? " [" + expectedStats + "] " : ""),
|
|
|
|
"!= actual",
|
|
|
|
typeof(actual), "(", uneval(actual), ")",
|
|
|
|
(actualStats ? " [" + actualStats + "] " : ""));
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function ifInsideLoop()
|
|
|
|
{
|
|
|
|
var cond = true, intCond = 5, count = 0;
|
|
|
|
for (var i = 0; i < 100; i++) {
|
|
|
|
if (cond)
|
|
|
|
count++;
|
|
|
|
if (intCond)
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
ifInsideLoop.expected = 200;
|
|
|
|
test(ifInsideLoop);
|
|
|
|
|
|
|
|
function bitwiseAnd_inner(bitwiseAndValue) {
|
|
|
|
for (var i = 0; i < 60000; i++)
|
|
|
|
bitwiseAndValue = bitwiseAndValue & i;
|
|
|
|
return bitwiseAndValue;
|
|
|
|
}
|
|
|
|
function bitwiseAnd()
|
|
|
|
{
|
|
|
|
return bitwiseAnd_inner(12341234);
|
|
|
|
}
|
|
|
|
bitwiseAnd.expected = 0;
|
|
|
|
test(bitwiseAnd);
|
|
|
|
|
|
|
|
if (!testName || testName == "bitwiseGlobal") {
|
|
|
|
bitwiseAndValue = Math.pow(2,32);
|
|
|
|
for (var i = 0; i < 60000; i++)
|
|
|
|
bitwiseAndValue = bitwiseAndValue & i;
|
|
|
|
check("bitwiseGlobal", bitwiseAndValue, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function equalInt()
|
|
|
|
{
|
2008-09-17 03:41:19 -07:00
|
|
|
var i1 = 55, one = 1, zero = 0, undef;
|
|
|
|
var o1 = { }, o2 = { };
|
|
|
|
var s = "5";
|
|
|
|
var hits = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
2008-08-13 23:58:36 -07:00
|
|
|
for (var i = 0; i < 5000; i++) {
|
|
|
|
if (i1 == 55) hits[0]++;
|
|
|
|
if (i1 != 56) hits[1]++;
|
|
|
|
if (i1 < 56) hits[2]++;
|
|
|
|
if (i1 > 50) hits[3]++;
|
|
|
|
if (i1 <= 60) hits[4]++;
|
|
|
|
if (i1 >= 30) hits[5]++;
|
|
|
|
if (i1 == 7) hits[6]++;
|
|
|
|
if (i1 != 55) hits[7]++;
|
|
|
|
if (i1 < 30) hits[8]++;
|
|
|
|
if (i1 > 90) hits[9]++;
|
|
|
|
if (i1 <= 40) hits[10]++;
|
|
|
|
if (i1 >= 70) hits[11]++;
|
2008-09-17 03:41:19 -07:00
|
|
|
if (o1 == o2) hits[12]++;
|
|
|
|
if (o2 != null) hits[13]++;
|
|
|
|
if (s < 10) hits[14]++;
|
|
|
|
if (true < zero) hits[15]++;
|
|
|
|
if (undef > one) hits[16]++;
|
|
|
|
if (undef < zero) hits[17]++;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
return hits.toString();
|
|
|
|
}
|
2008-09-17 03:41:19 -07:00
|
|
|
equalInt.expected = "5000,5000,5000,5000,5000,5000,0,0,0,0,0,0,0,5000,5000,0,0,0";
|
2008-08-13 23:58:36 -07:00
|
|
|
test(equalInt);
|
|
|
|
|
|
|
|
var a;
|
|
|
|
function setelem()
|
|
|
|
{
|
|
|
|
a = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
|
|
|
a = a.concat(a, a, a);
|
|
|
|
var l = a.length;
|
|
|
|
for (var i = 0; i < l; i++) {
|
|
|
|
a[i] = i;
|
|
|
|
}
|
|
|
|
return a.toString();
|
|
|
|
}
|
|
|
|
setelem.expected = "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83";
|
|
|
|
test(setelem);
|
|
|
|
|
|
|
|
function getelem_inner(a)
|
|
|
|
{
|
|
|
|
var accum = 0;
|
|
|
|
var l = a.length;
|
|
|
|
for (var i = 0; i < l; i++) {
|
|
|
|
accum += a[i];
|
|
|
|
}
|
|
|
|
return accum;
|
|
|
|
}
|
|
|
|
function getelem()
|
|
|
|
{
|
|
|
|
return getelem_inner(a);
|
|
|
|
}
|
|
|
|
getelem.expected = 3486;
|
|
|
|
test(getelem);
|
|
|
|
|
|
|
|
globalName = 907;
|
|
|
|
function name()
|
|
|
|
{
|
|
|
|
var a = 0;
|
|
|
|
for (var i = 0; i < 100; i++)
|
|
|
|
a = globalName;
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
name.expected = 907;
|
|
|
|
test(name);
|
|
|
|
|
|
|
|
var globalInt = 0;
|
|
|
|
if (!testName || testName == "globalGet") {
|
|
|
|
for (var i = 0; i < 500; i++)
|
|
|
|
globalInt = globalName + i;
|
|
|
|
check("globalGet", globalInt, globalName + 499);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!testName || testName == "globalSet") {
|
|
|
|
for (var i = 0; i < 500; i++)
|
|
|
|
globalInt = i;
|
|
|
|
check("globalSet", globalInt, 499);
|
|
|
|
}
|
|
|
|
|
|
|
|
function arith()
|
|
|
|
{
|
|
|
|
var accum = 0;
|
|
|
|
for (var i = 0; i < 100; i++) {
|
|
|
|
accum += (i * 2) - 1;
|
|
|
|
}
|
|
|
|
return accum;
|
|
|
|
}
|
|
|
|
arith.expected = 9800;
|
|
|
|
test(arith);
|
|
|
|
|
|
|
|
function lsh_inner(n)
|
|
|
|
{
|
|
|
|
var r;
|
|
|
|
for (var i = 0; i < 35; i++)
|
|
|
|
r = 0x1 << n;
|
|
|
|
return r;
|
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
|
|
|
|
map_test (lsh_inner,
|
|
|
|
[{input: 15, expected: 32768},
|
|
|
|
{input: 55, expected: 8388608},
|
|
|
|
{input: 1, expected: 2},
|
|
|
|
{input: 0, expected: 1}]);
|
2008-08-13 23:58:36 -07:00
|
|
|
|
|
|
|
function rsh_inner(n)
|
|
|
|
{
|
|
|
|
var r;
|
|
|
|
for (var i = 0; i < 35; i++)
|
|
|
|
r = 0x11010101 >> n;
|
|
|
|
return r;
|
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
map_test (rsh_inner,
|
|
|
|
[{input: 8, expected: 1114369},
|
|
|
|
{input: 5, expected: 8914952},
|
|
|
|
{input: 35, expected: 35659808},
|
|
|
|
{input: -1, expected: 0}]);
|
2008-08-13 23:58:36 -07:00
|
|
|
|
|
|
|
function ursh_inner(n)
|
|
|
|
{
|
|
|
|
var r;
|
|
|
|
for (var i = 0; i < 35; i++)
|
|
|
|
r = -55 >>> n;
|
|
|
|
return r;
|
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
map_test (ursh_inner,
|
|
|
|
[{input: 8, expected: 16777215},
|
|
|
|
{input: 33, expected: 2147483620},
|
|
|
|
{input: 0, expected: 4294967241},
|
|
|
|
{input: 1, expected: 2147483620}]);
|
2008-08-13 23:58:36 -07:00
|
|
|
|
|
|
|
function doMath_inner(cos)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var s = 0;
|
|
|
|
var sin = Math.sin;
|
|
|
|
for (var i = 0; i < 200; i++)
|
|
|
|
s = -Math.pow(sin(i) + cos(i * 0.75), 4);
|
|
|
|
return s;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
function doMath() {
|
|
|
|
return doMath_inner(Math.cos);
|
|
|
|
}
|
|
|
|
doMath.expected = -0.5405549555611059;
|
|
|
|
test(doMath);
|
|
|
|
|
|
|
|
function fannkuch() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var count = Array(8);
|
|
|
|
var r = 8;
|
|
|
|
var done = 0;
|
|
|
|
while (done < 40) {
|
|
|
|
// write-out the first 30 permutations
|
|
|
|
done += r;
|
|
|
|
while (r != 1) { count[r - 1] = r; r--; }
|
|
|
|
while (true) {
|
|
|
|
count[r] = count[r] - 1;
|
|
|
|
if (count[r] > 0) break;
|
|
|
|
r++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return done;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
fannkuch.expected = 41;
|
|
|
|
test(fannkuch);
|
|
|
|
|
|
|
|
function xprop()
|
|
|
|
{
|
|
|
|
a = 0;
|
|
|
|
for (var i = 0; i < 20; i++)
|
|
|
|
a += 7;
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
xprop.expected = 140;
|
|
|
|
test(xprop);
|
|
|
|
|
|
|
|
var a = 2;
|
|
|
|
function getprop_inner(o2)
|
|
|
|
{
|
|
|
|
var o = {a:5};
|
|
|
|
var t = this;
|
|
|
|
var x = 0;
|
|
|
|
for (var i = 0; i < 20; i++) {
|
|
|
|
t = this;
|
|
|
|
x += o.a + o2.a + this.a + t.a;
|
|
|
|
}
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
function getprop() {
|
|
|
|
return getprop_inner({a:9});
|
|
|
|
}
|
|
|
|
getprop.expected = 360;
|
|
|
|
test(getprop);
|
|
|
|
|
|
|
|
function mod()
|
|
|
|
{
|
|
|
|
var mods = [-1,-1,-1,-1];
|
|
|
|
var a = 9.5, b = -5, c = 42, d = (1/0);
|
|
|
|
for (var i = 0; i < 20; i++) {
|
|
|
|
mods[0] = a % b;
|
|
|
|
mods[1] = b % 1;
|
|
|
|
mods[2] = c % d;
|
|
|
|
mods[3] = c % a;
|
|
|
|
mods[4] = b % 0;
|
|
|
|
}
|
|
|
|
return mods.toString();
|
|
|
|
}
|
|
|
|
mod.expected = "4.5,0,42,4,NaN";
|
|
|
|
test(mod);
|
|
|
|
|
|
|
|
function glob_f1() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
function glob_f2() {
|
|
|
|
return glob_f1();
|
|
|
|
}
|
|
|
|
function call()
|
|
|
|
{
|
|
|
|
var q1 = 0, q2 = 0, q3 = 0, q4 = 0, q5 = 0;
|
|
|
|
var o = {};
|
|
|
|
function f1() {
|
2009-01-14 07:16:18 -08:00
|
|
|
return 1;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
function f2(f) {
|
2009-01-14 07:16:18 -08:00
|
|
|
return f();
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
o.f = f1;
|
|
|
|
for (var i = 0; i < 100; ++i) {
|
2009-01-14 07:16:18 -08:00
|
|
|
q1 += f1();
|
|
|
|
q2 += f2(f1);
|
|
|
|
q3 += glob_f1();
|
|
|
|
q4 += o.f();
|
|
|
|
q5 += glob_f2();
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
var ret = String([q1, q2, q3, q4, q5]);
|
2008-08-13 23:58:36 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
call.expected = "100,100,100,100,100";
|
|
|
|
test(call);
|
|
|
|
|
|
|
|
function setprop()
|
|
|
|
{
|
|
|
|
var obj = { a:-1 };
|
|
|
|
var obj2 = { b:-1, a:-1 };
|
|
|
|
for (var i = 0; i < 20; i++) {
|
|
|
|
obj2.b = obj.a = i;
|
|
|
|
}
|
|
|
|
return [obj.a, obj2.a, obj2.b].toString();
|
|
|
|
}
|
|
|
|
setprop.expected = "19,-1,19";
|
|
|
|
test(setprop);
|
|
|
|
|
|
|
|
function testif() {
|
|
|
|
var q = 0;
|
|
|
|
for (var i = 0; i < 100; i++) {
|
|
|
|
if ((i & 1) == 0)
|
|
|
|
q++;
|
|
|
|
else
|
|
|
|
q--;
|
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
return q;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
testif.expected = 0;
|
2008-08-13 23:58:36 -07:00
|
|
|
test(testif);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
var globalinc = 0;
|
2008-08-13 23:58:36 -07:00
|
|
|
function testincops(n) {
|
|
|
|
var i = 0, o = {p:0}, a = [0];
|
|
|
|
n = 100;
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++);
|
|
|
|
while (i-- > 0);
|
|
|
|
for (i = 0; i < n; ++i);
|
|
|
|
while (--i >= 0);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
for (o.p = 0; o.p < n; o.p++) globalinc++;
|
|
|
|
while (o.p-- > 0) --globalinc;
|
|
|
|
for (o.p = 0; o.p < n; ++o.p) ++globalinc;
|
|
|
|
while (--o.p >= 0) globalinc--;
|
2008-08-13 23:58:36 -07:00
|
|
|
|
|
|
|
++i; // set to 0
|
|
|
|
for (a[i] = 0; a[i] < n; a[i]++);
|
|
|
|
while (a[i]-- > 0);
|
|
|
|
for (a[i] = 0; a[i] < n; ++a[i]);
|
|
|
|
while (--a[i] >= 0);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
return [++o.p, ++a[i], globalinc].toString();
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
2008-09-17 03:41:19 -07:00
|
|
|
testincops.expected = "0,0,0";
|
2008-08-13 23:58:36 -07:00
|
|
|
test(testincops);
|
|
|
|
|
|
|
|
function trees() {
|
|
|
|
var i = 0, o = [0,0,0];
|
|
|
|
for (i = 0; i < 100; ++i) {
|
|
|
|
if ((i & 1) == 0) o[0]++;
|
|
|
|
else if ((i & 2) == 0) o[1]++;
|
|
|
|
else o[2]++;
|
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
return String(o);
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
trees.expected = "50,25,25";
|
|
|
|
test(trees);
|
|
|
|
|
|
|
|
function unboxint() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var q = 0;
|
|
|
|
var o = [4];
|
|
|
|
for (var i = 0; i < 100; ++i)
|
|
|
|
q = o[0] << 1;
|
|
|
|
return q;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
unboxint.expected = 8;
|
2008-08-13 23:58:36 -07:00
|
|
|
test(unboxint);
|
|
|
|
|
|
|
|
function strings()
|
|
|
|
{
|
|
|
|
var a = [], b = -1;
|
|
|
|
var s = "abcdefghij", s2 = "a";
|
|
|
|
var f = "f";
|
|
|
|
var c = 0, d = 0, e = 0, g = 0;
|
|
|
|
for (var i = 0; i < 10; i++) {
|
2008-09-17 03:41:19 -07:00
|
|
|
a[i] = (s.substring(i, i+1) + s[i] + String.fromCharCode(s2.charCodeAt(0) + i)).concat(i) + i;
|
2008-08-13 23:58:36 -07:00
|
|
|
if (s[i] == f)
|
|
|
|
c++;
|
|
|
|
if (s[i] != 'b')
|
|
|
|
d++;
|
|
|
|
if ("B" > s2)
|
|
|
|
g++; // f already used
|
|
|
|
if (s2 < "b")
|
|
|
|
e++;
|
|
|
|
b = s.length;
|
|
|
|
}
|
|
|
|
return a.toString() + b + c + d + e + g;
|
|
|
|
}
|
2008-09-17 03:41:19 -07:00
|
|
|
strings.expected = "aaa00,bbb11,ccc22,ddd33,eee44,fff55,ggg66,hhh77,iii88,jjj991019100";
|
2008-08-13 23:58:36 -07:00
|
|
|
test(strings);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function dependentStrings()
|
|
|
|
{
|
|
|
|
var a = [];
|
|
|
|
var t = "abcdefghijklmnopqrst";
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
var s = t.substring(2*i, 2*i + 2);
|
|
|
|
a[i] = s + s.length;
|
|
|
|
}
|
|
|
|
return a.join("");
|
|
|
|
}
|
|
|
|
dependentStrings.expected = "ab2cd2ef2gh2ij2kl2mn2op2qr2st2";
|
|
|
|
test(dependentStrings);
|
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
function stringConvert()
|
|
|
|
{
|
|
|
|
var a = [];
|
|
|
|
var s1 = "F", s2 = "1.3", s3 = "5";
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
a[0] = 1 >> s1;
|
|
|
|
a[1] = 10 - s2;
|
|
|
|
a[2] = 15 * s3;
|
|
|
|
a[3] = s3 | 32;
|
2008-09-17 03:41:19 -07:00
|
|
|
a[4] = s2 + 60;
|
2008-08-13 23:58:36 -07:00
|
|
|
// a[5] = 9 + s3;
|
|
|
|
// a[6] = -s3;
|
|
|
|
a[7] = s3 & "7";
|
|
|
|
// a[8] = ~s3;
|
|
|
|
}
|
|
|
|
return a.toString();
|
|
|
|
}
|
2008-09-17 03:41:19 -07:00
|
|
|
stringConvert.expected = "1,8.7,75,37,1.360,,,5";
|
2008-08-13 23:58:36 -07:00
|
|
|
test(stringConvert);
|
|
|
|
|
|
|
|
function orTestHelper(a, b, n)
|
|
|
|
{
|
|
|
|
var k = 0;
|
|
|
|
for (var i = 0; i < n; i++) {
|
|
|
|
if (a || b)
|
|
|
|
k += i;
|
|
|
|
}
|
|
|
|
return k;
|
|
|
|
}
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
var orNaNTest1, orNaNTest2;
|
|
|
|
|
|
|
|
orNaNTest1 = new Function("return orTestHelper(NaN, NaN, 10);");
|
|
|
|
orNaNTest1.name = 'orNaNTest1';
|
2009-01-14 07:16:18 -08:00
|
|
|
orNaNTest1.expected = 0;
|
2008-09-17 03:41:19 -07:00
|
|
|
orNaNTest2 = new Function("return orTestHelper(NaN, 1, 10);");
|
|
|
|
orNaNTest2.name = 'orNaNTest2';
|
2009-01-14 07:16:18 -08:00
|
|
|
orNaNTest2.expected = 45;
|
2008-09-17 03:41:19 -07:00
|
|
|
test(orNaNTest1);
|
|
|
|
test(orNaNTest2);
|
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
function andTestHelper(a, b, n)
|
|
|
|
{
|
|
|
|
var k = 0;
|
|
|
|
for (var i = 0; i < n; i++) {
|
|
|
|
if (a && b)
|
|
|
|
k += i;
|
|
|
|
}
|
|
|
|
return k;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!testName || testName == "truthies") {
|
|
|
|
(function () {
|
2009-01-14 07:16:18 -08:00
|
|
|
var opsies = ["||", "&&"];
|
|
|
|
var falsies = [null, undefined, false, NaN, 0, ""];
|
|
|
|
var truthies = [{}, true, 1, 42, 1/0, -1/0, "blah"];
|
|
|
|
var boolies = [falsies, truthies];
|
|
|
|
|
|
|
|
// The for each here should abort tracing, so that this test framework
|
|
|
|
// relies only on the interpreter while the orTestHelper and andTestHelper
|
|
|
|
// functions get trace-JITed.
|
|
|
|
for each (var op in opsies) {
|
|
|
|
for (var i in boolies) {
|
|
|
|
for (var j in boolies[i]) {
|
|
|
|
var x = uneval(boolies[i][j]);
|
|
|
|
for (var k in boolies) {
|
|
|
|
for (var l in boolies[k]) {
|
|
|
|
var y = uneval(boolies[k][l]);
|
|
|
|
var prefix = (op == "||") ? "or" : "and";
|
|
|
|
var f = new Function("return " + prefix + "TestHelper(" + x + "," + y + ",10)");
|
|
|
|
f.name = prefix + "Test(" + x + "," + y + ")";
|
|
|
|
f.expected = eval(x + op + y) ? 45 : 0;
|
|
|
|
test(f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})();
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function nonEmptyStack1Helper(o, farble) {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [];
|
|
|
|
var j = 0;
|
|
|
|
for (var i in o)
|
|
|
|
a[j++] = i;
|
|
|
|
return a.join("");
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function nonEmptyStack1() {
|
2009-01-14 07:16:18 -08:00
|
|
|
return nonEmptyStack1Helper({a:1,b:2,c:3,d:4,e:5,f:6,g:7,h:8}, "hi");
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
nonEmptyStack1.expected = "abcdefgh";
|
|
|
|
test(nonEmptyStack1);
|
|
|
|
|
|
|
|
function nonEmptyStack2()
|
|
|
|
{
|
|
|
|
var a = 0;
|
|
|
|
for (var c in {a:1, b:2, c:3}) {
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
a += i;
|
|
|
|
}
|
|
|
|
return String(a);
|
|
|
|
}
|
|
|
|
nonEmptyStack2.expected = "135";
|
|
|
|
test(nonEmptyStack2);
|
|
|
|
|
|
|
|
function arityMismatchMissingArg(arg)
|
|
|
|
{
|
|
|
|
for (var a = 0, i = 1; i < 10000; i *= 2) {
|
|
|
|
a += i;
|
|
|
|
}
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
arityMismatchMissingArg.expected = 16383;
|
|
|
|
test(arityMismatchMissingArg);
|
|
|
|
|
|
|
|
function arityMismatchExtraArg()
|
|
|
|
{
|
|
|
|
return arityMismatchMissingArg(1, 2);
|
|
|
|
}
|
|
|
|
arityMismatchExtraArg.expected = 16383;
|
|
|
|
test(arityMismatchExtraArg);
|
|
|
|
|
|
|
|
function MyConstructor(i)
|
|
|
|
{
|
|
|
|
this.i = i;
|
|
|
|
}
|
|
|
|
MyConstructor.prototype.toString = function() {return this.i + ""};
|
|
|
|
|
|
|
|
function newTest()
|
|
|
|
{
|
|
|
|
var a = [];
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
a[i] = new MyConstructor(i);
|
|
|
|
return a.join("");
|
|
|
|
}
|
|
|
|
newTest.expected = "0123456789";
|
|
|
|
test(newTest);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
// The following functions use a delay line of length 2 to change the value
|
|
|
|
// of the callee without exiting the traced loop. This is obviously tuned to
|
|
|
|
// match the current HOTLOOP setting of 2.
|
|
|
|
function shapelessArgCalleeLoop(f, g, h, a)
|
2008-08-13 23:58:36 -07:00
|
|
|
{
|
2008-09-17 03:41:19 -07:00
|
|
|
for (var i = 0; i < 10; i++) {
|
2008-08-13 23:58:36 -07:00
|
|
|
f(i, a);
|
2008-09-17 03:41:19 -07:00
|
|
|
f = g;
|
|
|
|
g = h;
|
|
|
|
}
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function shapelessVarCalleeLoop(f0, g, h, a)
|
2008-08-13 23:58:36 -07:00
|
|
|
{
|
2008-09-17 03:41:19 -07:00
|
|
|
var f = f0;
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
f(i, a);
|
|
|
|
f = g;
|
|
|
|
g = h;
|
|
|
|
}
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function shapelessLetCalleeLoop(f0, g, h, a)
|
2008-08-13 23:58:36 -07:00
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++) {
|
2008-09-17 03:41:19 -07:00
|
|
|
let f = f0;
|
|
|
|
f(i, a);
|
|
|
|
f = g;
|
|
|
|
g = h;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function shapelessUnknownCalleeLoop(n, f, g, h, a)
|
2008-08-13 23:58:36 -07:00
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++) {
|
2008-09-17 03:41:19 -07:00
|
|
|
(n || f)(i, a);
|
|
|
|
f = g;
|
|
|
|
g = h;
|
2008-08-13 23:58:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function shapelessCalleeTest()
|
|
|
|
{
|
|
|
|
var a = [];
|
2008-09-17 03:41:19 -07:00
|
|
|
|
|
|
|
var helper = function (i, a) a[i] = i;
|
|
|
|
shapelessArgCalleeLoop(helper, helper, function (i, a) a[i] = -i, a);
|
|
|
|
|
|
|
|
helper = function (i, a) a[10 + i] = i;
|
|
|
|
shapelessVarCalleeLoop(helper, helper, function (i, a) a[10 + i] = -i, a);
|
|
|
|
|
|
|
|
helper = function (i, a) a[20 + i] = i;
|
|
|
|
shapelessLetCalleeLoop(helper, helper, function (i, a) a[20 + i] = -i, a);
|
|
|
|
|
|
|
|
helper = function (i, a) a[30 + i] = i;
|
|
|
|
shapelessUnknownCalleeLoop(null, helper, helper, function (i, a) a[30 + i] = -i, a);
|
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
try {
|
2008-09-17 03:41:19 -07:00
|
|
|
helper = {hack: 42};
|
|
|
|
shapelessUnknownCalleeLoop(null, helper, helper, helper, a);
|
2008-08-13 23:58:36 -07:00
|
|
|
} catch (e) {
|
2008-09-17 03:41:19 -07:00
|
|
|
if (e + "" != "TypeError: f is not a function")
|
2008-08-13 23:58:36 -07:00
|
|
|
print("shapelessUnknownCalleeLoop: unexpected exception " + e);
|
|
|
|
}
|
|
|
|
return a.join("");
|
|
|
|
}
|
2008-09-17 03:41:19 -07:00
|
|
|
shapelessCalleeTest.expected = "01-2-3-4-5-6-7-8-901-2-3-4-5-6-7-8-9012345678901-2-3-4-5-6-7-8-9";
|
2008-08-13 23:58:36 -07:00
|
|
|
test(shapelessCalleeTest);
|
|
|
|
|
|
|
|
function typeofTest()
|
|
|
|
{
|
|
|
|
var values = ["hi", "hi", "hi", null, 5, 5.1, true, undefined, /foo/, typeofTest, [], {}], types = [];
|
|
|
|
for (var i = 0; i < values.length; i++)
|
|
|
|
types[i] = typeof values[i];
|
|
|
|
return types.toString();
|
|
|
|
}
|
|
|
|
typeofTest.expected = "string,string,string,object,number,number,boolean,undefined,object,function,object,object";
|
|
|
|
test(typeofTest);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function joinTest()
|
|
|
|
{
|
|
|
|
var s = "";
|
|
|
|
var a = [];
|
|
|
|
for (var i = 0; i < 8; i++)
|
|
|
|
a[i] = [String.fromCharCode(97 + i)];
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
for (var j = 0; j < 8; j++)
|
|
|
|
a[i][1 + j] = j;
|
|
|
|
}
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
s += a[i].join(",");
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
joinTest.expected = "a,0,1,2,3,4,5,6,7b,0,1,2,3,4,5,6,7c,0,1,2,3,4,5,6,7d,0,1,2,3,4,5,6,7e,0,1,2,3,4,5,6,7f,0,1,2,3,4,5,6,7g,0,1,2,3,4,5,6,7h,0,1,2,3,4,5,6,7";
|
|
|
|
test(joinTest);
|
|
|
|
|
|
|
|
function arity1(x)
|
|
|
|
{
|
|
|
|
return (x == undefined) ? 1 : 0;
|
|
|
|
}
|
|
|
|
function missingArgTest() {
|
|
|
|
var q;
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
q = arity1();
|
|
|
|
}
|
|
|
|
return q;
|
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
missingArgTest.expected = 1;
|
2008-09-17 03:41:19 -07:00
|
|
|
test(missingArgTest);
|
|
|
|
|
|
|
|
JSON = function () {
|
2009-01-14 07:16:18 -08:00
|
|
|
return {
|
|
|
|
stringify: function stringify(value, whitelist) {
|
|
|
|
switch (typeof(value)) {
|
|
|
|
case "object":
|
|
|
|
return value.constructor.name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2008-09-17 03:41:19 -07:00
|
|
|
}();
|
|
|
|
|
|
|
|
function missingArgTest2() {
|
|
|
|
var testPairs = [
|
|
|
|
["{}", {}],
|
|
|
|
["[]", []],
|
|
|
|
['{"foo":"bar"}', {"foo":"bar"}],
|
2009-01-14 07:16:18 -08:00
|
|
|
]
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [];
|
2008-09-17 03:41:19 -07:00
|
|
|
for (var i=0; i < testPairs.length; i++) {
|
|
|
|
var s = JSON.stringify(testPairs[i][1])
|
2009-01-14 07:16:18 -08:00
|
|
|
a[i] = s;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
return a.join(",");
|
|
|
|
}
|
2008-10-10 04:56:08 -07:00
|
|
|
missingArgTest2.expected = /(Object,Array,Object|{},\[\],{"foo":"bar"})/;
|
2008-09-17 03:41:19 -07:00
|
|
|
test(missingArgTest2);
|
|
|
|
|
|
|
|
function deepForInLoop() {
|
|
|
|
// NB: the number of props set in C is arefully tuned to match HOTLOOP = 2.
|
|
|
|
function C(){this.p = 1, this.q = 2}
|
|
|
|
C.prototype = {p:1, q:2, r:3, s:4, t:5};
|
|
|
|
var o = new C;
|
|
|
|
var j = 0;
|
|
|
|
var a = [];
|
|
|
|
for (var i in o)
|
|
|
|
a[j++] = i;
|
|
|
|
return a.join("");
|
|
|
|
}
|
|
|
|
deepForInLoop.expected = "pqrst";
|
|
|
|
test(deepForInLoop);
|
|
|
|
|
|
|
|
function nestedExit(x) {
|
2009-01-14 07:16:18 -08:00
|
|
|
var q = 0;
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
{
|
|
|
|
if (x)
|
2008-09-17 03:41:19 -07:00
|
|
|
++q;
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
function nestedExitLoop() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var j = 0; j < 10; ++j)
|
|
|
|
nestedExit(j < 7);
|
|
|
|
return "ok";
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
nestedExitLoop.expected = "ok";
|
|
|
|
test(nestedExitLoop);
|
|
|
|
|
|
|
|
function bitsinbyte(b) {
|
2009-01-14 07:16:18 -08:00
|
|
|
var m = 1, c = 0;
|
|
|
|
while(m<0x100) {
|
|
|
|
if(b & m) c++;
|
|
|
|
m <<= 1;
|
|
|
|
}
|
|
|
|
return 1;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
function TimeFunc(func) {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x,y;
|
|
|
|
for(var y=0; y<256; y++) func(y);
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
function nestedExit2() {
|
2009-01-14 07:16:18 -08:00
|
|
|
TimeFunc(bitsinbyte);
|
|
|
|
return "ok";
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
nestedExit2.expected = "ok";
|
|
|
|
test(nestedExit2);
|
|
|
|
|
|
|
|
function parsingNumbers() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var s1 = "123";
|
|
|
|
var s1z = "123zzz";
|
|
|
|
var s2 = "123.456";
|
|
|
|
var s2z = "123.456zzz";
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
var e1 = 123;
|
|
|
|
var e2 = 123.456;
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
var r1, r1z, r2, r2z;
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
r1 = parseInt(s1);
|
|
|
|
r1z = parseInt(s1z);
|
|
|
|
r2 = parseFloat(s2);
|
|
|
|
r2z = parseFloat(s2z);
|
|
|
|
}
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
if (r1 == e1 && r1z == e1 && r2 == e2 && r2z == e2)
|
|
|
|
return "ok";
|
|
|
|
return "fail";
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
parsingNumbers.expected = "ok";
|
|
|
|
test(parsingNumbers);
|
|
|
|
|
|
|
|
function matchInLoop() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var k = "hi";
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
var result = k.match(/hi/) != null;
|
|
|
|
}
|
|
|
|
return result;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
matchInLoop.expected = true;
|
|
|
|
test(matchInLoop);
|
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
function testMatchAsCondition() {
|
|
|
|
var a = ['0', '0', '0', '0'];
|
|
|
|
var r = /0/;
|
|
|
|
"x".q;
|
|
|
|
for (var z = 0; z < 4; z++)
|
|
|
|
a[z].match(r) ? 1 : 2;
|
|
|
|
}
|
|
|
|
test(testMatchAsCondition);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function deep1(x) {
|
2009-01-14 07:16:18 -08:00
|
|
|
if (x > 90)
|
|
|
|
return 1;
|
|
|
|
return 2;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
function deep2() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var i = 0; i < 100; ++i)
|
|
|
|
deep1(i);
|
|
|
|
return "ok";
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
deep2.expected = "ok";
|
|
|
|
test(deep2);
|
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
function heavyFn1(i) {
|
|
|
|
if (i == 3) {
|
|
|
|
var x = 3;
|
|
|
|
return [0, i].map(function (i) i + x);
|
|
|
|
}
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
function testHeavy() {
|
|
|
|
for (var i = 0; i <= 3; i++)
|
|
|
|
heavyFn1(i);
|
|
|
|
}
|
|
|
|
test(testHeavy);
|
|
|
|
|
|
|
|
function heavyFn2(i) {
|
|
|
|
if (i < 1000)
|
|
|
|
return heavyFn1(i);
|
|
|
|
return function () i;
|
|
|
|
}
|
|
|
|
function testHeavy2() {
|
|
|
|
for (var i = 0; i <= 3; i++)
|
|
|
|
heavyFn2(i);
|
|
|
|
}
|
|
|
|
test(testHeavy2);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
var merge_type_maps_x = 0, merge_type_maps_y = 0;
|
|
|
|
function merge_type_maps() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (merge_type_maps_x = 0; merge_type_maps_x < 50; ++merge_type_maps_x)
|
|
|
|
if ((merge_type_maps_x & 1) == 1)
|
2008-09-17 03:41:19 -07:00
|
|
|
++merge_type_maps_y;
|
2009-01-14 07:16:18 -08:00
|
|
|
return [merge_type_maps_x,merge_type_maps_y].join(",");
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
merge_type_maps.expected = "50,25";
|
|
|
|
test(merge_type_maps)
|
|
|
|
|
|
|
|
function inner_double_outer_int() {
|
2009-01-14 07:16:18 -08:00
|
|
|
function f(i) {
|
|
|
|
for (var m = 0; m < 20; ++m)
|
2008-09-17 03:41:19 -07:00
|
|
|
for (var n = 0; n < 100; n += i)
|
2009-01-14 07:16:18 -08:00
|
|
|
;
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
return f(.5);
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
inner_double_outer_int.expected = 100;
|
2008-09-17 03:41:19 -07:00
|
|
|
test(inner_double_outer_int);
|
|
|
|
|
|
|
|
function newArrayTest()
|
|
|
|
{
|
|
|
|
var a = [];
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
a[i] = new Array();
|
|
|
|
return a.map(function(x) x.length).toString();
|
|
|
|
}
|
|
|
|
newArrayTest.expected="0,0,0,0,0,0,0,0,0,0";
|
|
|
|
test(newArrayTest);
|
|
|
|
|
|
|
|
function stringSplitTest()
|
|
|
|
{
|
|
|
|
var s = "a,b"
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = null;
|
2008-09-17 03:41:19 -07:00
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
a = s.split(",");
|
|
|
|
return a.join();
|
|
|
|
}
|
|
|
|
stringSplitTest.expected="a,b";
|
|
|
|
test(stringSplitTest);
|
|
|
|
|
|
|
|
function stringSplitIntoArrayTest()
|
|
|
|
{
|
|
|
|
var s = "a,b"
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [];
|
2008-09-17 03:41:19 -07:00
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
a[i] = s.split(",");
|
|
|
|
return a.join();
|
|
|
|
}
|
|
|
|
stringSplitIntoArrayTest.expected="a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b";
|
|
|
|
test(stringSplitIntoArrayTest);
|
|
|
|
|
|
|
|
function forVarInWith() {
|
2009-01-14 07:16:18 -08:00
|
|
|
function foo() ({notk:42});
|
|
|
|
function bar() ({p:1, q:2, r:3, s:4, t:5});
|
|
|
|
var o = foo();
|
|
|
|
var a = [];
|
|
|
|
with (o) {
|
|
|
|
for (var k in bar())
|
|
|
|
a[a.length] = k;
|
|
|
|
}
|
|
|
|
return a.join("");
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
forVarInWith.expected = "pqrst";
|
|
|
|
test(forVarInWith);
|
|
|
|
|
|
|
|
function inObjectTest() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var o = {p: 1, q: 2, r: 3, s: 4, t: 5};
|
|
|
|
var r = 0;
|
|
|
|
for (var i in o) {
|
|
|
|
if (!(i in o))
|
|
|
|
break;
|
|
|
|
if ((i + i) in o)
|
|
|
|
break;
|
|
|
|
++r;
|
|
|
|
}
|
|
|
|
return r;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
inObjectTest.expected = 5;
|
|
|
|
test(inObjectTest);
|
|
|
|
|
|
|
|
function inArrayTest() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
|
|
for (var i = 0; i < a.length; i++) {
|
|
|
|
if (!(i in a))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return i;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
inArrayTest.expected = 10;
|
|
|
|
test(inArrayTest);
|
|
|
|
|
|
|
|
function innerLoopIntOuterDouble() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var n = 10000, i=0, j=0, count=0, limit=0;
|
|
|
|
for (i = 1; i <= n; ++i) {
|
|
|
|
limit = i * 1;
|
|
|
|
for (j = 0; j < limit; ++j) {
|
2008-09-17 03:41:19 -07:00
|
|
|
++count;
|
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
|
|
|
return "" + count;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
innerLoopIntOuterDouble.expected="50005000";
|
|
|
|
test(innerLoopIntOuterDouble);
|
|
|
|
|
|
|
|
function outerline(){
|
2009-01-14 07:16:18 -08:00
|
|
|
var i=0;
|
|
|
|
var j=0;
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
for (i = 3; i<= 100000; i+=2)
|
|
|
|
{
|
|
|
|
for (j = 3; j < 1000; j+=2)
|
|
|
|
{
|
2008-09-17 03:41:19 -07:00
|
|
|
if ((i & 1) == 1)
|
2009-01-14 07:16:18 -08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "ok";
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
outerline.expected="ok";
|
|
|
|
test(outerline);
|
|
|
|
|
|
|
|
function addAccumulations(f) {
|
|
|
|
var a = f();
|
|
|
|
var b = f();
|
|
|
|
return a() + b();
|
|
|
|
}
|
|
|
|
|
|
|
|
function loopingAccumulator() {
|
|
|
|
var x = 0;
|
|
|
|
return function () {
|
|
|
|
for (var i = 0; i < 10; ++i) {
|
|
|
|
++x;
|
|
|
|
}
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function testLoopingAccumulator() {
|
|
|
|
var x = addAccumulations(loopingAccumulator);
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
testLoopingAccumulator.expected = 20;
|
|
|
|
test(testLoopingAccumulator);
|
|
|
|
|
|
|
|
function testBranchingLoop() {
|
|
|
|
var x = 0;
|
|
|
|
for (var i=0; i < 100; ++i) {
|
|
|
|
if (i == 51) {
|
|
|
|
x += 10;
|
|
|
|
}
|
|
|
|
x++;
|
|
|
|
}
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
testBranchingLoop.expected = 110;
|
|
|
|
test(testBranchingLoop);
|
|
|
|
|
|
|
|
function testBranchingUnstableLoop() {
|
|
|
|
var x = 0;
|
|
|
|
for (var i=0; i < 100; ++i) {
|
|
|
|
if (i == 51) {
|
|
|
|
x += 10.1;
|
|
|
|
}
|
|
|
|
x++;
|
|
|
|
}
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
testBranchingUnstableLoop.expected = 110.1;
|
|
|
|
test(testBranchingUnstableLoop);
|
|
|
|
|
|
|
|
function testBranchingUnstableLoopCounter() {
|
|
|
|
var x = 0;
|
|
|
|
for (var i=0; i < 100; ++i) {
|
|
|
|
if (i == 51) {
|
|
|
|
i += 1.1;
|
|
|
|
}
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
x++;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
testBranchingUnstableLoopCounter.expected = 99;
|
|
|
|
test(testBranchingUnstableLoopCounter);
|
|
|
|
|
|
|
|
|
|
|
|
function testBranchingUnstableObject() {
|
|
|
|
var x = {s: "a"};
|
|
|
|
var t = "";
|
|
|
|
for (var i=0; i < 100; ++i) {
|
2009-01-14 07:16:18 -08:00
|
|
|
if (i == 51)
|
|
|
|
{
|
|
|
|
x.s = 5;
|
|
|
|
}
|
|
|
|
t += x.s;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
return t.length;
|
|
|
|
}
|
|
|
|
testBranchingUnstableObject.expected = 100;
|
|
|
|
test(testBranchingUnstableObject);
|
|
|
|
|
|
|
|
function testArrayDensityChange() {
|
|
|
|
var x = [];
|
|
|
|
var count = 0;
|
|
|
|
for (var i=0; i < 100; ++i) {
|
|
|
|
x[i] = "asdf";
|
|
|
|
}
|
|
|
|
for (var i=0; i < x.length; ++i) {
|
2009-01-14 07:16:18 -08:00
|
|
|
if (i == 51)
|
|
|
|
{
|
|
|
|
x[199] = "asdf";
|
|
|
|
}
|
|
|
|
if (x[i])
|
|
|
|
count += x[i].length;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
testArrayDensityChange.expected = 404;
|
|
|
|
test(testArrayDensityChange);
|
|
|
|
|
|
|
|
function testDoubleToStr() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = 0.0;
|
|
|
|
var y = 5.5;
|
|
|
|
for (var i = 0; i < 200; i++) {
|
|
|
|
x += parseFloat(y.toString());
|
|
|
|
}
|
|
|
|
return x;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testDoubleToStr.expected = 5.5*200;
|
|
|
|
test(testDoubleToStr);
|
|
|
|
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
function testNumberToString() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = new Number(0);
|
|
|
|
for (var i = 0; i < 4; i++)
|
|
|
|
x.toString();
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
test(testNumberToString);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function testDecayingInnerLoop() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var i, j, k = 10;
|
|
|
|
for (i = 0; i < 5000; ++i) {
|
|
|
|
for (j = 0; j < k; ++j);
|
|
|
|
--k;
|
|
|
|
}
|
|
|
|
return i;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testDecayingInnerLoop.expected = 5000;
|
|
|
|
test(testDecayingInnerLoop);
|
|
|
|
|
|
|
|
function testContinue() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var i;
|
|
|
|
var total = 0;
|
|
|
|
for (i = 0; i < 20; ++i) {
|
|
|
|
if (i == 11)
|
2008-09-17 03:41:19 -07:00
|
|
|
continue;
|
2009-01-14 07:16:18 -08:00
|
|
|
total++;
|
|
|
|
}
|
|
|
|
return total;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testContinue.expected = 19;
|
|
|
|
test(testContinue);
|
|
|
|
|
|
|
|
function testContinueWithLabel() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var i = 0;
|
|
|
|
var j = 20;
|
|
|
|
checkiandj :
|
|
|
|
while (i<10) {
|
|
|
|
i+=1;
|
2008-09-17 03:41:19 -07:00
|
|
|
checkj :
|
2009-01-14 07:16:18 -08:00
|
|
|
while (j>10) {
|
2008-09-17 03:41:19 -07:00
|
|
|
j-=1;
|
|
|
|
if ((j%2)==0)
|
2009-01-14 07:16:18 -08:00
|
|
|
continue checkj;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
|
|
|
return i + j;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testContinueWithLabel.expected = 20;
|
|
|
|
test(testContinueWithLabel);
|
|
|
|
|
|
|
|
function testDivision() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = 32768;
|
|
|
|
var b;
|
|
|
|
while (b !== 1) {
|
|
|
|
b = a / 2;
|
|
|
|
a = b;
|
|
|
|
}
|
|
|
|
return a;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testDivision.expected = 1;
|
|
|
|
test(testDivision);
|
|
|
|
|
|
|
|
function testDivisionFloat() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = 32768.0;
|
|
|
|
var b;
|
|
|
|
while (b !== 1) {
|
|
|
|
b = a / 2.0;
|
|
|
|
a = b;
|
|
|
|
}
|
|
|
|
return a === 1.0;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testDivisionFloat.expected = true;
|
|
|
|
test(testDivisionFloat);
|
|
|
|
|
|
|
|
function testToUpperToLower() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var s = "Hello", s1, s2;
|
|
|
|
for (i = 0; i < 100; ++i) {
|
|
|
|
s1 = s.toLowerCase();
|
|
|
|
s2 = s.toUpperCase();
|
|
|
|
}
|
|
|
|
return s1 + s2;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testToUpperToLower.expected = "helloHELLO";
|
|
|
|
test(testToUpperToLower);
|
|
|
|
|
|
|
|
function testReplace2() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var s = "H e l l o", s1;
|
|
|
|
for (i = 0; i < 100; ++i)
|
|
|
|
s1 = s.replace(" ", "");
|
|
|
|
return s1;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testReplace2.expected = "He l l o";
|
|
|
|
test(testReplace2);
|
|
|
|
|
|
|
|
function testBitwise() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = 10000;
|
|
|
|
var y = 123456;
|
|
|
|
var z = 987234;
|
|
|
|
for (var i = 0; i < 50; i++) {
|
|
|
|
x = x ^ y;
|
|
|
|
y = y | z;
|
|
|
|
z = ~x;
|
|
|
|
}
|
|
|
|
return x + y + z;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testBitwise.expected = -1298;
|
|
|
|
test(testBitwise);
|
|
|
|
|
|
|
|
function testSwitch() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = 0;
|
|
|
|
var ret = 0;
|
|
|
|
for (var i = 0; i < 100; ++i) {
|
|
|
|
switch (x) {
|
|
|
|
case 0:
|
|
|
|
ret += 1;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
ret += 2;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
ret += 3;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
ret += 4;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
x = 0;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
x++;
|
|
|
|
}
|
|
|
|
return ret;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testSwitch.expected = 226;
|
|
|
|
test(testSwitch);
|
|
|
|
|
|
|
|
function testSwitchString() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = "asdf";
|
|
|
|
var ret = 0;
|
|
|
|
for (var i = 0; i < 100; ++i) {
|
|
|
|
switch (x) {
|
|
|
|
case "asdf":
|
|
|
|
x = "asd";
|
|
|
|
ret += 1;
|
|
|
|
break;
|
|
|
|
case "asd":
|
|
|
|
x = "as";
|
|
|
|
ret += 2;
|
|
|
|
break;
|
|
|
|
case "as":
|
|
|
|
x = "a";
|
|
|
|
ret += 3;
|
|
|
|
break;
|
|
|
|
case "a":
|
|
|
|
x = "foo";
|
|
|
|
ret += 4;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
x = "asdf";
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
|
|
|
return ret;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testSwitchString.expected = 200;
|
|
|
|
test(testSwitchString);
|
|
|
|
|
|
|
|
function testNegZero1Helper(z) {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (let j = 0; j < 5; ++j) { z = -z; }
|
|
|
|
return Math.atan2(0, -0) == Math.atan2(0, z);
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
var testNegZero1 = function() { return testNegZero1Helper(0); }
|
2009-01-14 07:16:18 -08:00
|
|
|
testNegZero1.expected = true;
|
2008-09-17 03:41:19 -07:00
|
|
|
testNegZero1.name = 'testNegZero1';
|
|
|
|
testNegZero1Helper(1);
|
|
|
|
test(testNegZero1);
|
|
|
|
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
// No test case, just make sure this doesn't assert.
|
2008-09-17 03:41:19 -07:00
|
|
|
function testNegZero2() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var z = 0;
|
|
|
|
for (let j = 0; j < 5; ++j) { ({p: (-z)}); }
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testNegZero2();
|
|
|
|
|
|
|
|
function testConstSwitch() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x;
|
|
|
|
for (var j=0;j<5;++j) { switch(1.1) { case NaN: case 2: } x = 2; }
|
|
|
|
return x;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testConstSwitch.expected = 2;
|
|
|
|
test(testConstSwitch);
|
|
|
|
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
function testConstSwitch2() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x;
|
|
|
|
for (var j = 0; j < 4; ++j) { switch(0/0) { } }
|
|
|
|
return "ok";
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testConstSwitch2.expected = "ok";
|
|
|
|
test(testConstSwitch2);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
function testConstIf() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x;
|
|
|
|
for (var j=0;j<5;++j) { if (1.1 || 5) { } x = 2;}
|
|
|
|
return x;
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testConstIf.expected = 2;
|
|
|
|
test(testConstIf);
|
|
|
|
|
|
|
|
function testTypeofHole() {
|
|
|
|
var a = new Array(6);
|
|
|
|
a[5] = 3;
|
|
|
|
for (var i = 0; i < 6; ++i)
|
|
|
|
a[i] = typeof a[i];
|
|
|
|
return a.join(",");
|
|
|
|
}
|
|
|
|
testTypeofHole.expected = "undefined,undefined,undefined,undefined,undefined,number"
|
2009-01-14 07:16:18 -08:00
|
|
|
test(testTypeofHole);
|
2008-09-17 03:41:19 -07:00
|
|
|
|
|
|
|
function testNativeLog() {
|
|
|
|
var a = new Array(5);
|
|
|
|
for (var i = 0; i < 5; i++) {
|
|
|
|
a[i] = Math.log(Math.pow(Math.E, 10));
|
|
|
|
}
|
|
|
|
return a.join(",");
|
|
|
|
}
|
|
|
|
testNativeLog.expected = "10,10,10,10,10";
|
|
|
|
test(testNativeLog);
|
|
|
|
|
|
|
|
function test_JSOP_ARGSUB() {
|
2009-01-14 07:16:18 -08:00
|
|
|
function f0() { return arguments[0]; }
|
|
|
|
function f1() { return arguments[1]; }
|
|
|
|
function f2() { return arguments[2]; }
|
|
|
|
function f3() { return arguments[3]; }
|
|
|
|
function f4() { return arguments[4]; }
|
|
|
|
function f5() { return arguments[5]; }
|
|
|
|
function f6() { return arguments[6]; }
|
|
|
|
function f7() { return arguments[7]; }
|
|
|
|
function f8() { return arguments[8]; }
|
|
|
|
function f9() { return arguments[9]; }
|
|
|
|
var a = [];
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
a[0] = f0('a');
|
|
|
|
a[1] = f1('a','b');
|
|
|
|
a[2] = f2('a','b','c');
|
|
|
|
a[3] = f3('a','b','c','d');
|
|
|
|
a[4] = f4('a','b','c','d','e');
|
|
|
|
a[5] = f5('a','b','c','d','e','f');
|
|
|
|
a[6] = f6('a','b','c','d','e','f','g');
|
|
|
|
a[7] = f7('a','b','c','d','e','f','g','h');
|
|
|
|
a[8] = f8('a','b','c','d','e','f','g','h','i');
|
|
|
|
a[9] = f9('a','b','c','d','e','f','g','h','i','j');
|
|
|
|
}
|
|
|
|
return a.join("");
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
test_JSOP_ARGSUB.expected = "abcdefghij";
|
|
|
|
test(test_JSOP_ARGSUB);
|
|
|
|
|
|
|
|
function test_JSOP_ARGCNT() {
|
2009-01-14 07:16:18 -08:00
|
|
|
function f0() { return arguments.length; }
|
|
|
|
function f1() { return arguments.length; }
|
|
|
|
function f2() { return arguments.length; }
|
|
|
|
function f3() { return arguments.length; }
|
|
|
|
function f4() { return arguments.length; }
|
|
|
|
function f5() { return arguments.length; }
|
|
|
|
function f6() { return arguments.length; }
|
|
|
|
function f7() { return arguments.length; }
|
|
|
|
function f8() { return arguments.length; }
|
|
|
|
function f9() { return arguments.length; }
|
|
|
|
var a = [];
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
a[0] = f0('a');
|
|
|
|
a[1] = f1('a','b');
|
|
|
|
a[2] = f2('a','b','c');
|
|
|
|
a[3] = f3('a','b','c','d');
|
|
|
|
a[4] = f4('a','b','c','d','e');
|
|
|
|
a[5] = f5('a','b','c','d','e','f');
|
|
|
|
a[6] = f6('a','b','c','d','e','f','g');
|
|
|
|
a[7] = f7('a','b','c','d','e','f','g','h');
|
|
|
|
a[8] = f8('a','b','c','d','e','f','g','h','i');
|
|
|
|
a[9] = f9('a','b','c','d','e','f','g','h','i','j');
|
|
|
|
}
|
|
|
|
return a.join(",");
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
test_JSOP_ARGCNT.expected = "1,2,3,4,5,6,7,8,9,10";
|
|
|
|
test(test_JSOP_ARGCNT);
|
|
|
|
|
|
|
|
function testNativeMax() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var out = [], k;
|
|
|
|
for (var i = 0; i < 5; ++i) {
|
|
|
|
k = Math.max(k, i);
|
|
|
|
}
|
|
|
|
out.push(k);
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
k = 0;
|
|
|
|
for (var i = 0; i < 5; ++i) {
|
|
|
|
k = Math.max(k, i);
|
|
|
|
}
|
|
|
|
out.push(k);
|
2008-09-17 03:41:19 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var i = 0; i < 5; ++i) {
|
|
|
|
k = Math.max(0, -0);
|
|
|
|
}
|
|
|
|
out.push((1 / k) < 0);
|
|
|
|
return out.join(",");
|
2008-09-17 03:41:19 -07:00
|
|
|
}
|
|
|
|
testNativeMax.expected = "NaN,4,false";
|
|
|
|
test(testNativeMax);
|
|
|
|
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
function testFloatArrayIndex() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [];
|
|
|
|
for (var i = 0; i < 10; ++i) {
|
|
|
|
a[3] = 5;
|
|
|
|
a[3.5] = 7;
|
|
|
|
}
|
|
|
|
return a[3] + "," + a[3.5];
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testFloatArrayIndex.expected = "5,7";
|
|
|
|
test(testFloatArrayIndex);
|
|
|
|
|
|
|
|
function testStrict() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var n = 10, a = [];
|
|
|
|
for (var i = 0; i < 10; ++i) {
|
|
|
|
a[0] = (n === 10);
|
|
|
|
a[1] = (n !== 10);
|
|
|
|
a[2] = (n === null);
|
|
|
|
a[3] = (n == null);
|
|
|
|
}
|
|
|
|
return a.join(",");
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testStrict.expected = "true,false,false,false";
|
|
|
|
test(testStrict);
|
|
|
|
|
|
|
|
function testSetPropNeitherMissNorHit() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var j = 0; j < 5; ++j) { if (({}).__proto__ = 1) { } }
|
|
|
|
return "ok";
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testSetPropNeitherMissNorHit.expected = "ok";
|
|
|
|
test(testSetPropNeitherMissNorHit);
|
|
|
|
|
|
|
|
function testPrimitiveConstructorPrototype() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var f = function(){};
|
|
|
|
f.prototype = false;
|
|
|
|
for (let j=0;j<5;++j) { new f; }
|
|
|
|
return "ok";
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testPrimitiveConstructorPrototype.expected = "ok";
|
|
|
|
test(testPrimitiveConstructorPrototype);
|
|
|
|
|
|
|
|
function testSideExitInConstructor() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var FCKConfig = {};
|
|
|
|
FCKConfig.CoreStyles =
|
|
|
|
{
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
'Bold': { },
|
|
|
|
'Italic': { },
|
|
|
|
'FontFace': { },
|
|
|
|
'Size' :
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
Overrides: [ ]
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
'Color' :
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
Element: '',
|
|
|
|
Styles: { },
|
|
|
|
Overrides: [ ]
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
},
|
|
|
|
'BackColor': {
|
2009-01-14 07:16:18 -08:00
|
|
|
Element : '',
|
|
|
|
Styles : { 'background-color' : '' }
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
};
|
2009-01-14 07:16:18 -08:00
|
|
|
var FCKStyle = function(A) {
|
|
|
|
A.Element;
|
|
|
|
};
|
|
|
|
|
|
|
|
var pass = true;
|
|
|
|
for (var s in FCKConfig.CoreStyles) {
|
|
|
|
var x = new FCKStyle(FCKConfig.CoreStyles[s]);
|
|
|
|
if (!x)
|
|
|
|
pass = false;
|
|
|
|
}
|
|
|
|
return pass;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testSideExitInConstructor.expected = true;
|
|
|
|
test(testSideExitInConstructor);
|
|
|
|
|
|
|
|
function testNot() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = new Object(), b = null, c = "foo", d = "", e = 5, f = 0, g = 5.5, h = -0, i = true, j = false, k = undefined;
|
|
|
|
var r;
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
r = [!a, !b, !c, !d, !e, !f, !g, !h, !i, !j, !k];
|
|
|
|
return r.join(",");
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testNot.expected = "false,true,false,true,false,true,false,true,false,true,true";
|
|
|
|
test(testNot);
|
|
|
|
|
|
|
|
function doTestDifferingArgc(a, b)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var k = 0;
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
k += i;
|
|
|
|
}
|
|
|
|
return k;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
function testDifferingArgc()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = 0;
|
|
|
|
x += doTestDifferingArgc(1, 2);
|
|
|
|
x += doTestDifferingArgc(1);
|
|
|
|
x += doTestDifferingArgc(1, 2, 3);
|
|
|
|
return x;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testDifferingArgc.expected = 45*3;
|
|
|
|
test(testDifferingArgc);
|
|
|
|
|
|
|
|
function doTestMoreArgcThanNargs()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = 0;
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
x = x + arguments[3];
|
|
|
|
}
|
|
|
|
return x;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
function testMoreArgcThanNargs()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
return doTestMoreArgcThanNargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testMoreArgcThanNargs.expected = 4*10;
|
|
|
|
test(testMoreArgcThanNargs);
|
|
|
|
|
|
|
|
// Test stack reconstruction after a nested exit
|
|
|
|
function testNestedExitStackInner(j, counter) {
|
|
|
|
++counter;
|
|
|
|
var b = 0;
|
|
|
|
for (var i = 1; i <= RUNLOOP; i++) {
|
|
|
|
++b;
|
|
|
|
var a;
|
|
|
|
// Make sure that once everything has been traced we suddenly switch to
|
|
|
|
// a different control flow the first time we run the outermost tree,
|
|
|
|
// triggering a side exit.
|
|
|
|
if (j < RUNLOOP)
|
|
|
|
a = 1;
|
|
|
|
else
|
|
|
|
a = 0;
|
|
|
|
++b;
|
|
|
|
b += a;
|
|
|
|
}
|
|
|
|
return counter + b;
|
|
|
|
}
|
|
|
|
function testNestedExitStackOuter() {
|
|
|
|
var counter = 0;
|
|
|
|
for (var j = 1; j <= RUNLOOP; ++j) {
|
|
|
|
for (var k = 1; k <= RUNLOOP; ++k) {
|
|
|
|
counter = testNestedExitStackInner(j, counter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return counter;
|
|
|
|
}
|
|
|
|
testNestedExitStackOuter.expected = 81;
|
|
|
|
testNestedExitStackOuter.jitstats = {
|
2009-01-14 07:16:18 -08:00
|
|
|
recorderStarted: 5,
|
|
|
|
recorderAborted: 2,
|
|
|
|
traceTriggered: 9
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
};
|
|
|
|
test(testNestedExitStackOuter);
|
|
|
|
|
|
|
|
function testHOTLOOPSize() {
|
2009-01-14 07:16:18 -08:00
|
|
|
return HOTLOOP > 1;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testHOTLOOPSize.expected = true;
|
|
|
|
test(testHOTLOOPSize);
|
|
|
|
|
|
|
|
function testMatchStringObject() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = new String("foo");
|
|
|
|
var b;
|
|
|
|
for (i = 0; i < 300; i++)
|
|
|
|
b = a.match(/bar/);
|
|
|
|
return b;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testMatchStringObject.expected = null;
|
|
|
|
test(testMatchStringObject);
|
|
|
|
|
|
|
|
function innerSwitch(k)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var m = 0;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
switch (k)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
m = 1;
|
|
|
|
break;
|
|
|
|
}
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
return m;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
function testInnerSwitchBreak()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var r = new Array(5);
|
|
|
|
for (var i = 0; i < 5; i++)
|
|
|
|
{
|
|
|
|
r[i] = innerSwitch(0);
|
|
|
|
}
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
return r.join(",");
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testInnerSwitchBreak.expected = "1,1,1,1,1";
|
|
|
|
test(testInnerSwitchBreak);
|
|
|
|
|
|
|
|
function testArrayNaNIndex()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var j = 0; j < 4; ++j) { [this[NaN]]; }
|
|
|
|
for (var j = 0; j < 5; ++j) { if([1][-0]) { } }
|
|
|
|
return "ok";
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testArrayNaNIndex.expected = "ok";
|
|
|
|
test(testArrayNaNIndex);
|
|
|
|
|
|
|
|
function innerTestInnerMissingArgs(a,b,c,d)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
if (a) {
|
|
|
|
} else {
|
|
|
|
}
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
function doTestInnerMissingArgs(k)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
for (i = 0; i < 10; i++) {
|
|
|
|
innerTestInnerMissingArgs(k);
|
|
|
|
}
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
function testInnerMissingArgs()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
doTestInnerMissingArgs(1);
|
|
|
|
doTestInnerMissingArgs(0);
|
|
|
|
return 1;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testInnerMissingArgs.expected = 1; //Expected: that we don't crash.
|
|
|
|
test(testInnerMissingArgs);
|
|
|
|
|
|
|
|
function regexpLastIndex()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var n = 0;
|
|
|
|
var re = /hi/g;
|
|
|
|
var ss = " hi hi hi hi hi hi hi hi hi hi";
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
// re.exec(ss);
|
|
|
|
n += (re.lastIndex > 0) ? 3 : 0;
|
|
|
|
re.lastIndex = 0;
|
|
|
|
}
|
|
|
|
return n;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
regexpLastIndex.expected = 0; // 30;
|
|
|
|
test(regexpLastIndex);
|
|
|
|
|
|
|
|
function testHOTLOOPCorrectness() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var b = 0;
|
|
|
|
for (var i = 0; i < HOTLOOP; ++i)
|
|
|
|
++b;
|
|
|
|
return b;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testHOTLOOPCorrectness.expected = HOTLOOP;
|
|
|
|
testHOTLOOPCorrectness.jitstats = {
|
2009-01-14 07:16:18 -08:00
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
traceTriggered: 0
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
};
|
|
|
|
// Change the global shape right before doing the test
|
|
|
|
this.testHOTLOOPCorrectnessVar = 1;
|
|
|
|
test(testHOTLOOPCorrectness);
|
|
|
|
|
|
|
|
function testRUNLOOPCorrectness() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var b = 0;
|
|
|
|
for (var i = 0; i < RUNLOOP; ++i) {
|
|
|
|
++b;
|
|
|
|
}
|
|
|
|
return b;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testRUNLOOPCorrectness.expected = RUNLOOP;
|
|
|
|
testRUNLOOPCorrectness.jitstats = {
|
2009-01-14 07:16:18 -08:00
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
traceTriggered: 1
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
};
|
|
|
|
// Change the global shape right before doing the test
|
|
|
|
this.testRUNLOOPCorrectnessVar = 1;
|
|
|
|
test(testRUNLOOPCorrectness);
|
|
|
|
|
|
|
|
function testDateNow() {
|
2009-01-14 07:16:18 -08:00
|
|
|
// Accessing global.Date for the first time will change the global shape,
|
|
|
|
// so do it before the loop starts; otherwise we have to loop an extra time
|
|
|
|
// to pick things up.
|
|
|
|
var time = Date.now();
|
|
|
|
for (var j = 0; j < RUNLOOP; ++j)
|
|
|
|
time = Date.now();
|
|
|
|
return "ok";
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testDateNow.expected = "ok";
|
|
|
|
testDateNow.jitstats = {
|
2009-01-14 07:16:18 -08:00
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
traceTriggered: 1
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
};
|
|
|
|
test(testDateNow);
|
|
|
|
|
|
|
|
function testINITELEM()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var x;
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
x = { 0: 5, 1: 5 };
|
|
|
|
return x[0] + x[1];
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testINITELEM.expected = 10;
|
|
|
|
test(testINITELEM);
|
|
|
|
|
|
|
|
function testUndefinedBooleanCmp()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var t = true, f = false, x = [];
|
|
|
|
for (var i = 0; i < 10; ++i) {
|
|
|
|
x[0] = t == undefined;
|
|
|
|
x[1] = t != undefined;
|
|
|
|
x[2] = t === undefined;
|
|
|
|
x[3] = t !== undefined;
|
|
|
|
x[4] = t < undefined;
|
|
|
|
x[5] = t > undefined;
|
|
|
|
x[6] = t <= undefined;
|
|
|
|
x[7] = t >= undefined;
|
|
|
|
x[8] = f == undefined;
|
|
|
|
x[9] = f != undefined;
|
|
|
|
x[10] = f === undefined;
|
|
|
|
x[11] = f !== undefined;
|
|
|
|
x[12] = f < undefined;
|
|
|
|
x[13] = f > undefined;
|
|
|
|
x[14] = f <= undefined;
|
|
|
|
x[15] = f >= undefined;
|
|
|
|
}
|
|
|
|
return x.join(",");
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testUndefinedBooleanCmp.expected = "false,true,false,true,false,false,false,false,false,true,false,true,false,false,false,false";
|
|
|
|
test(testUndefinedBooleanCmp);
|
|
|
|
|
|
|
|
function testConstantBooleanExpr()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var j = 0; j < 3; ++j) { if(true <= true) { } }
|
|
|
|
return "ok";
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testConstantBooleanExpr.expected = "ok";
|
|
|
|
test(testConstantBooleanExpr);
|
|
|
|
|
|
|
|
function testNegativeGETELEMIndex()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
for (let i=0;i<3;++i) /x/[-4];
|
|
|
|
return "ok";
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testNegativeGETELEMIndex.expected = "ok";
|
|
|
|
test(testNegativeGETELEMIndex);
|
|
|
|
|
|
|
|
function doTestInvalidCharCodeAt(input)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var q = "";
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
q += input.charCodeAt(i);
|
|
|
|
return q;
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
function testInvalidCharCodeAt()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
return doTestInvalidCharCodeAt("");
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
}
|
|
|
|
testInvalidCharCodeAt.expected = "NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN";
|
|
|
|
test(testInvalidCharCodeAt);
|
|
|
|
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
function FPQuadCmp()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
for (let j = 0; j < 3; ++j) { true == 0; }
|
|
|
|
return "ok";
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
FPQuadCmp.expected = "ok";
|
|
|
|
test(FPQuadCmp);
|
|
|
|
|
|
|
|
function testDestructuring() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var t = 0;
|
|
|
|
for (var i = 0; i < HOTLOOP + 1; ++i) {
|
|
|
|
var [r, g, b] = [1, 1, 1];
|
|
|
|
t += r + g + b;
|
|
|
|
}
|
|
|
|
return t
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
testDestructuring.expected = (HOTLOOP + 1) * 3;
|
|
|
|
test(testDestructuring);
|
|
|
|
|
2008-11-27 02:29:31 -08:00
|
|
|
function loopWithUndefined1(t, val) {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = new Array(6);
|
|
|
|
for (var i = 0; i < 6; i++)
|
|
|
|
a[i] = (t > val);
|
|
|
|
return a;
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
2008-11-27 02:29:31 -08:00
|
|
|
loopWithUndefined1(5.0, 2); //compile version with val=int
|
|
|
|
|
|
|
|
function testLoopWithUndefined1() {
|
2009-01-14 07:16:18 -08:00
|
|
|
return loopWithUndefined1(5.0).join(","); //val=undefined
|
2008-11-27 02:29:31 -08:00
|
|
|
};
|
|
|
|
testLoopWithUndefined1.expected = "false,false,false,false,false,false";
|
|
|
|
test(testLoopWithUndefined1);
|
|
|
|
|
|
|
|
function loopWithUndefined2(t, dostuff, val) {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = new Array(6);
|
|
|
|
for (var i = 0; i < 6; i++) {
|
|
|
|
if (dostuff) {
|
|
|
|
val = 1;
|
|
|
|
a[i] = (t > val);
|
|
|
|
} else {
|
|
|
|
a[i] = (val == undefined);
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
|
|
|
return a;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
function testLoopWithUndefined2() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = loopWithUndefined2(5.0, true, 2);
|
|
|
|
var b = loopWithUndefined2(5.0, true);
|
|
|
|
var c = loopWithUndefined2(5.0, false, 8);
|
|
|
|
var d = loopWithUndefined2(5.0, false);
|
|
|
|
return [a[0], b[0], c[0], d[0]].join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testLoopWithUndefined2.expected = "true,true,false,true";
|
|
|
|
test(testLoopWithUndefined2);
|
|
|
|
|
|
|
|
//test no multitrees assert
|
|
|
|
function testBug462388() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var c = 0, v; for each (let x in ["",v,v,v]) { for (c=0;c<4;++c) { } }
|
|
|
|
return true;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testBug462388.expected = true;
|
|
|
|
test(testBug462388);
|
|
|
|
|
|
|
|
//test no multitrees assert
|
|
|
|
function testBug462407() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for each (let i in [0, {}, 0, 1.5, {}, 0, 1.5, 0, 0]) { }
|
|
|
|
return true;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testBug462407.expected = true;
|
|
|
|
test(testBug462407);
|
|
|
|
|
|
|
|
//test no multitrees assert
|
|
|
|
function testBug463490() {
|
2009-01-14 07:16:18 -08:00
|
|
|
function f(a, b, d) {
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
if (d)
|
|
|
|
b /= 2;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
return a + b;
|
|
|
|
}
|
|
|
|
//integer stable loop
|
|
|
|
f(2, 2, false);
|
|
|
|
//double stable loop
|
|
|
|
f(3, 4.5, false);
|
|
|
|
//integer unstable branch
|
|
|
|
f(2, 2, true);
|
|
|
|
return true;
|
2008-11-27 02:29:31 -08:00
|
|
|
};
|
|
|
|
testBug463490.expected = true;
|
|
|
|
test(testBug463490);
|
|
|
|
|
|
|
|
// Test no assert (bug 464089)
|
|
|
|
function shortRecursiveLoop(b, c) {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var i = 0; i < c; i++) {
|
|
|
|
if (b)
|
|
|
|
shortRecursiveLoop(c - 1);
|
|
|
|
}
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
function testClosingRecursion() {
|
2009-01-14 07:16:18 -08:00
|
|
|
shortRecursiveLoop(false, 1);
|
|
|
|
shortRecursiveLoop(true, 3);
|
|
|
|
return true;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testClosingRecursion.expected = true;
|
|
|
|
test(testClosingRecursion);
|
|
|
|
|
|
|
|
// Test no assert or crash from outer recorders (bug 465145)
|
|
|
|
function testBug465145() {
|
|
|
|
this.__defineSetter__("x", function(){});
|
|
|
|
this.watch("x", function(){});
|
|
|
|
y = this;
|
|
|
|
for (var z = 0; z < 2; ++z) { x = y };
|
|
|
|
this.__defineSetter__("x", function(){});
|
|
|
|
for (var z = 0; z < 2; ++z) { x = y };
|
|
|
|
}
|
|
|
|
|
|
|
|
function testTrueShiftTrue() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = new Array(5);
|
|
|
|
for (var i=0;i<5;++i) a[i] = "" + (true << true);
|
|
|
|
return a.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testTrueShiftTrue.expected = "2,2,2,2,2";
|
|
|
|
test(testTrueShiftTrue);
|
|
|
|
|
|
|
|
// Test no assert or crash
|
|
|
|
function testBug465261() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (let z = 0; z < 2; ++z) { for each (let x in [0, true, (void 0), 0, (void
|
|
|
|
0)]) { if(x){} } };
|
|
|
|
return true;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testBug465261.expected = true;
|
|
|
|
test(testBug465261);
|
|
|
|
|
|
|
|
function testBug465272() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = new Array(5);
|
|
|
|
for (j=0;j<5;++j) a[j] = "" + ((5) - 2);
|
|
|
|
return a.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testBug465272.expected = "3,3,3,3,3"
|
2009-01-14 07:16:18 -08:00
|
|
|
test(testBug465272);
|
2008-11-27 02:29:31 -08:00
|
|
|
|
|
|
|
function testBug465483() {
|
|
|
|
var a = new Array(4);
|
|
|
|
var c = 0;
|
|
|
|
for each (i in [4, 'a', 'b', (void 0)]) a[c++] = '' + (i + i);
|
|
|
|
return a.join(',');
|
|
|
|
}
|
|
|
|
testBug465483.expected = '8,aa,bb,NaN';
|
|
|
|
test(testBug465483);
|
|
|
|
|
|
|
|
function testNullCallee() {
|
2009-01-14 07:16:18 -08:00
|
|
|
try {
|
|
|
|
function f() {
|
|
|
|
var x = new Array(5);
|
|
|
|
for (var i = 0; i < 5; i++)
|
|
|
|
x[i] = a[i].toString();
|
|
|
|
return x.join(',');
|
|
|
|
}
|
|
|
|
f([[1],[2],[3],[4],[5]]);
|
|
|
|
f([null, null, null, null, null]);
|
|
|
|
} catch (e) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testNullCallee.expected = true;
|
|
|
|
test(testNullCallee);
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
//test no multitrees assert
|
|
|
|
function testBug466128() {
|
|
|
|
for (let a = 0; a < 3; ++a) {
|
|
|
|
for each (let b in [1, 2, "three", 4, 5, 6, 7, 8]) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
testBug466128.expected = true;
|
|
|
|
test(testBug466128);
|
|
|
|
|
|
|
|
//test no assert
|
|
|
|
function testBug465688() {
|
|
|
|
for each (let d in [-0x80000000, -0x80000000]) - -d;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
testBug465688.expected = true;
|
|
|
|
test(testBug465688);
|
|
|
|
|
|
|
|
//test no assert
|
|
|
|
function testBug466262() {
|
|
|
|
var e = 1;
|
|
|
|
for (var d = 0; d < 3; ++d) {
|
|
|
|
if (d == 2) {
|
|
|
|
e = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
testBug466262.expected = true;
|
|
|
|
test(testBug466262);
|
|
|
|
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
function testNewDate()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
// Accessing global.Date for the first time will change the global shape,
|
|
|
|
// so do it before the loop starts; otherwise we have to loop an extra time
|
|
|
|
// to pick things up.
|
|
|
|
var start = new Date();
|
|
|
|
var time = new Date();
|
|
|
|
for (var j = 0; j < RUNLOOP; ++j)
|
|
|
|
time = new Date();
|
|
|
|
return time > 0 && time >= start;
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
testNewDate.expected = true;
|
|
|
|
testNewDate.jitstats = {
|
2009-01-14 07:16:18 -08:00
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
traceTriggered: 1
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
};
|
|
|
|
test(testNewDate);
|
|
|
|
|
|
|
|
function testArrayPushPop() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [], sum1 = 0, sum2 = 0;
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
sum1 += a.push(i);
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
sum2 += a.pop();
|
|
|
|
a.push(sum1);
|
|
|
|
a.push(sum2);
|
|
|
|
return a.join(",");
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
testArrayPushPop.expected = "55,45";
|
|
|
|
test(testArrayPushPop);
|
|
|
|
|
|
|
|
function testResumeOp() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [1,"2",3,"4",5,"6",7,"8",9,"10",11,"12",13,"14",15,"16"];
|
|
|
|
var x = "";
|
|
|
|
while (a.length > 0)
|
|
|
|
x += a.pop();
|
|
|
|
return x;
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
testResumeOp.expected = "16151413121110987654321";
|
|
|
|
test(testResumeOp);
|
|
|
|
|
|
|
|
function testUndefinedCmp() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = false;
|
|
|
|
for (var j = 0; j < 4; ++j) { if (undefined < false) { a = true; } }
|
|
|
|
return a;
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
testUndefinedCmp.expected = false;
|
|
|
|
test(testUndefinedCmp);
|
|
|
|
|
|
|
|
function reallyDeepNestedExit(schedule)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var c = 0, j = 0;
|
|
|
|
for (var i = 0; i < 5; i++) {
|
|
|
|
for (j = 0; j < 4; j++) {
|
|
|
|
c += (schedule[i*4 + j] == 1) ? 1 : 2;
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
|
|
|
return c;
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
function testReallyDeepNestedExit()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var c = 0;
|
|
|
|
var schedule1 = new Array(5*4);
|
|
|
|
var schedule2 = new Array(5*4);
|
|
|
|
for (var i = 0; i < 5*4; i++) {
|
|
|
|
schedule1[i] = 0;
|
|
|
|
schedule2[i] = 0;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* First innermost compile: true branch runs through.
|
|
|
|
* Second '': false branch compiles new loop edge.
|
|
|
|
* First outer compile: expect true branch.
|
|
|
|
* Second '': hit false branch.
|
|
|
|
*/
|
|
|
|
schedule1[0*4 + 3] = 1;
|
|
|
|
var schedules = [schedule1,
|
|
|
|
schedule2,
|
|
|
|
schedule1,
|
|
|
|
schedule2,
|
|
|
|
schedule2];
|
|
|
|
|
|
|
|
for (var i = 0; i < 5; i++) {
|
|
|
|
c += reallyDeepNestedExit(schedules[i]);
|
|
|
|
}
|
|
|
|
return c;
|
JavaScript Tests - regression tests for bug 346642, bug 349605, bug 351336, bug 351626, bug 352281, bug 354878, bug 355569, bug 359024, bug 373678, bug 417817, bug 419091, bug 444979, bug 445818, bug 446386, bug 449627, bug 450369, bug 451483, bug 451906, bug 452008, bug 452742, bug 454040, bug 456494, bug 456845, with updates for js1_8_1/trace/trace-test.js, public-failures.txt, spidermonkey-n-1.9.1.tests, universe.data
2008-10-17 14:15:06 -07:00
|
|
|
}
|
|
|
|
testReallyDeepNestedExit.expected = 198;
|
|
|
|
test(testReallyDeepNestedExit);
|
|
|
|
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
function testRegExpTest() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var r = /abc/;
|
|
|
|
var flag = false;
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
flag = r.test("abc");
|
|
|
|
return flag;
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
}
|
|
|
|
testRegExpTest.expected = true;
|
|
|
|
test(testRegExpTest);
|
|
|
|
|
|
|
|
function testNumToString() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var r = [];
|
|
|
|
var d = 123456789;
|
|
|
|
for (var i = 0; i < 10; ++i) {
|
|
|
|
r = [
|
|
|
|
d.toString(),
|
|
|
|
(-d).toString(),
|
|
|
|
d.toString(10),
|
|
|
|
(-d).toString(10),
|
|
|
|
d.toString(16),
|
|
|
|
(-d).toString(16),
|
|
|
|
d.toString(36),
|
|
|
|
(-d).toString(36)
|
|
|
|
];
|
|
|
|
}
|
|
|
|
return r.join(",");
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
}
|
|
|
|
testNumToString.expected = "123456789,-123456789,123456789,-123456789,75bcd15,-75bcd15,21i3v9,-21i3v9";
|
|
|
|
test(testNumToString);
|
|
|
|
|
|
|
|
function testSubstring() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var i = 0; i < 5; ++i) {
|
|
|
|
actual = "".substring(5);
|
|
|
|
}
|
|
|
|
return actual;
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
}
|
|
|
|
testSubstring.expected = "";
|
|
|
|
test(testSubstring);
|
|
|
|
|
|
|
|
function testForInLoopChangeIteratorType() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for(y in [0,1,2]) y = NaN;
|
|
|
|
(function(){
|
|
|
|
[].__proto__.u = void 0;
|
|
|
|
for (let y in [5,6,7,8])
|
|
|
|
y = NaN;
|
|
|
|
delete [].__proto__.u;
|
|
|
|
})()
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
return "ok";
|
|
|
|
}
|
|
|
|
testForInLoopChangeIteratorType.expected = "ok";
|
|
|
|
test(testForInLoopChangeIteratorType);
|
|
|
|
|
|
|
|
function testGrowDenseArray() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = new Array();
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
a[i] |= 5;
|
|
|
|
return a.join(",");
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
}
|
|
|
|
testGrowDenseArray.expected = "5,5,5,5,5,5,5,5,5,5";
|
|
|
|
test(testGrowDenseArray);
|
|
|
|
|
|
|
|
function testCallProtoMethod() {
|
2009-01-14 07:16:18 -08:00
|
|
|
function X() { this.x = 1; }
|
|
|
|
X.prototype.getName = function () { return "X"; }
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
function Y() { this.x = 2; }
|
|
|
|
Y.prototype.getName = function() "Y";
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [new X, new X, new X, new X, new Y];
|
|
|
|
var s = '';
|
|
|
|
for (var i = 0; i < a.length; i++)
|
|
|
|
s += a[i].getName();
|
|
|
|
return s;
|
JavaScript Tests - tests for bugs 461233, 458851, 459628, 460024, 460117, 461307, 461723, 462292, 462989, 463259, 460501, 461108, 461111, 461235, 461945, 462071, 462282, 462288, 462407, updated js1_8_1/trace/trace-test.js, updated failures
2008-11-11 13:08:13 -08:00
|
|
|
}
|
|
|
|
testCallProtoMethod.expected = 'XXXXY';
|
|
|
|
test(testCallProtoMethod);
|
|
|
|
|
2008-11-27 02:29:31 -08:00
|
|
|
function testTypeUnstableForIn() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
|
|
|
|
var x = 0;
|
|
|
|
for (var i in a) {
|
|
|
|
i = parseInt(i);
|
|
|
|
x++;
|
|
|
|
}
|
|
|
|
return x;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testTypeUnstableForIn.expected = 16;
|
|
|
|
test(testTypeUnstableForIn);
|
|
|
|
|
|
|
|
function testAddUndefined() {
|
2009-01-14 07:16:18 -08:00
|
|
|
for (var j = 0; j < 3; ++j)
|
|
|
|
(0 + void 0) && 0;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
test(testAddUndefined);
|
|
|
|
|
|
|
|
function testStringify() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var t = true, f = false, u = undefined, n = 5, d = 5.5, s = "x";
|
|
|
|
var a = [];
|
|
|
|
for (var i = 0; i < 10; ++i) {
|
|
|
|
a[0] = "" + t;
|
|
|
|
a[1] = t + "";
|
|
|
|
a[2] = "" + f;
|
|
|
|
a[3] = f + "";
|
|
|
|
a[4] = "" + u;
|
|
|
|
a[5] = u + "";
|
|
|
|
a[6] = "" + n;
|
|
|
|
a[7] = n + "";
|
|
|
|
a[8] = "" + d;
|
|
|
|
a[9] = d + "";
|
|
|
|
a[10] = "" + s;
|
|
|
|
a[11] = s + "";
|
|
|
|
}
|
|
|
|
return a.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testStringify.expected = "true,true,false,false,undefined,undefined,5,5,5.5,5.5,x,x";
|
|
|
|
test(testStringify);
|
|
|
|
|
|
|
|
function testObjectToString() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var o = {toString: function()"foo"};
|
|
|
|
var s = "";
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
s += o;
|
|
|
|
return s;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testObjectToString.expected = "foofoofoofoofoofoofoofoofoofoo";
|
|
|
|
test(testObjectToString);
|
|
|
|
|
|
|
|
function testObjectToNumber() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var o = {valueOf: function()-3};
|
|
|
|
var x = 0;
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
x -= o;
|
|
|
|
return x;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testObjectToNumber.expected = 30;
|
|
|
|
test(testObjectToNumber);
|
|
|
|
|
|
|
|
function my_iterator_next() {
|
2009-01-14 07:16:18 -08:00
|
|
|
if (this.i == 10) {
|
|
|
|
this.i = 0;
|
|
|
|
throw this.StopIteration;
|
|
|
|
}
|
|
|
|
return this.i++;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
function testCustomIterator() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var o = {
|
|
|
|
__iterator__: function () {
|
|
|
|
return {
|
|
|
|
i: 0,
|
|
|
|
next: my_iterator_next,
|
|
|
|
StopIteration: StopIteration
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var a=[];
|
|
|
|
for (var k = 0; k < 100; k += 10) {
|
|
|
|
for(var j in o) {
|
|
|
|
a[k + (j >> 0)] = j*k;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
|
|
|
return a.join();
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testCustomIterator.expected = "0,0,0,0,0,0,0,0,0,0,0,10,20,30,40,50,60,70,80,90,0,20,40,60,80,100,120,140,160,180,0,30,60,90,120,150,180,210,240,270,0,40,80,120,160,200,240,280,320,360,0,50,100,150,200,250,300,350,400,450,0,60,120,180,240,300,360,420,480,540,0,70,140,210,280,350,420,490,560,630,0,80,160,240,320,400,480,560,640,720,0,90,180,270,360,450,540,630,720,810";
|
|
|
|
test(testCustomIterator);
|
|
|
|
|
|
|
|
function bug464403() {
|
2009-01-14 07:16:18 -08:00
|
|
|
print(8);
|
|
|
|
var u = [print, print, function(){}]
|
2008-11-27 02:29:31 -08:00
|
|
|
for each (x in u) for (u.e in [1,1,1,1]);
|
2009-01-14 07:16:18 -08:00
|
|
|
return "ok";
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
bug464403.expected = "ok";
|
|
|
|
test(bug464403);
|
|
|
|
|
|
|
|
function testBoxDoubleWithDoubleSizedInt()
|
|
|
|
{
|
|
|
|
var i = 0;
|
|
|
|
var a = new Array(3);
|
|
|
|
|
|
|
|
while (i < a.length)
|
|
|
|
a[i++] = 0x5a827999;
|
|
|
|
return a.join(",");
|
|
|
|
}
|
|
|
|
testBoxDoubleWithDoubleSizedInt.expected = "1518500249,1518500249,1518500249";
|
|
|
|
test(testBoxDoubleWithDoubleSizedInt);
|
|
|
|
|
|
|
|
function testObjectOrderedCmp()
|
|
|
|
{
|
|
|
|
var a = new Array(5);
|
|
|
|
for(var i=0;i<5;++i) a[i] = ({} < {});
|
|
|
|
return a.join(",");
|
|
|
|
}
|
|
|
|
testObjectOrderedCmp.expected = "false,false,false,false,false";
|
|
|
|
test(testObjectOrderedCmp);
|
|
|
|
|
|
|
|
function testObjectOrderedCmp2()
|
|
|
|
{
|
|
|
|
var a = new Array(5);
|
|
|
|
for(var i=0;i<5;++i) a[i] = ("" <= null);
|
|
|
|
return a.join(",");
|
|
|
|
}
|
|
|
|
testObjectOrderedCmp2.expected = "true,true,true,true,true";
|
|
|
|
test(testObjectOrderedCmp2);
|
|
|
|
|
|
|
|
function testLogicalNotNaN() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var i = 0;
|
|
|
|
var a = new Array(5);
|
|
|
|
while (i < a.length)
|
|
|
|
a[i++] = !NaN;
|
|
|
|
return a.join();
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testLogicalNotNaN.expected = "true,true,true,true,true";
|
|
|
|
test(testLogicalNotNaN);
|
|
|
|
|
|
|
|
function testStringToInt32() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var s = "";
|
|
|
|
for (let j = 0; j < 5; ++j) s += ("1e+81" ^ 3);
|
|
|
|
return s;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testStringToInt32.expected = "33333";
|
|
|
|
test(testStringToInt32);
|
|
|
|
|
|
|
|
function testIn() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var array = [3];
|
|
|
|
var obj = { "-1": 5, "1.7": 3, "foo": 5, "1": 7 };
|
|
|
|
var a = [];
|
|
|
|
for (let j = 0; j < 5; ++j) {
|
|
|
|
a.push("0" in array);
|
|
|
|
a.push(-1 in obj);
|
|
|
|
a.push(1.7 in obj);
|
|
|
|
a.push("foo" in obj);
|
|
|
|
a.push(1 in obj);
|
|
|
|
a.push("1" in array);
|
|
|
|
a.push(-2 in obj);
|
|
|
|
a.push(2.7 in obj);
|
|
|
|
a.push("bar" in obj);
|
|
|
|
a.push(2 in obj);
|
|
|
|
}
|
|
|
|
return a.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testIn.expected = "true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false";
|
|
|
|
test(testIn);
|
|
|
|
|
|
|
|
function testBranchCse() {
|
2009-01-14 07:16:18 -08:00
|
|
|
empty = [];
|
|
|
|
out = [];
|
|
|
|
for (var j=0;j<10;++j) { empty[42]; out.push((1 * (1)) | ""); }
|
|
|
|
return out.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testBranchCse.expected = "1,1,1,1,1,1,1,1,1,1";
|
|
|
|
test(testBranchCse);
|
|
|
|
|
|
|
|
function testMulOverflow() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var a = [];
|
|
|
|
for (let j=0;j<5;++j) a.push(0 | ((0x60000009) * 0x60000009));
|
|
|
|
return a.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testMulOverflow.expected = "-1073741824,-1073741824,-1073741824,-1073741824,-1073741824";
|
|
|
|
test(testMulOverflow);
|
|
|
|
|
|
|
|
function testThinLoopDemote() {
|
2009-01-14 07:16:18 -08:00
|
|
|
function f()
|
|
|
|
{
|
|
|
|
var k = 1;
|
|
|
|
for (var n = 0; n < 2; n++) {
|
|
|
|
k = (k * 10);
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
2009-01-14 07:16:18 -08:00
|
|
|
return k;
|
|
|
|
}
|
|
|
|
f();
|
|
|
|
return f();
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testThinLoopDemote.expected = 100;
|
|
|
|
testThinLoopDemote.jitstats = {
|
2009-01-14 07:16:18 -08:00
|
|
|
recorderStarted: 3,
|
|
|
|
recorderAborted: 0,
|
|
|
|
traceCompleted: 1,
|
|
|
|
traceTriggered: 0,
|
|
|
|
unstableLoopVariable: 2
|
2008-11-27 02:29:31 -08:00
|
|
|
};
|
|
|
|
test(testThinLoopDemote);
|
|
|
|
|
|
|
|
var global = this;
|
|
|
|
function testWeirdDateParseOuter()
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var vDateParts = ["11", "17", "2008"];
|
|
|
|
var out = [];
|
|
|
|
for (var vI = 0; vI < vDateParts.length; vI++)
|
|
|
|
out.push(testWeirdDateParseInner(vDateParts[vI]));
|
|
|
|
/* Mutate the global shape so we fall off trace; this causes
|
|
|
|
* additional oddity */
|
|
|
|
global.x = Math.random();
|
|
|
|
return out;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
function testWeirdDateParseInner(pVal)
|
|
|
|
{
|
2009-01-14 07:16:18 -08:00
|
|
|
var vR = 0;
|
|
|
|
for (var vI = 0; vI < pVal.length; vI++) {
|
|
|
|
var vC = pVal.charAt(vI);
|
|
|
|
if ((vC >= '0') && (vC <= '9'))
|
2008-11-27 02:29:31 -08:00
|
|
|
vR = (vR * 10) + parseInt(vC);
|
2009-01-14 07:16:18 -08:00
|
|
|
}
|
|
|
|
return vR;
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
function testWeirdDateParse() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var result = [];
|
|
|
|
result.push(testWeirdDateParseInner("11"));
|
|
|
|
result.push(testWeirdDateParseInner("17"));
|
|
|
|
result.push(testWeirdDateParseInner("2008"));
|
|
|
|
result.push(testWeirdDateParseInner("11"));
|
|
|
|
result.push(testWeirdDateParseInner("17"));
|
|
|
|
result.push(testWeirdDateParseInner("2008"));
|
|
|
|
result = result.concat(testWeirdDateParseOuter());
|
|
|
|
result = result.concat(testWeirdDateParseOuter());
|
|
|
|
result.push(testWeirdDateParseInner("11"));
|
|
|
|
result.push(testWeirdDateParseInner("17"));
|
|
|
|
result.push(testWeirdDateParseInner("2008"));
|
|
|
|
return result.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testWeirdDateParse.expected = "11,17,2008,11,17,2008,11,17,2008,11,17,2008,11,17,2008";
|
|
|
|
testWeirdDateParse.jitstats = {
|
2009-01-14 07:16:18 -08:00
|
|
|
recorderStarted: 10,
|
|
|
|
recorderAborted: 1,
|
|
|
|
traceCompleted: 5,
|
|
|
|
traceTriggered: 13,
|
|
|
|
unstableLoopVariable: 6,
|
|
|
|
noCompatInnerTrees: 1
|
2008-11-27 02:29:31 -08:00
|
|
|
};
|
|
|
|
test(testWeirdDateParse);
|
|
|
|
|
|
|
|
function testUndemotableBinaryOp() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var out = [];
|
|
|
|
for (let j = 0; j < 5; ++j) { out.push(6 - ((void 0) ^ 0x80000005)); }
|
|
|
|
return out.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testUndemotableBinaryOp.expected = "2147483649,2147483649,2147483649,2147483649,2147483649";
|
|
|
|
test(testUndemotableBinaryOp);
|
|
|
|
|
|
|
|
function testNullRelCmp() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var out = [];
|
|
|
|
for(j=0;j<3;++j) { out.push(3 > null); out.push(3 < null); out.push(0 == null); out.push(3 == null); }
|
|
|
|
return out.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testNullRelCmp.expected = "true,false,false,false,true,false,false,false,true,false,false,false";
|
|
|
|
test(testNullRelCmp);
|
|
|
|
|
|
|
|
function testEqFalseEmptyString() {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = [];
|
|
|
|
for (var i=0;i<5;++i) x.push(false == "");
|
|
|
|
return x.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testEqFalseEmptyString.expected = "true,true,true,true,true";
|
|
|
|
test(testEqFalseEmptyString);
|
|
|
|
|
|
|
|
function testIncDec2(ii) {
|
2009-01-14 07:16:18 -08:00
|
|
|
var x = [];
|
|
|
|
for (let j=0;j<5;++j) {
|
|
|
|
ii=j;
|
|
|
|
jj=j;
|
|
|
|
var kk=j;
|
|
|
|
x.push(ii--);
|
|
|
|
x.push(jj--);
|
|
|
|
x.push(kk--);
|
|
|
|
x.push(++ii);
|
|
|
|
x.push(++jj);
|
|
|
|
x.push(++kk);
|
|
|
|
}
|
|
|
|
return x.join(",");
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
function testIncDec() {
|
2009-01-14 07:16:18 -08:00
|
|
|
return testIncDec2(0);
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
testIncDec.expected = "0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4";
|
|
|
|
test(testIncDec);
|
|
|
|
|
2009-01-14 07:16:18 -08:00
|
|
|
function testApply() {
|
|
|
|
var q = [];
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
Array.prototype.push.apply(q, [5]);
|
|
|
|
return q.join(",");
|
|
|
|
}
|
|
|
|
testApply.expected = "5,5,5,5,5,5,5,5,5,5";
|
|
|
|
test(testApply);
|
|
|
|
|
|
|
|
function testComparisons()
|
|
|
|
{
|
|
|
|
// All the special values from each of the types in
|
|
|
|
// ECMA-262, 3rd ed. section 8
|
|
|
|
var undefinedType, nullType, booleanType, stringType, numberType, objectType;
|
|
|
|
|
|
|
|
var types = [];
|
|
|
|
types[undefinedType = 0] = "Undefined";
|
|
|
|
types[nullType = 1] = "Null";
|
|
|
|
types[booleanType = 2] = "Boolean";
|
|
|
|
types[stringType = 3] = "String";
|
|
|
|
types[numberType = 4] = "Number";
|
|
|
|
types[objectType = 5] = "Object";
|
|
|
|
|
|
|
|
var JSVAL_INT_MIN = -Math.pow(2, 30);
|
|
|
|
var JSVAL_INT_MAX = Math.pow(2, 30) - 1;
|
|
|
|
|
|
|
|
// Values from every ES3 type, hitting all the edge-case and special values
|
|
|
|
// that can be dreamed up
|
|
|
|
var values =
|
|
|
|
{
|
|
|
|
"undefined":
|
|
|
|
{
|
|
|
|
value: function() { return undefined; },
|
|
|
|
type: undefinedType
|
|
|
|
},
|
|
|
|
"null":
|
|
|
|
{
|
|
|
|
value: function() { return null; },
|
|
|
|
type: nullType
|
|
|
|
},
|
|
|
|
"true":
|
|
|
|
{
|
|
|
|
value: function() { return true; },
|
|
|
|
type: booleanType
|
|
|
|
},
|
|
|
|
"false":
|
|
|
|
{
|
|
|
|
value: function() { return false; },
|
|
|
|
type: booleanType
|
|
|
|
},
|
|
|
|
'""':
|
|
|
|
{
|
|
|
|
value: function() { return ""; },
|
|
|
|
type: stringType
|
|
|
|
},
|
|
|
|
'"a"':
|
|
|
|
{
|
|
|
|
// a > [, for string-object comparisons
|
|
|
|
value: function() { return "a"; },
|
|
|
|
type: stringType
|
|
|
|
},
|
|
|
|
'"Z"':
|
|
|
|
{
|
|
|
|
// Z < [, for string-object comparisons
|
|
|
|
value: function() { return "Z"; },
|
|
|
|
type: stringType
|
|
|
|
},
|
|
|
|
"0":
|
|
|
|
{
|
|
|
|
value: function() { return 0; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"-0":
|
|
|
|
{
|
|
|
|
value: function() { return -0; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"1":
|
|
|
|
{
|
|
|
|
value: function() { return 1; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"Math.E":
|
|
|
|
{
|
|
|
|
value: function() { return Math.E; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MIN - 1":
|
|
|
|
{
|
|
|
|
value: function() { return JSVAL_INT_MIN - 1; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MIN":
|
|
|
|
{
|
|
|
|
value: function() { return JSVAL_INT_MIN; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MIN + 1":
|
|
|
|
{
|
|
|
|
value: function() { return JSVAL_INT_MIN + 1; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MAX - 1":
|
|
|
|
{
|
|
|
|
value: function() { return JSVAL_INT_MAX - 1; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MAX":
|
|
|
|
{
|
|
|
|
value: function() { return JSVAL_INT_MAX; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MAX + 1":
|
|
|
|
{
|
|
|
|
value: function() { return JSVAL_INT_MAX + 1; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"Infinity":
|
|
|
|
{
|
|
|
|
value: function() { return Infinity; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"-Infinity":
|
|
|
|
{
|
|
|
|
value: function() { return -Infinity; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"NaN":
|
|
|
|
{
|
|
|
|
value: function() { return NaN; },
|
|
|
|
type: numberType
|
|
|
|
},
|
|
|
|
"{}":
|
|
|
|
{
|
|
|
|
value: function() { return {}; },
|
|
|
|
type: objectType
|
|
|
|
},
|
|
|
|
"{ valueOf: undefined }":
|
|
|
|
{
|
|
|
|
value: function() { return { valueOf: undefined }; },
|
|
|
|
type: objectType
|
|
|
|
},
|
|
|
|
"[]":
|
|
|
|
{
|
|
|
|
value: function() { return []; },
|
|
|
|
type: objectType
|
|
|
|
},
|
|
|
|
'[""]':
|
|
|
|
{
|
|
|
|
value: function() { return [""]; },
|
|
|
|
type: objectType
|
|
|
|
},
|
|
|
|
'["a"]':
|
|
|
|
{
|
|
|
|
value: function() { return ["a"]; },
|
|
|
|
type: objectType
|
|
|
|
},
|
|
|
|
"[0]":
|
|
|
|
{
|
|
|
|
value: function() { return [0]; },
|
|
|
|
type: objectType
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var orderOps =
|
|
|
|
{
|
|
|
|
"<": function(a, b) { return a < b; },
|
|
|
|
">": function(a, b) { return a > b; },
|
|
|
|
"<=": function(a, b) { return a <= b; },
|
|
|
|
">=": function(a, b) { return a >= b; }
|
|
|
|
};
|
|
|
|
var eqOps =
|
|
|
|
{
|
|
|
|
"==": function(a, b) { return a == b; },
|
|
|
|
"!=": function(a, b) { return a != b; },
|
|
|
|
"===": function(a, b) { return a === b; },
|
|
|
|
"!==": function(a, b) { return a !== b; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var notEqualIncomparable =
|
|
|
|
{
|
|
|
|
eq: { "==": false, "!=": true, "===": false, "!==": true },
|
|
|
|
order: { "<": false, ">": false, "<=": false, ">=": false }
|
|
|
|
};
|
|
|
|
var notEqualLessThan =
|
|
|
|
{
|
|
|
|
eq: { "==": false, "!=": true, "===": false, "!==": true },
|
|
|
|
order: { "<": true, ">": false, "<=": true, ">=": false }
|
|
|
|
};
|
|
|
|
var notEqualGreaterThan =
|
|
|
|
{
|
|
|
|
eq: { "==": false, "!=": true, "===": false, "!==": true },
|
|
|
|
order: { "<": false, ">": true, "<=": false, ">=": true }
|
|
|
|
};
|
|
|
|
var notEqualNorDifferent =
|
|
|
|
{
|
|
|
|
eq: { "==": false, "!=": true, "===": false, "!==": true },
|
|
|
|
order: { "<": false, ">": false, "<=": true, ">=": true }
|
|
|
|
};
|
|
|
|
var strictlyEqual =
|
|
|
|
{
|
|
|
|
eq: { "==": true, "!=": false, "===": true, "!==": false },
|
|
|
|
order: { "<": false, ">": false, "<=": true, ">=": true }
|
|
|
|
};
|
|
|
|
var looselyEqual =
|
|
|
|
{
|
|
|
|
eq: { "==": true, "!=": false, "===": false, "!==": true },
|
|
|
|
order: { "<": false, ">": false, "<=": true, ">=": true }
|
|
|
|
};
|
|
|
|
var looselyEqualNotDifferent =
|
|
|
|
{
|
|
|
|
eq: { "==": true, "!=": false, "===": false, "!==": true },
|
|
|
|
order: { "<": false, ">": false, "<=": true, ">=": true }
|
|
|
|
};
|
|
|
|
var looselyEqualIncomparable =
|
|
|
|
{
|
|
|
|
eq: { "==": true, "!=": false, "===": false, "!==": true },
|
|
|
|
order: { "<": false, ">": false, "<=": false, ">=": false }
|
|
|
|
};
|
|
|
|
var strictlyEqualNotDifferent =
|
|
|
|
{
|
|
|
|
eq: { "==": true, "!=": false, "===": true, "!==": false },
|
|
|
|
order: { "<": false, ">": false, "<=": true, ">=": true }
|
|
|
|
};
|
|
|
|
var strictlyEqualIncomparable =
|
|
|
|
{
|
|
|
|
eq: { "==": true, "!=": false, "===": true, "!==": false },
|
|
|
|
order: { "<": false, ">": false, "<=": false, ">=": false }
|
|
|
|
};
|
|
|
|
|
|
|
|
var comparingZeroToSomething =
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualNorDifferent,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": looselyEqual,
|
|
|
|
'""': looselyEqualNotDifferent,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": strictlyEqual,
|
|
|
|
"-0": strictlyEqual,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": looselyEqual,
|
|
|
|
'[""]': looselyEqual,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": looselyEqual
|
|
|
|
};
|
|
|
|
|
|
|
|
var comparingObjectOrObjectWithValueUndefined =
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualIncomparable,
|
|
|
|
"true": notEqualIncomparable,
|
|
|
|
"false": notEqualIncomparable,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualLessThan,
|
|
|
|
'"Z"': notEqualGreaterThan,
|
|
|
|
"0": notEqualIncomparable,
|
|
|
|
"-0": notEqualIncomparable,
|
|
|
|
"1": notEqualIncomparable,
|
|
|
|
"Math.E": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualIncomparable,
|
|
|
|
"Infinity": notEqualIncomparable,
|
|
|
|
"-Infinity": notEqualIncomparable,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualNorDifferent,
|
|
|
|
"{ valueOf: undefined }": notEqualNorDifferent,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualLessThan,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
};
|
|
|
|
|
|
|
|
// Constructed expected-value matrix
|
|
|
|
var expected =
|
|
|
|
{
|
|
|
|
"undefined":
|
|
|
|
{
|
|
|
|
"undefined": strictlyEqualIncomparable,
|
|
|
|
"null": looselyEqualIncomparable,
|
|
|
|
"true": notEqualIncomparable,
|
|
|
|
"false": notEqualIncomparable,
|
|
|
|
'""': notEqualIncomparable,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualIncomparable,
|
|
|
|
"-0": notEqualIncomparable,
|
|
|
|
"1": notEqualIncomparable,
|
|
|
|
"Math.E": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualIncomparable,
|
|
|
|
"Infinity": notEqualIncomparable,
|
|
|
|
"-Infinity": notEqualIncomparable,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualIncomparable,
|
|
|
|
'[""]': notEqualIncomparable,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualIncomparable
|
|
|
|
},
|
|
|
|
"null":
|
|
|
|
{
|
|
|
|
"undefined": looselyEqualIncomparable,
|
|
|
|
"null": strictlyEqualNotDifferent,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": notEqualNorDifferent,
|
|
|
|
'""': notEqualNorDifferent,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualNorDifferent,
|
|
|
|
"-0": notEqualNorDifferent,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualNorDifferent,
|
|
|
|
'[""]': notEqualNorDifferent,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualNorDifferent
|
|
|
|
},
|
|
|
|
"true":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualGreaterThan,
|
|
|
|
"true": strictlyEqual,
|
|
|
|
"false": notEqualGreaterThan,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualGreaterThan,
|
|
|
|
"-0": notEqualGreaterThan,
|
|
|
|
"1": looselyEqual,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"false":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualNorDifferent,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": strictlyEqual,
|
|
|
|
'""': looselyEqualNotDifferent,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": looselyEqual,
|
|
|
|
"-0": looselyEqual,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": looselyEqual,
|
|
|
|
'[""]': looselyEqual,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": looselyEqual
|
|
|
|
},
|
|
|
|
'""':
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualNorDifferent,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": looselyEqual,
|
|
|
|
'""': strictlyEqual,
|
|
|
|
'"a"': notEqualLessThan,
|
|
|
|
'"Z"': notEqualLessThan,
|
|
|
|
"0": looselyEqual,
|
|
|
|
"-0": looselyEqual,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualLessThan,
|
|
|
|
"{ valueOf: undefined }": notEqualLessThan,
|
|
|
|
"[]": looselyEqual,
|
|
|
|
'[""]': looselyEqual,
|
|
|
|
'["a"]': notEqualLessThan,
|
|
|
|
"[0]": notEqualLessThan
|
|
|
|
},
|
|
|
|
'"a"':
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualIncomparable,
|
|
|
|
"true": notEqualIncomparable,
|
|
|
|
"false": notEqualIncomparable,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': strictlyEqual,
|
|
|
|
'"Z"': notEqualGreaterThan,
|
|
|
|
"0": notEqualIncomparable,
|
|
|
|
"-0": notEqualIncomparable,
|
|
|
|
"1": notEqualIncomparable,
|
|
|
|
"Math.E": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualIncomparable,
|
|
|
|
"Infinity": notEqualIncomparable,
|
|
|
|
"-Infinity": notEqualIncomparable,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualGreaterThan,
|
|
|
|
"{ valueOf: undefined }": notEqualGreaterThan,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': looselyEqualNotDifferent,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
'"Z"':
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualIncomparable,
|
|
|
|
"true": notEqualIncomparable,
|
|
|
|
"false": notEqualIncomparable,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualLessThan,
|
|
|
|
'"Z"': strictlyEqual,
|
|
|
|
"0": notEqualIncomparable,
|
|
|
|
"-0": notEqualIncomparable,
|
|
|
|
"1": notEqualIncomparable,
|
|
|
|
"Math.E": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualIncomparable,
|
|
|
|
"Infinity": notEqualIncomparable,
|
|
|
|
"-Infinity": notEqualIncomparable,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualLessThan,
|
|
|
|
"{ valueOf: undefined }": notEqualLessThan,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualLessThan,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"0": comparingZeroToSomething,
|
|
|
|
"-0": comparingZeroToSomething,
|
|
|
|
"1":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualGreaterThan,
|
|
|
|
"true": looselyEqual,
|
|
|
|
"false": notEqualGreaterThan,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualGreaterThan,
|
|
|
|
"-0": notEqualGreaterThan,
|
|
|
|
"1": strictlyEqual,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"Math.E":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualGreaterThan,
|
|
|
|
"true": notEqualGreaterThan,
|
|
|
|
"false": notEqualGreaterThan,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualGreaterThan,
|
|
|
|
"-0": notEqualGreaterThan,
|
|
|
|
"1": notEqualGreaterThan,
|
|
|
|
"Math.E": strictlyEqual,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MIN - 1":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualLessThan,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": notEqualLessThan,
|
|
|
|
'""': notEqualLessThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualLessThan,
|
|
|
|
"-0": notEqualLessThan,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": strictlyEqual,
|
|
|
|
"JSVAL_INT_MIN": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualLessThan,
|
|
|
|
'[""]': notEqualLessThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualLessThan
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MIN":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualLessThan,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": notEqualLessThan,
|
|
|
|
'""': notEqualLessThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualLessThan,
|
|
|
|
"-0": notEqualLessThan,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": strictlyEqual,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualLessThan,
|
|
|
|
'[""]': notEqualLessThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualLessThan
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MIN + 1":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualLessThan,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": notEqualLessThan,
|
|
|
|
'""': notEqualLessThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualLessThan,
|
|
|
|
"-0": notEqualLessThan,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": strictlyEqual,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualLessThan,
|
|
|
|
'[""]': notEqualLessThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualLessThan
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MAX - 1":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualGreaterThan,
|
|
|
|
"true": notEqualGreaterThan,
|
|
|
|
"false": notEqualGreaterThan,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualGreaterThan,
|
|
|
|
"-0": notEqualGreaterThan,
|
|
|
|
"1": notEqualGreaterThan,
|
|
|
|
"Math.E": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": strictlyEqual,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MAX":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualGreaterThan,
|
|
|
|
"true": notEqualGreaterThan,
|
|
|
|
"false": notEqualGreaterThan,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualGreaterThan,
|
|
|
|
"-0": notEqualGreaterThan,
|
|
|
|
"1": notEqualGreaterThan,
|
|
|
|
"Math.E": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX": strictlyEqual,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"JSVAL_INT_MAX + 1":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualGreaterThan,
|
|
|
|
"true": notEqualGreaterThan,
|
|
|
|
"false": notEqualGreaterThan,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualGreaterThan,
|
|
|
|
"-0": notEqualGreaterThan,
|
|
|
|
"1": notEqualGreaterThan,
|
|
|
|
"Math.E": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX + 1": strictlyEqual,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"Infinity":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualGreaterThan,
|
|
|
|
"true": notEqualGreaterThan,
|
|
|
|
"false": notEqualGreaterThan,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualGreaterThan,
|
|
|
|
"-0": notEqualGreaterThan,
|
|
|
|
"1": notEqualGreaterThan,
|
|
|
|
"Math.E": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualGreaterThan,
|
|
|
|
"Infinity": strictlyEqual,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"-Infinity":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualLessThan,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": notEqualLessThan,
|
|
|
|
'""': notEqualLessThan,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualLessThan,
|
|
|
|
"-0": notEqualLessThan,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": strictlyEqual,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualLessThan,
|
|
|
|
'[""]': notEqualLessThan,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualLessThan
|
|
|
|
},
|
|
|
|
"NaN":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualIncomparable,
|
|
|
|
"true": notEqualIncomparable,
|
|
|
|
"false": notEqualIncomparable,
|
|
|
|
'""': notEqualIncomparable,
|
|
|
|
'"a"': notEqualIncomparable,
|
|
|
|
'"Z"': notEqualIncomparable,
|
|
|
|
"0": notEqualIncomparable,
|
|
|
|
"-0": notEqualIncomparable,
|
|
|
|
"1": notEqualIncomparable,
|
|
|
|
"Math.E": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualIncomparable,
|
|
|
|
"Infinity": notEqualIncomparable,
|
|
|
|
"-Infinity": notEqualIncomparable,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualIncomparable,
|
|
|
|
"{ valueOf: undefined }": notEqualIncomparable,
|
|
|
|
"[]": notEqualIncomparable,
|
|
|
|
'[""]': notEqualIncomparable,
|
|
|
|
'["a"]': notEqualIncomparable,
|
|
|
|
"[0]": notEqualIncomparable
|
|
|
|
},
|
|
|
|
"{}": comparingObjectOrObjectWithValueUndefined,
|
|
|
|
"{ valueOf: undefined }": comparingObjectOrObjectWithValueUndefined,
|
|
|
|
"[]":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualNorDifferent,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": looselyEqual,
|
|
|
|
'""': looselyEqual,
|
|
|
|
'"a"': notEqualLessThan,
|
|
|
|
'"Z"': notEqualLessThan,
|
|
|
|
"0": looselyEqual,
|
|
|
|
"-0": looselyEqual,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualLessThan,
|
|
|
|
"{ valueOf: undefined }": notEqualLessThan,
|
|
|
|
"[]": notEqualNorDifferent,
|
|
|
|
'[""]': notEqualNorDifferent,
|
|
|
|
'["a"]': notEqualLessThan,
|
|
|
|
"[0]": notEqualLessThan
|
|
|
|
},
|
|
|
|
'[""]':
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualNorDifferent,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": looselyEqual,
|
|
|
|
'""': looselyEqual,
|
|
|
|
'"a"': notEqualLessThan,
|
|
|
|
'"Z"': notEqualLessThan,
|
|
|
|
"0": looselyEqual,
|
|
|
|
"-0": looselyEqual,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualLessThan,
|
|
|
|
"{ valueOf: undefined }": notEqualLessThan,
|
|
|
|
"[]": notEqualNorDifferent,
|
|
|
|
'[""]': notEqualNorDifferent,
|
|
|
|
'["a"]': notEqualLessThan,
|
|
|
|
"[0]": notEqualLessThan
|
|
|
|
},
|
|
|
|
'["a"]':
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualIncomparable,
|
|
|
|
"true": notEqualIncomparable,
|
|
|
|
"false": notEqualIncomparable,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': looselyEqual,
|
|
|
|
'"Z"': notEqualGreaterThan,
|
|
|
|
"0": notEqualIncomparable,
|
|
|
|
"-0": notEqualIncomparable,
|
|
|
|
"1": notEqualIncomparable,
|
|
|
|
"Math.E": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX": notEqualIncomparable,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualIncomparable,
|
|
|
|
"Infinity": notEqualIncomparable,
|
|
|
|
"-Infinity": notEqualIncomparable,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualGreaterThan,
|
|
|
|
"{ valueOf: undefined }": notEqualGreaterThan,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualNorDifferent,
|
|
|
|
"[0]": notEqualGreaterThan
|
|
|
|
},
|
|
|
|
"[0]":
|
|
|
|
{
|
|
|
|
"undefined": notEqualIncomparable,
|
|
|
|
"null": notEqualNorDifferent,
|
|
|
|
"true": notEqualLessThan,
|
|
|
|
"false": looselyEqual,
|
|
|
|
'""': notEqualGreaterThan,
|
|
|
|
'"a"': notEqualLessThan,
|
|
|
|
'"Z"': notEqualLessThan,
|
|
|
|
"0": looselyEqual,
|
|
|
|
"-0": looselyEqual,
|
|
|
|
"1": notEqualLessThan,
|
|
|
|
"Math.E": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MIN - 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MIN + 1": notEqualGreaterThan,
|
|
|
|
"JSVAL_INT_MAX - 1": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX": notEqualLessThan,
|
|
|
|
"JSVAL_INT_MAX + 1": notEqualLessThan,
|
|
|
|
"Infinity": notEqualLessThan,
|
|
|
|
"-Infinity": notEqualGreaterThan,
|
|
|
|
"NaN": notEqualIncomparable,
|
|
|
|
"{}": notEqualLessThan,
|
|
|
|
"{ valueOf: undefined }": notEqualLessThan,
|
|
|
|
"[]": notEqualGreaterThan,
|
|
|
|
'[""]': notEqualGreaterThan,
|
|
|
|
'["a"]': notEqualLessThan,
|
|
|
|
"[0]": notEqualNorDifferent
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var failures = [];
|
|
|
|
function fail(a, ta, b, tb, ex, ac, op)
|
|
|
|
{
|
|
|
|
failures.push("(" + a + " " + op + " " + b + ") wrong: " +
|
|
|
|
"expected " + ex + ", got " + ac +
|
|
|
|
" (types " + types[ta] + ", " + types[tb] + ")");
|
|
|
|
}
|
|
|
|
|
|
|
|
var result = false;
|
|
|
|
for (var i in values)
|
|
|
|
{
|
|
|
|
for (var j in values)
|
|
|
|
{
|
|
|
|
// Constants, so hoist to help JIT know that
|
|
|
|
var vala = values[i], valb = values[j];
|
|
|
|
var a = vala.value(), b = valb.value();
|
|
|
|
|
|
|
|
for (var opname in orderOps)
|
|
|
|
{
|
|
|
|
var op = orderOps[opname];
|
|
|
|
var expect = expected[i][j].order[opname];
|
|
|
|
var failed = false;
|
|
|
|
|
|
|
|
for (var iter = 0; iter < 5; iter++)
|
|
|
|
{
|
|
|
|
result = op(a, b);
|
|
|
|
failed = failed || result !== expect;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (failed)
|
|
|
|
fail(i, vala.type, j, valb.type, expect, result, opname);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var opname in eqOps)
|
|
|
|
{
|
|
|
|
var op = eqOps[opname];
|
|
|
|
var expect = expected[i][j].eq[opname];
|
|
|
|
var failed = false;
|
|
|
|
|
|
|
|
for (var iter = 0; iter < 5; iter++)
|
|
|
|
{
|
|
|
|
result = op(a, b);
|
|
|
|
failed = failed || result !== expect;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (failed)
|
|
|
|
fail(i, vala.type, j, valb.type, expect, result, opname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (failures.length == 0)
|
|
|
|
return "no failures reported!";
|
|
|
|
|
|
|
|
return "\n" + failures.join(",\n");
|
|
|
|
}
|
|
|
|
testComparisons.expected = "no failures reported!";
|
|
|
|
test(testComparisons);
|
|
|
|
|
|
|
|
function testCaseAbort()
|
|
|
|
{
|
|
|
|
var four = "4";
|
|
|
|
var r = 0;
|
|
|
|
for (var i = 0; i < 5; i++)
|
|
|
|
{
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
case four: r += 1; break;
|
|
|
|
default: r += 2; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return "" + r;
|
|
|
|
}
|
|
|
|
testCaseAbort.expected = "10";
|
|
|
|
testCaseAbort.jitstats = {
|
|
|
|
recorderAborted: 0
|
|
|
|
};
|
|
|
|
test(testCaseAbort);
|
|
|
|
|
|
|
|
function testApplyCallHelper(f) {
|
|
|
|
var r = [];
|
|
|
|
for (var i = 0; i < 10; ++i) f.call();
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.call(this);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.apply(this);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.call(this,0);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.apply(this,[0]);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.call(this,0,1);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.apply(this,[0,1]);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.call(this,0,1,2);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2]);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.call(this,0,1,2,3);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2,3]);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.call(this,0,1,2,3,4);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2,3,4]);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.call(this,0,1,2,3,4,5);
|
|
|
|
r.push(x);
|
|
|
|
for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2,3,4,5])
|
|
|
|
r.push(x);
|
|
|
|
return(r.join(","));
|
|
|
|
}
|
|
|
|
function testApplyCall() {
|
|
|
|
var r = testApplyCallHelper(function (a0,a1,a2,a3,a4,a5,a6,a7) { x = [a0,a1,a2,a3,a4,a5,a6,a7]; });
|
|
|
|
r += testApplyCallHelper(function (a0,a1,a2,a3,a4,a5,a6,a7) { x = [a0,a1,a2,a3,a4,a5,a6,a7]; });
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
testApplyCall.expected =
|
|
|
|
",,,,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,0,,,,,,,,0,1,,,,,,,0,1,,,,,,,0,1,2,,,,,,0,1,2,,,,,,0,1,2,3,,,,,0,1,2,3,,,,,0,1,2,3,4,,,,0,1,2,3,4,,,,0,1,2,3,4,5,,,0,1,2,3,4,5,," +
|
|
|
|
",,,,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,0,,,,,,,,0,1,,,,,,,0,1,,,,,,,0,1,2,,,,,,0,1,2,,,,,,0,1,2,3,,,,,0,1,2,3,,,,,0,1,2,3,4,,,,0,1,2,3,4,,,,0,1,2,3,4,5,,,0,1,2,3,4,5,,";
|
|
|
|
test(testApplyCall);
|
|
|
|
|
|
|
|
function testApplyUnboxHelper(f,a) {
|
|
|
|
var q;
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
q = f.apply(f,a);
|
|
|
|
return q;
|
|
|
|
}
|
|
|
|
function testApplyUnbox() {
|
|
|
|
var f = function(x) { return x; }
|
|
|
|
return [testApplyUnboxHelper(f,[1]), testApplyUnboxHelper(f,[true])].join(",");
|
|
|
|
}
|
|
|
|
testApplyUnbox.expected = "1,true";
|
|
|
|
test(testApplyUnbox);
|
|
|
|
|
|
|
|
function testCallPick() {
|
|
|
|
function g(x,a) {
|
|
|
|
x.f();
|
|
|
|
}
|
|
|
|
|
|
|
|
var x = [];
|
|
|
|
x.f = function() { }
|
|
|
|
|
|
|
|
var y = [];
|
|
|
|
y.f = function() { }
|
|
|
|
|
|
|
|
var z = [x,x,x,x,x,y,y,y,y,y];
|
|
|
|
|
|
|
|
for (var i = 0; i < 10; ++i)
|
|
|
|
g.call(this, z[i], "");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
testCallPick.expected = true;
|
|
|
|
test(testCallPick);
|
|
|
|
|
|
|
|
function testInvertNullAfterNegateNull()
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 5; i++) !null;
|
|
|
|
for (var i = 0; i < 5; i++) -null;
|
|
|
|
return "no assertion";
|
|
|
|
}
|
|
|
|
testInvertNullAfterNegateNull.expected = "no assertion";
|
|
|
|
test(testInvertNullAfterNegateNull);
|
|
|
|
|
|
|
|
function testUnaryImacros()
|
|
|
|
{
|
|
|
|
function checkArg(x)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
var o = { valueOf: checkArg, toString: null };
|
|
|
|
var count = 0;
|
|
|
|
var v = 0;
|
|
|
|
for (var i = 0; i < 5; i++)
|
|
|
|
v += +o + -(-o);
|
|
|
|
|
|
|
|
var results = [v === 10 ? "valueOf passed" : "valueOf failed"];
|
|
|
|
|
|
|
|
o.valueOf = null;
|
|
|
|
o.toString = checkArg;
|
|
|
|
|
|
|
|
for (var i = 0; i < 5; i++)
|
|
|
|
v += +o + -(-o);
|
|
|
|
|
|
|
|
results.push(v === 20 ? "toString passed" : "toString failed");
|
|
|
|
|
|
|
|
return results.join(", ");
|
|
|
|
}
|
|
|
|
testUnaryImacros.expected = "valueOf passed, toString passed";
|
|
|
|
test(testUnaryImacros);
|
|
|
|
|
|
|
|
function testAddAnyInconvertibleObject()
|
|
|
|
{
|
|
|
|
var count = 0;
|
|
|
|
function toString() { ++count; if (count == 5) return {}; return "" + count; }
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
var o = {valueOf: undefined, toString: toString};
|
|
|
|
var q = 5 + o;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
|
|
|
threw = true;
|
|
|
|
if (i !== 4)
|
|
|
|
return "expected i === 4, got " + i;
|
|
|
|
if (q !== "54")
|
|
|
|
return "expected q === '54', got " + q + " (type " + typeof q + ")";
|
|
|
|
if (count !== 5)
|
|
|
|
return "expected count === 5, got " + count;
|
|
|
|
}
|
|
|
|
if (!threw)
|
|
|
|
return "expected throw with 5 + o"; // hey, a rhyme!
|
|
|
|
|
|
|
|
return "pass";
|
|
|
|
}
|
|
|
|
testAddAnyInconvertibleObject.expected = "pass";
|
|
|
|
testAddAnyInconvertibleObject.jitstats = {
|
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
sideExits: 1
|
|
|
|
};
|
|
|
|
test(testAddAnyInconvertibleObject);
|
|
|
|
|
|
|
|
function testAddInconvertibleObjectAny()
|
|
|
|
{
|
|
|
|
var count = 0;
|
|
|
|
function toString() { ++count; if (count == 5) return {}; return "" + count; }
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
var o = {valueOf: undefined, toString: toString};
|
|
|
|
var q = o + 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
|
|
|
threw = true;
|
|
|
|
if (i !== 4)
|
|
|
|
return "expected i === 4, got " + i;
|
|
|
|
if (q !== "45")
|
|
|
|
return "expected q === '54', got " + q + " (type " + typeof q + ")";
|
|
|
|
if (count !== 5)
|
|
|
|
return "expected count === 5, got " + count;
|
|
|
|
}
|
|
|
|
if (!threw)
|
|
|
|
return "expected throw with o + 5";
|
|
|
|
|
|
|
|
return "pass";
|
|
|
|
}
|
|
|
|
testAddInconvertibleObjectAny.expected = "pass";
|
|
|
|
testAddInconvertibleObjectAny.jitstats = {
|
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
sideExits: 1
|
|
|
|
};
|
|
|
|
test(testAddInconvertibleObjectAny);
|
|
|
|
|
|
|
|
function testAddInconvertibleObjectInconvertibleObject()
|
|
|
|
{
|
|
|
|
var count1 = 0;
|
|
|
|
function toString1() { ++count1; if (count1 == 5) return {}; return "" + count1; }
|
|
|
|
var count2 = 0;
|
|
|
|
function toString2() { ++count2; if (count2 == 5) return {}; return "" + count2; }
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
var o1 = {valueOf: undefined, toString: toString1};
|
|
|
|
var o2 = {valueOf: undefined, toString: toString2};
|
|
|
|
var q = o1 + o2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
|
|
|
threw = true;
|
|
|
|
if (i !== 4)
|
|
|
|
return "expected i === 4, got " + i;
|
|
|
|
if (q !== "44")
|
|
|
|
return "expected q === '44', got " + q + " (type " + typeof q + ")";
|
|
|
|
if (count1 !== 5)
|
|
|
|
return "expected count1 === 5, got " + count1;
|
|
|
|
if (count2 !== 4)
|
|
|
|
return "expected count2 === 5, got " + count2;
|
|
|
|
}
|
|
|
|
if (!threw)
|
|
|
|
return "expected throw with o1 + o2";
|
|
|
|
|
|
|
|
return "pass";
|
|
|
|
}
|
|
|
|
testAddInconvertibleObjectInconvertibleObject.expected = "pass";
|
|
|
|
testAddInconvertibleObjectInconvertibleObject.jitstats = {
|
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
sideExits: 1
|
|
|
|
};
|
|
|
|
test(testAddInconvertibleObjectInconvertibleObject);
|
|
|
|
|
|
|
|
function testBitOrAnyInconvertibleObject()
|
|
|
|
{
|
|
|
|
var count = 0;
|
|
|
|
function toString() { ++count; if (count == 5) return {}; return count; }
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
var o = {valueOf: undefined, toString: toString};
|
|
|
|
var q = 2 | o;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
|
|
|
threw = true;
|
|
|
|
if (i !== 4)
|
|
|
|
return "expected i === 4, got " + i;
|
|
|
|
if (q !== 6)
|
|
|
|
return "expected q === 6, got " + q;
|
|
|
|
if (count !== 5)
|
|
|
|
return "expected count === 5, got " + count;
|
|
|
|
}
|
|
|
|
if (!threw)
|
|
|
|
return "expected throw with 2 | o"; // hey, a rhyme!
|
|
|
|
|
|
|
|
return "pass";
|
|
|
|
}
|
|
|
|
testBitOrAnyInconvertibleObject.expected = "pass";
|
|
|
|
testBitOrAnyInconvertibleObject.jitstats = {
|
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
sideExits: 1
|
|
|
|
};
|
|
|
|
test(testBitOrAnyInconvertibleObject);
|
|
|
|
|
|
|
|
function testBitOrInconvertibleObjectAny()
|
|
|
|
{
|
|
|
|
var count = 0;
|
|
|
|
function toString() { ++count; if (count == 5) return {}; return count; }
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
var o = {valueOf: undefined, toString: toString};
|
|
|
|
var q = o | 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
|
|
|
threw = true;
|
|
|
|
if (i !== 4)
|
|
|
|
return "expected i === 4, got " + i;
|
|
|
|
if (q !== 6)
|
|
|
|
return "expected q === 6, got " + q;
|
|
|
|
if (count !== 5)
|
|
|
|
return "expected count === 5, got " + count;
|
|
|
|
}
|
|
|
|
if (!threw)
|
|
|
|
return "expected throw with o | 2";
|
|
|
|
|
|
|
|
return "pass";
|
|
|
|
}
|
|
|
|
testBitOrInconvertibleObjectAny.expected = "pass";
|
|
|
|
testBitOrInconvertibleObjectAny.jitstats = {
|
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
sideExits: 1
|
|
|
|
};
|
|
|
|
test(testBitOrInconvertibleObjectAny);
|
|
|
|
|
|
|
|
function testBitOrInconvertibleObjectInconvertibleObject()
|
|
|
|
{
|
|
|
|
var count1 = 0;
|
|
|
|
function toString1() { ++count1; if (count1 == 5) return {}; return count1; }
|
|
|
|
var count2 = 0;
|
|
|
|
function toString2() { ++count2; if (count2 == 5) return {}; return count2; }
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
var o1 = {valueOf: undefined, toString: toString1};
|
|
|
|
var o2 = {valueOf: undefined, toString: toString2};
|
|
|
|
var q = o1 | o2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
|
|
|
threw = true;
|
|
|
|
if (i !== 4)
|
|
|
|
return "expected i === 4, got " + i;
|
|
|
|
if (q !== 4)
|
|
|
|
return "expected q === 4, got " + q;
|
|
|
|
if (count1 !== 5)
|
|
|
|
return "expected count1 === 5, got " + count1;
|
|
|
|
if (count2 !== 4)
|
|
|
|
return "expected count2 === 5, got " + count2;
|
|
|
|
}
|
|
|
|
if (!threw)
|
|
|
|
return "expected throw with o1 | o2";
|
|
|
|
|
|
|
|
return "pass";
|
|
|
|
}
|
|
|
|
testBitOrInconvertibleObjectInconvertibleObject.expected = "pass";
|
|
|
|
testBitOrInconvertibleObjectInconvertibleObject.jitstats = {
|
|
|
|
recorderStarted: 1,
|
|
|
|
recorderAborted: 0,
|
|
|
|
sideExits: 1
|
|
|
|
};
|
|
|
|
test(testBitOrInconvertibleObjectInconvertibleObject);
|
|
|
|
|
|
|
|
function testCaseTypeMismatchBadness()
|
|
|
|
{
|
|
|
|
for (var z = 0; z < 3; ++z)
|
|
|
|
{
|
|
|
|
switch ("")
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
case 9:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "":
|
|
|
|
case <x/>:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return "no crash";
|
|
|
|
}
|
|
|
|
testCaseTypeMismatchBadness.expected = "no crash";
|
|
|
|
testCaseTypeMismatchBadness.jitstats = {
|
|
|
|
recorderAborted: 0
|
|
|
|
};
|
|
|
|
test(testCaseTypeMismatchBadness);
|
|
|
|
|
|
|
|
function testDoubleComparison()
|
|
|
|
{
|
|
|
|
for (var i = 0; i < 500000; ++i)
|
|
|
|
{
|
|
|
|
switch (1 / 0)
|
|
|
|
{
|
|
|
|
case Infinity:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return "finished";
|
|
|
|
}
|
|
|
|
testDoubleComparison.expected = "finished";
|
|
|
|
testDoubleComparison.jitstats = {
|
|
|
|
sideExitIntoInterpreter: 1
|
|
|
|
};
|
|
|
|
test(testDoubleComparison);
|
|
|
|
|
|
|
|
function testLirBufOOM()
|
|
|
|
{
|
|
|
|
var a = [
|
|
|
|
"12345678901234",
|
|
|
|
"123456789012",
|
|
|
|
"1234567890123456789012345678",
|
|
|
|
"12345678901234567890123456789012345678901234567890123456",
|
|
|
|
"f",
|
|
|
|
"$",
|
|
|
|
"",
|
|
|
|
"f()",
|
|
|
|
"(\\*)",
|
|
|
|
"b()",
|
|
|
|
"()",
|
|
|
|
"(#)",
|
|
|
|
"ABCDEFGHIJK",
|
|
|
|
"ABCDEFGHIJKLM",
|
|
|
|
"ABCDEFGHIJKLMNOPQ",
|
|
|
|
"ABCDEFGH",
|
|
|
|
"(.)",
|
|
|
|
"(|)",
|
|
|
|
"()$",
|
|
|
|
"/()",
|
|
|
|
"(.)$"
|
|
|
|
];
|
|
|
|
|
|
|
|
for (var j = 0; j < 200; ++j) {
|
|
|
|
var js = "" + j;
|
|
|
|
for (var i = 0; i < a.length; i++)
|
|
|
|
"".match(a[i] + js)
|
|
|
|
}
|
|
|
|
return "ok";
|
|
|
|
}
|
|
|
|
testLirBufOOM.expected = "ok";
|
|
|
|
test(testLirBufOOM);
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* *
|
|
|
|
* _____ _ _ _____ ______ _____ _______ *
|
|
|
|
* |_ _| \ | |/ ____| ____| __ \__ __| *
|
|
|
|
* | | | \| | (___ | |__ | |__) | | | *
|
|
|
|
* | | | . ` |\___ \| __| | _ / | | *
|
|
|
|
* _| |_| |\ |____) | |____| | \ \ | | *
|
|
|
|
* |_____|_| \_|_____/|______|_| \_\ |_| *
|
|
|
|
* *
|
|
|
|
* *
|
|
|
|
* _______ ______ _____ _______ _____ *
|
|
|
|
* |__ __| ____|/ ____|__ __/ ____| *
|
|
|
|
* | | | |__ | (___ | | | (___ *
|
|
|
|
* | | | __| \___ \ | | \___ \ *
|
|
|
|
* | | | |____ ____) | | | ____) | *
|
|
|
|
* |_| |______|_____/ |_| |_____/ *
|
|
|
|
* *
|
|
|
|
* *
|
|
|
|
* ____ ______ ______ ____ _____ ______ _ _ ______ _____ ______ *
|
|
|
|
* | _ \| ____| ____/ __ \| __ \| ____| | | | | ____| __ \| ____| *
|
|
|
|
* | |_) | |__ | |__ | | | | |__) | |__ | |__| | |__ | |__) | |__ *
|
|
|
|
* | _ <| __| | __|| | | | _ /| __| | __ | __| | _ /| __| *
|
|
|
|
* | |_) | |____| | | |__| | | \ \| |____ | | | | |____| | \ \| |____ *
|
|
|
|
* |____/|______|_| \____/|_| \_\______| |_| |_|______|_| \_\______| *
|
|
|
|
* *
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
// math-trace-tests.js is a separate file here.
|
|
|
|
|
|
|
|
// MANDELBROT STUFF deleted
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* _ _ ____ _ __ ____ _____ ______ *
|
|
|
|
* | \ | |/ __ \ | \/ |/ __ \| __ \| ____| *
|
|
|
|
* | \| | | | | | \ / | | | | |__) | |__ *
|
|
|
|
* | . ` | | | | | |\/| | | | | _ /| __| *
|
|
|
|
* | |\ | |__| | | | | | |__| | | \ \| |____ *
|
|
|
|
* |_| \_|\____/ |_| |_|\____/|_| \_\______| *
|
|
|
|
* *
|
|
|
|
* _______ ______ _____ _______ _____ *
|
|
|
|
* |__ __| ____|/ ____|__ __/ ____| *
|
|
|
|
* | | | |__ | (___ | | | (___ *
|
|
|
|
* | | | __| \___ \ | | \___ \ *
|
|
|
|
* | | | |____ ____) | | | ____) | *
|
|
|
|
* |_| |______|_____/ |_| |_____/ *
|
|
|
|
* *
|
|
|
|
* ______ _______ ______ _____ _ _ ______ _____ ______ _ *
|
|
|
|
* /\ | ____|__ __| ____| __ \ | | | | ____| __ \| ____| | *
|
|
|
|
* / \ | |__ | | | |__ | |__) | | |__| | |__ | |__) | |__ | | *
|
|
|
|
* / /\ \ | __| | | | __| | _ / | __ | __| | _ /| __| | | *
|
|
|
|
* / ____ \| | | | | |____| | \ \ | | | | |____| | \ \| |____|_| *
|
|
|
|
* /_/ \_\_| |_| |______|_| \_\ |_| |_|______|_| \_\______(_) *
|
|
|
|
* *
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2008-11-27 02:29:31 -08:00
|
|
|
/* NOTE: Keep this test last, since it screws up all for...in loops after it. */
|
|
|
|
function testGlobalProtoAccess() {
|
2009-01-14 07:16:18 -08:00
|
|
|
return "ok";
|
2008-11-27 02:29:31 -08:00
|
|
|
}
|
|
|
|
this.__proto__.a = 3; for (var j = 0; j < 4; ++j) { [a]; }
|
|
|
|
testGlobalProtoAccess.expected = "ok";
|
|
|
|
test(testGlobalProtoAccess);
|
|
|
|
|
2008-09-17 03:41:19 -07:00
|
|
|
jit(false);
|
|
|
|
|
2008-08-13 23:58:36 -07:00
|
|
|
/* Keep these at the end so that we can see the summary after the trace-debug spew. */
|
JavaScript Tests for bug 453024, bug 454682, bug 455605, bug 455748, bug 455775, bug 456477, bug 456540, bug 457456, bug 457778, bug 459085, bug 457824, bug 421621, bug 432075, bug 435497, bug 455413, bug 456826, bug 455982, bug 452476, bug 458076, bug 459185, bug 459186, bug 458959 with updates to public failures, spidermonkey-n-1.9.1.tests and js1_8_1/trace/trace-test.js, and update for sisyphus configuration files.
2008-10-11 20:51:18 -07:00
|
|
|
if (0) {
|
|
|
|
print("\npassed:", passes.length && passes.join(","));
|
|
|
|
print("\nFAILED:", fails.length && fails.join(","));
|
|
|
|
}
|