David Fugate 7396642963 This commit includes Microsoft's initial contributions to Test262:
- external\contributions\: test contributions to Test262 from external entities such as Microsoft and Google.
                           This directory consists of the external tests without any modifications
- test\harness\:  test harness used to run Test262 tests.  Presently web-based
- test\suite\:    suite of vendor-neutral ECMAScript test cases conforming to the ES5 spec
- tools\:         among other things this includes a set of tools used to convert various external test
                  contributions to a format the Test262 test harness can consume
- website\:       an archived copy of the http://test262.ecmascript.org website
2010-10-18 20:50:07 -07:00

64 lines
2.3 KiB
JavaScript

// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S13_A5;
* @section: 13, 10.1.2;
* @assertion: Only FormalParameterList as arguments list is allowed;
* @description: Trying to use [arg1, arg2, arg3], (arg1, arg2, arg3), etc. as a FormalParameterList;
*/
// Converted for Test262 from original Sputnik source
ES5Harness.registerTest( {
id: "S13_A5",
path: "13, 10.1.2",
description: "Trying to use [arg1, arg2, arg3], (arg1, arg2, arg3), etc. as a FormalParameterList",
test: function testcase() {
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
try{
eval("function __func([arg1, arg2, arg3]){return arguments.length;}");
$ERROR('#1: eval("function __func([arg1, arg2, arg3]){return arguments.length;}") lead to throwing exception');
} catch(e){
if(!(e instanceof SyntaxError)){
$ERROR('#1.1: eval("function __func([arg1, arg2, arg3]){return arguments.length;}") lead to throwing exception of SyntaxError. Actual: exception is '+e);
}
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
try{
eval("function __func((arg1, arg2, arg3)){return arguments.length;}");
$ERROR('#2: eval("function __func((arg1, arg2, arg3)){return arguments.length;}") lead to throwing exception')
} catch(e){
if(!(e instanceof SyntaxError)){
$ERROR('#2.1: eval("function __func((arg1, arg2, arg3)){return arguments.length;}") lead to throwing exception of SyntaxError. Actual: exception is '+e);
}
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
try{
eval("function __func(arg1, arg2, arg3,){return arguments.length;}");
$ERROR('#3: eval("function __func(arg1, arg2, arg3,){return arguments.length;}") lead to throwing exception')
} catch(e){
if(!(e instanceof SyntaxError)){
$ERROR('#3.1: eval("function __func(arg1, arg2, arg3,){return arguments.length;}") lead to throwing exception of SyntaxError. Actual: exception is '+e);
}
}
//
//////////////////////////////////////////////////////////////////////////////
}
});