зеркало из https://github.com/mozilla/pjs.git
Allow var redeclaration within a compilation unit (as is already allowed across compilation units; 291868, r=shaver a=me).
This commit is contained in:
Родитель
28b1c8cc4d
Коммит
8ca7b2bdc2
|
@ -2163,9 +2163,9 @@ Variables(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
|||
ATOM_LIST_SEARCH(ale, &tc->decls, atom);
|
||||
if (ale) {
|
||||
prevop = ALE_JSOP(ale);
|
||||
if (JS_HAS_STRICT_OPTION(cx) ||
|
||||
pn->pn_op == JSOP_DEFCONST ||
|
||||
prevop == JSOP_DEFCONST) {
|
||||
if (JS_HAS_STRICT_OPTION(cx)
|
||||
? pn->pn_op != JSOP_DEFVAR || prevop != JSOP_DEFVAR
|
||||
: pn->pn_op == JSOP_DEFCONST || prevop == JSOP_DEFCONST) {
|
||||
const char *name = js_AtomToPrintableString(cx, atom);
|
||||
if (!name ||
|
||||
!js_ReportCompileErrorNumber(cx, ts,
|
||||
|
|
Загрузка…
Ссылка в новой задаче