From ff9fa29631071b2ebac38cb3fc9c0b7d6e9c70a2 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 2 Dec 2009 15:17:02 -0800 Subject: [PATCH] Bug 532254: Give TCF_FUN_PARAM_EVAL a distinct value. r=mrbkap Regression test included. --- js/src/jsemit.h | 6 ++++-- js/src/tests/ecma_5/strict/jstests.list | 1 + js/src/tests/ecma_5/strict/regress-532254.js | 13 +++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 js/src/tests/ecma_5/strict/regress-532254.js diff --git a/js/src/jsemit.h b/js/src/jsemit.h index b94dcdcc570..5593ce0e1a3 100644 --- a/js/src/jsemit.h +++ b/js/src/jsemit.h @@ -257,7 +257,6 @@ struct JSTreeContext { /* tree context for semantic checks */ #define TCF_NO_SCRIPT_RVAL 0x4000 /* API caller does not want result value from global script */ #define TCF_HAS_SHARPS 0x8000 /* source contains sharp defs or uses */ -#define TCF_FUN_PARAM_EVAL 0x10000 /* function has parameter named 'eval' */ /* * Set when parsing a declaration-like destructuring pattern. This @@ -286,7 +285,10 @@ struct JSTreeContext { /* tree context for semantic checks */ * the use of 'with'. See also TSF_STRICT_MODE_CODE, * JSScript::strictModeCode, and JSREPORT_STRICT_ERROR. */ -#define TCF_STRICT_MODE_CODE 0x40000 +#define TCF_STRICT_MODE_CODE 0x40000 + +/* Function has parameter named 'eval'. */ +#define TCF_FUN_PARAM_EVAL 0x80000 /* * Flags to propagate out of the blocks. diff --git a/js/src/tests/ecma_5/strict/jstests.list b/js/src/tests/ecma_5/strict/jstests.list index 908959927bf..43588b8ce29 100644 --- a/js/src/tests/ecma_5/strict/jstests.list +++ b/js/src/tests/ecma_5/strict/jstests.list @@ -15,4 +15,5 @@ script 12.14.1.js script 13.1.js script B.1.1.js script B.1.2.js +script regress-532254.js script regress-532041.js diff --git a/js/src/tests/ecma_5/strict/regress-532254.js b/js/src/tests/ecma_5/strict/regress-532254.js new file mode 100644 index 00000000000..e91e05b1a6a --- /dev/null +++ b/js/src/tests/ecma_5/strict/regress-532254.js @@ -0,0 +1,13 @@ +/* -*- 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/ + */ + +assertEq(testLenientAndStrict('function f(eval,[x]){}', + parsesSuccessfully, + parseRaisesException(SyntaxError)), + true); + +reportCompare(true, true);