Bug 532254: Give TCF_FUN_PARAM_EVAL a distinct value. r=mrbkap

Regression test included.
This commit is contained in:
Jim Blandy 2009-12-02 15:17:02 -08:00
parent dbab286e15
commit ff9fa29631
3 changed files with 18 additions and 2 deletions

View File

@ -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.

View File

@ -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

View File

@ -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);