зеркало из https://github.com/mozilla/gecko-dev.git
Bug 522760 - js/src/tests/ecma_5 tests should not run as JavaScript 1.5, r=brendan
This commit is contained in:
Родитель
eb51d3ff0b
Коммит
e1b30cbe43
|
@ -604,8 +604,6 @@ function jit(on)
|
|||
}
|
||||
}
|
||||
|
||||
var gVersion = 150;
|
||||
|
||||
function jsTestDriverBrowserInit()
|
||||
{
|
||||
|
||||
|
@ -657,12 +655,14 @@ function jsTestDriverBrowserInit()
|
|||
if (!properties.version && navigator.userAgent.indexOf('Gecko/') != -1)
|
||||
{
|
||||
// If the version is not specified, and the browser is Gecko,
|
||||
// adjust the version to match the suite version.
|
||||
if (properties.test.match(/^js1_6/))
|
||||
{
|
||||
properties.version = '1.6';
|
||||
}
|
||||
else if (properties.test.match(/^js1_7/))
|
||||
// use the default version corresponding to the shell's version(0).
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=522760#c11
|
||||
// Otherwise adjust the version to match the suite version for 1.7,
|
||||
// and later due to the use of let, yield, etc.
|
||||
//
|
||||
// Note that js1_8, js1_8_1, and js1_8_5 are treated identically in
|
||||
// the browser.
|
||||
if (properties.test.match(/^js1_7/))
|
||||
{
|
||||
properties.version = '1.7';
|
||||
}
|
||||
|
@ -670,14 +670,6 @@ function jsTestDriverBrowserInit()
|
|||
{
|
||||
properties.version = '1.8';
|
||||
}
|
||||
else if (properties.test.match(/^js1_8_1/))
|
||||
{
|
||||
properties.version = '1.8';
|
||||
}
|
||||
else
|
||||
{
|
||||
properties.version = '1.5';
|
||||
}
|
||||
}
|
||||
|
||||
// default to language=type;text/javascript. required for
|
||||
|
@ -690,8 +682,6 @@ function jsTestDriverBrowserInit()
|
|||
|
||||
gTestPath = properties.test;
|
||||
|
||||
gVersion = 10*parseInt(properties.version.replace(/\./g, ''));
|
||||
|
||||
if (properties.gczeal)
|
||||
{
|
||||
gczeal(Number(properties.gczeal));
|
||||
|
|
|
@ -41,12 +41,6 @@
|
|||
|
||||
gTestsuite = 'e4x';
|
||||
|
||||
if (typeof version != 'undefined') {
|
||||
// At least in Rhino, if version is set to 150 (which is what is used
|
||||
// in top level shell.js), the implementation assumes E4X is not available.
|
||||
version(160);
|
||||
}
|
||||
|
||||
/*
|
||||
* Report a failure in the 'accepted' manner
|
||||
*/
|
||||
|
|
|
@ -56,9 +56,6 @@ var TITLE = "Logical NOT operator (!)";
|
|||
|
||||
writeHeaderToLog( SECTION + " "+ TITLE);
|
||||
|
||||
// version("130")
|
||||
|
||||
|
||||
new TestCase( SECTION, "!(null)", true, !(null) );
|
||||
new TestCase( SECTION, "!(var x)", true, !(eval("var x")) );
|
||||
new TestCase( SECTION, "!(void 0)", true, !(void 0) );
|
||||
|
|
|
@ -38,10 +38,3 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
gTestsuite = 'ecma_3_1';
|
||||
|
||||
// explicitly turn on js18
|
||||
if (typeof version != 'undefined')
|
||||
{
|
||||
version(180);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,10 +38,3 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
gTestsuite = 'js1_6';
|
||||
|
||||
// explicitly turn on js16
|
||||
if (typeof version != 'undefined')
|
||||
{
|
||||
version(160);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,8 +40,9 @@
|
|||
gTestsuite = 'js1_8_1';
|
||||
|
||||
// explicitly turn on js181
|
||||
// XXX: The browser currently only supports up to version 1.8
|
||||
if (typeof version != 'undefined')
|
||||
{
|
||||
version(180);
|
||||
version(181);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
JavaScript 1.8.5
|
||||
|
||||
Use this suite for tests which require EcmaScript 5 along with features such as
|
||||
|let|, |yield|
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/licenses/publicdomain/
|
||||
*/
|
||||
|
||||
gTestsuite = 'js1_8_5';
|
||||
|
||||
// explicitly turn on js185
|
||||
// XXX: The browser currently only supports up to version 1.8
|
||||
if (typeof version != 'undefined')
|
||||
{
|
||||
version(185);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/licenses/publicdomain/
|
||||
* Contributor:
|
||||
*/
|
||||
|
||||
var gTestfile = 'template.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 99999;
|
||||
var summary = '';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
|
@ -39,12 +39,11 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// Spidermonkey shell now defaults to 1.8, so set the basic version to
|
||||
// 1.5 for backwards compatibility.
|
||||
|
||||
// Explicitly set the default version.
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=522760#c11
|
||||
if (typeof version != 'undefined')
|
||||
{
|
||||
version(150);
|
||||
version(0);
|
||||
}
|
||||
|
||||
var STATUS = "STATUS: ";
|
||||
|
@ -109,38 +108,6 @@ function startTest() {
|
|||
if ( BUGNUMBER ) {
|
||||
print ("BUGNUMBER: " + BUGNUMBER );
|
||||
}
|
||||
if ( typeof version != 'function') {
|
||||
return;
|
||||
}
|
||||
|
||||
// JavaScript 1.3 is supposed to be compliant ecma version 1.0
|
||||
if ( VERSION == "ECMA_1" ) {
|
||||
version ( "130" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.8" || gTestsuite == 'js1_8') {
|
||||
version ( "180" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.7" || gTestsuite == 'js1_7') {
|
||||
version ( "170" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.6" || gTestsuite == 'js1_6') {
|
||||
version ( "160" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.5" || gTestsuite == 'js1_5') {
|
||||
version ( "150" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.4" || gTestsuite == 'js1_4') {
|
||||
version ( "140" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.3" || gTestsuite == 'js1_3') {
|
||||
version ( "130" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.2" || gTestsuite == 'js1_2') {
|
||||
version ( "120" );
|
||||
}
|
||||
else if ( VERSION == "JS_1.1" || gTestsuite == 'js1_1') {
|
||||
version ( "110" );
|
||||
}
|
||||
}
|
||||
|
||||
function TestCase(n, d, e, a)
|
||||
|
|
Загрузка…
Ссылка в новой задаче