1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_5/extensions/strict-option-redeclared-parameter.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +/* 1.5 + * Any copyright is dedicated to the Public Domain. 1.6 + * http://creativecommons.org/licenses/publicdomain/ 1.7 + */ 1.8 + 1.9 +//----------------------------------------------------------------------------- 1.10 +var BUGNUMBER = 630770; 1.11 +var summary = 1.12 + 'Correctly warn about duplicate parameters when the strict option is enabled'; 1.13 + 1.14 +print(BUGNUMBER + ": " + summary); 1.15 + 1.16 +/************** 1.17 + * BEGIN TEST * 1.18 + **************/ 1.19 + 1.20 +// Verify that duplicate parameters, with the strict option set, don't provoke 1.21 +// an assertion. Ideally we'd also verify that we warn exactly once per 1.22 +// duplicated parameter name, but at present there's no way to test that 1.23 +// without more effort (further customizing the shell JSErrorReporter) than we 1.24 +// want to make now. 1.25 +options("strict"); 1.26 +eval("function a(x, x, x, x) { }"); 1.27 + 1.28 +/******************************************************************************/ 1.29 + 1.30 +if (typeof reportCompare === "function") 1.31 + reportCompare(true, true); 1.32 + 1.33 +print("All tests passed!");