Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 8477897 Details for
Bug 1041128
[patch]
Patch to allow duplicate properties in object literals v1
duplicatesunifv1.diff (text/plain), 46.16 KB, created by
guptha
(
hide
)
Description:
Patch to allow duplicate properties in object literals v1
Filename:
MIME Type:
Creator:
guptha
Size:
46.16 KB
patch
obsolete
># HG changeset patch ># Parent 2287cddedbb7e3c0399f3445618a83e2c94d5829 ># User Guptha Rajagopal <gupta.rajagopal@gmail.com> >Bug 1041128: Allow duplicate properties in object literals r=jorendorff >* * * >Bug 1041128 - Duplicate property name in object literal is allowed in ES6 strict mode part 2 r=Waldo > >diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp >--- a/js/src/frontend/Parser.cpp >+++ b/js/src/frontend/Parser.cpp >@@ -7067,28 +7067,16 @@ DoubleToAtom(ExclusiveContext *cx, doubl > } > > template <typename ParseHandler> > typename ParseHandler::Node > Parser<ParseHandler>::objectLiteral() > { > JS_ASSERT(tokenStream.isCurrentTokenType(TOK_LC)); > >- /* >- * A map from property names we've seen thus far to a mask of property >- * assignment types. >- */ >- AtomIndexMap seen; >- >- enum AssignmentType { >- GET = 0x1, >- SET = 0x2, >- VALUE = 0x4 | GET | SET >- }; >- > Node literal = handler.newObjectLiteral(pos().begin); > if (!literal) > return null(); > > RootedAtom atom(context); > for (;;) { > TokenKind ltok = tokenStream.getToken(TokenStream::KeywordIsName); > if (ltok == TOK_RC) >@@ -7272,59 +7260,16 @@ Parser<ParseHandler>::objectLiteral() > } else { > /* NB: Getter function in { get x(){} } is unnamed. */ > if (!methodDefinition(literal, propname, op == JSOP_INITPROP_GETTER ? Getter : Setter, > Expression, NotGenerator, op)) { > return null(); > } > } > >- /* >- * Check for duplicate property names. Duplicate data properties >- * only conflict in strict mode. Duplicate getter or duplicate >- * setter halves always conflict. A data property conflicts with >- * any part of an accessor property. >- */ >- AssignmentType assignType; >- if (op == JSOP_INITPROP) >- assignType = VALUE; >- else if (op == JSOP_INITPROP_GETTER) >- assignType = GET; >- else if (op == JSOP_INITPROP_SETTER) >- assignType = SET; >- else >- MOZ_CRASH("bad opcode in object initializer"); >- >- AtomIndexAddPtr p = seen.lookupForAdd(atom); >- if (p) { >- jsatomid index = p.value(); >- AssignmentType oldAssignType = AssignmentType(index); >- if ((oldAssignType & assignType) && >- (oldAssignType != VALUE || assignType != VALUE || pc->sc->needStrictChecks())) >- { >- JSAutoByteString name; >- if (!AtomToPrintableString(context, atom, &name)) >- return null(); >- >- ParseReportKind reportKind = >- (oldAssignType == VALUE && assignType == VALUE && !pc->sc->needStrictChecks()) >- ? ParseWarning >- : (pc->sc->needStrictChecks() ? ParseStrictError : ParseError); >- if (!report(reportKind, pc->sc->strict, null(), >- JSMSG_DUPLICATE_PROPERTY, name.ptr())) >- { >- return null(); >- } >- } >- p.value() = assignType | oldAssignType; >- } else { >- if (!seen.add(p, atom, assignType)) >- return null(); >- } >- > TokenKind tt = tokenStream.getToken(); > if (tt == TOK_RC) > break; > if (tt != TOK_COMMA) { > report(ParseError, false, null(), JSMSG_CURLY_AFTER_LIST); > return null(); > } > } >diff --git a/js/src/tests/dupl-prop-changes.diff b/js/src/tests/dupl-prop-changes.diff >new file mode 100644 >--- /dev/null >+++ b/js/src/tests/dupl-prop-changes.diff >@@ -0,0 +1,308 @@ >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js >++++ /dev/null >+@@ -1,31 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * a. This production is contained in strict code and IsDataDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true >+- * >+- * @path ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js >+- * @description Object literal - SyntaxError for duplicate date property name in strict mode >+- * @onlyStrict >+- */ >+- >+- >+-function testcase() { >+- >+- try >+- { >+- eval("'use strict'; ({foo:0,foo:1});"); >+- return false; >+- } >+- catch(e) >+- { >+- return (e instanceof SyntaxError); >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-1.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-1.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-1.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-b-1.js >+- * @description Object literal - SyntaxError if a data property definition is followed by get accessor definition with the same name >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({foo : 1, get foo(){}});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-2.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-2.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-2.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-b-2.js >+- * @description Object literal - SyntaxError if a data property definition is followed by set accessor definition with the same name >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({foo : 1, set foo(x){}});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-1.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-1.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-1.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-c-1.js >+- * @description Object literal - SyntaxError if a get accessor property definition is followed by a data property definition with the same name >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({get foo(){}, foo : 1});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-2.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-2.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-2.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-c-2.js >+- * @description Object literal - SyntaxError if a set accessor property definition is followed by a data property definition with the same name >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({set foo(x){}, foo : 1});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-1.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-1.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-1.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-1.js >+- * @description Object literal - SyntaxError for duplicate property name (get,get) >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({get foo(){}, get foo(){}});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-2.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-2.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-2.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-2.js >+- * @description Object literal - SyntaxError for duplicate property name (set,set) >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({set foo(arg){}, set foo(arg1){}});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-3.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-3.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-3.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-3.js >+- * @description Object literal - SyntaxError for duplicate property name (get,set,get) >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({get foo(){}, set foo(arg){}, get foo(){}});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >+diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-4.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-4.js >+deleted file mode 100644 >+--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-4.js >++++ /dev/null >+@@ -1,29 +0,0 @@ >+-/// Copyright (c) 2012 Ecma International. All rights reserved. >+-/// Ecma International makes this code available under the terms and conditions set >+-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >+-/// "Use Terms"). Any redistribution of this code must retain the above >+-/// copyright and this notice and otherwise comply with the Use Terms. >+-/** >+- * Refer 11.1.5; >+- * The production >+- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >+- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >+- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >+- * >+- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-4.js >+- * @description Object literal - SyntaxError for duplicate property name (set,get,set) >+- */ >+- >+- >+-function testcase() { >+- try >+- { >+- eval("({set foo(arg){}, get foo(){}, set foo(arg1){}});"); >+- return false; >+- } >+- catch(e) >+- { >+- return e instanceof SyntaxError; >+- } >+- } >+-runTestCase(testcase); >diff --git a/js/src/tests/ecma_5/eval/strict-eval-json-object-repeated-property-name.js b/js/src/tests/ecma_5/eval/strict-eval-json-object-repeated-property-name.js >deleted file mode 100644 >--- a/js/src/tests/ecma_5/eval/strict-eval-json-object-repeated-property-name.js >+++ /dev/null >@@ -1,44 +0,0 @@ >-// Any copyright is dedicated to the Public Domain. >-// http://creativecommons.org/licenses/publicdomain/ >-"use strict"; >- >-//----------------------------------------------------------------------------- >-var BUGNUMBER = 657713; >-var summary = >- "eval JSON parser hack misfires in strict mode, for objects with duplicate " + >- "property names"; >- >-print(BUGNUMBER + ": " + summary); >- >-/************** >- * BEGIN TEST * >- **************/ >- >-try >-{ >- var r = eval('({"a": 2, "a": 3})'); >- throw new Error("didn't throw, returned " + r); >-} >-catch (e) >-{ >- assertEq(e instanceof SyntaxError, true, >- "strict mode forbids objects with duplicated property names: " + e); >-} >- >-try >-{ >- var r = Function("'use strict'; return eval('({\"a\": 2, \"a\": 3})');")(); >- throw new Error("didn't throw, returned " + r); >-} >-catch (e) >-{ >- assertEq(e instanceof SyntaxError, true, >- "strict mode forbids objects with duplicated property names: " + e); >-} >- >-/******************************************************************************/ >- >-if (typeof reportCompare === "function") >- reportCompare(true, true); >- >-print("Tests complete!"); >diff --git a/js/src/tests/ecma_5/strict/11.1.5.js b/js/src/tests/ecma_5/strict/11.1.5.js >--- a/js/src/tests/ecma_5/strict/11.1.5.js >+++ b/js/src/tests/ecma_5/strict/11.1.5.js >@@ -3,169 +3,169 @@ > /* > * Any copyright is dedicated to the Public Domain. > * http://creativecommons.org/licenses/publicdomain/ > */ > > /* Simple identifier labels. */ > assertEq(testLenientAndStrict('({x:1, x:1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({x:1, y:1})', > parsesSuccessfully, > parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({x:1, y:1, x:1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > /* Property names can be written as strings, too. */ > assertEq(testLenientAndStrict('({x:1, "x":1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({"x":1, x:1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({"x":1, "x":1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > /* Numeric property names. */ > assertEq(testLenientAndStrict('({1.5:1, 1.5:1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({1.5:1, 15e-1:1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({6.02214179e23:1, 6.02214179e23:1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({6.02214179e23:1, 3.1415926535:1})', > parsesSuccessfully, > parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({ 1: 1, "1": 2 })', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({ "1": 1, 1: 2 })', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({ 2.5: 1, "2.5": 2 })', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({ "2.5": 1, 2.5: 2 })', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > /* Many properties, to exercise JSAtomList's hash-table variant. */ > assertEq(testLenientAndStrict('({a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, j:1, k:1, l:1, m:1, n:1, o:1, p:1, q:1, r:1, s:1, t:1, u:1, v:1, w:1, x:1, y:1, z:1})', > parsesSuccessfully, > parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, j:1, k:1, l:1, m:1, n:1, o:1, p:1, q:1, r:1, s:1, t:1, u:1, v:1, w:1, x:1, y:1, a:1})', > parsesSuccessfully, >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully), > true); > > /* > * Getters, setters, and value properties should conflict only when > * appropriate. > */ > assertEq(testLenientAndStrict('({get x() {}, x:1})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({x:1, get x() {}})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({set x(q) {}, x:1})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({x:1, set x(q) {}})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({1:1, set 1(q) {}})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({set 1(q) {}, 1:1})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({"1":1, set 1(q) {}})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({set 1(q) {}, "1":1})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({get x() {}, set x(q) {}})', > parsesSuccessfully, > parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({set x(q) {}, get x() {}})', > parsesSuccessfully, > parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({get x() {}, set x(q) {}, x:1})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({set x(q) {}, get x() {}, x:1})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({get x() {}, get x() {}})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > >-assertEq(testLenientAndStrict('({set x() {}, set x() {}})', >- parseRaisesException(SyntaxError), >- parseRaisesException(SyntaxError)), >+assertEq(testLenientAndStrict('({set x(q) {}, set x(q) {}})', >+ parsesSuccessfully, >+ parsesSuccessfully), > true); > > assertEq(testLenientAndStrict('({get x() {}, set x(q) {}, y:1})', > parsesSuccessfully, > parsesSuccessfully), > true); > > reportCompare(true, true); >diff --git a/js/src/tests/ecma_6/Class/methDefn.js b/js/src/tests/ecma_6/Class/methDefn.js >--- a/js/src/tests/ecma_6/Class/methDefn.js >+++ b/js/src/tests/ecma_6/Class/methDefn.js >@@ -138,14 +138,31 @@ assertEq(obj2.meth(), "hey"); > > var obj = { > a() { > return "hey"; > } > } > assertEq(obj.a.call(), "hey"); > >+// Duplicates >+var obj = { >+ meth : 3, >+ meth() { return 4; }, >+ meth() { return 5; } >+} >+assertEq(obj.meth(), 5); >+ >+var obj = { >+ meth() { return 4; }, >+ meth() { return 5; }, >+ meth : 3 >+} >+assertEq(obj.meth, 3); >+assertThrowsInstanceOf(function() {obj.meth();}, TypeError); >+ >+ > // Tests provided by benvie in the bug to distinguish from ES5 desugar. > assertEq(({ method() {} }).method.name, "method"); > assertThrowsInstanceOf(function() {({ method() { method() } }).method() }, ReferenceError); > > > reportCompare(0, 0, "ok"); >diff --git a/js/src/tests/ecma_6/Object/duplProps.js b/js/src/tests/ecma_6/Object/duplProps.js >new file mode 100644 >--- /dev/null >+++ b/js/src/tests/ecma_6/Object/duplProps.js >@@ -0,0 +1,116 @@ >+/* >+ * ES6 allows duplicate property names in object literals, even in strict mode. >+ * These tests modify the tests in test262 to reflect this change. >+ */ >+ >+// test262/ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js >+a = function() { "use strict"; return { foo: 0, foo : 1 }}; >+assertEq(a().foo, 1); >+a = function() { return { foo: 0, foo : 1 }}; >+assertEq(a().foo, 1); >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-b-1.js >+a = function() { "use strict"; return { foo : 1, get foo() { return 2; }}}; >+assertEq(a().foo, 2); >+a = function() { return { foo : 1, get foo() { return 2;} }}; >+assertEq(a().foo, 2); >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-c-1.js >+a = function() { "use strict"; return { get foo() { return 2; }, foo : 1 }}; >+assertEq(a().foo, 1); >+a = function() { return { get foo() { return 2; }, foo : 1 }}; >+assertEq(a().foo, 1); >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-b-2.js >+a = function() { "use strict"; return { foo : 1, set foo(a) { throw 2; }}}; >+try { >+ a().foo = 5; >+ throw new Error("2 should be thrown here"); >+} catch (e) { >+ if (e !== 2) >+ throw new Error("2 should be thrown here"); >+} >+a = function() { return { foo : 1, set foo(a) { throw 2;} }}; >+try { >+ a().foo = 5; >+ throw new Error("2 should be thrown here"); >+} catch (e) { >+ if (e !== 2) >+ throw new Error("2 should be thrown here"); >+} >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-d-1.js >+a = function() { "use strict"; return { get foo() { return 2; }, get foo() { return 3; } }}; >+assertEq(a().foo, 3); >+a = function() { return { get foo() { return 2; }, get foo() { return 3; } }}; >+assertEq(a().foo, 3); >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-c-2.js >+a = function() { "use strict"; return { set foo(a) { throw 2; }, foo : 1 }}; >+assertEq(a().foo, 1); >+a = function() { return { set foo(a) { throw 2; }, foo : 1 }}; >+assertEq(a().foo, 1); >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-d-2.js >+a = function() { "use strict"; return { set foo(a) { throw 2; }, set foo(a) { throw 3; }}}; >+try { >+ a().foo = 5; >+ throw new Error("3 should be thrown here"); >+} catch (e) { >+ if (e !== 3) >+ throw new Error("3 should be thrown here"); >+} >+a = function() { return { set foo(a) { throw 2; }, set foo(a) { throw 3; }}}; >+try { >+ a().foo = 5; >+ throw new Error("3 should be thrown here"); >+} catch (e) { >+ if (e !== 3) >+ throw new Error("3 should be thrown here"); >+} >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-d-3.js >+a = function() { "use strict"; return { get foo() { return 2; }, set foo(a) { throw 3; }, >+ get foo() { return 4; }}}; >+try { >+ assertEq(a().foo, 4); >+ a().foo = 5; >+ throw new Error("3 should be thrown here"); >+} catch (e) { >+ if (e !== 3) >+ throw new Error("3 should be thrown here"); >+} >+a = function() { return { get foo() { return 2; }, set foo(a) { throw 3; }, >+ get foo() { return 4; }}}; >+try { >+ assertEq(a().foo, 4); >+ a().foo = 5; >+ throw new Error("3 should be thrown here"); >+} catch (e) { >+ if (e !== 3) >+ throw new Error("3 should be thrown here"); >+} >+ >+// test262/ch11/11.1/11.1.5/11.1.5_4-4-d-4.js >+a = function() { "use strict"; return { set foo(a) { throw 2; }, get foo() { return 4; }, >+ set foo(a) { throw 3; }}}; >+try { >+ assertEq(a().foo, 4); >+ a().foo = 5; >+ throw new Error("3 should be thrown here"); >+} catch (e) { >+ if (e !== 3) >+ throw new Error("3 should be thrown here"); >+} >+a = function() { return { set foo(a) { throw 2; }, get foo() { return 4; }, >+ set foo(a) { throw 3; }}}; >+try { >+ assertEq(a().foo, 4); >+ a().foo = 5; >+ throw new Error("3 should be thrown here"); >+} catch (e) { >+ if (e !== 3) >+ throw new Error("3 should be thrown here"); >+} >+ >+reportCompare(0, 0); >diff --git a/js/src/tests/js1_5/extensions/regress-365869.js b/js/src/tests/js1_5/extensions/regress-365869.js >--- a/js/src/tests/js1_5/extensions/regress-365869.js >+++ b/js/src/tests/js1_5/extensions/regress-365869.js >@@ -24,47 +24,16 @@ function test() > { > options('strict'); > } > if (!options().match(/werror/)) > { > options('werror'); > } > >- try >- { >- expect = 'SyntaxError: property name a appears more than once in object literal'; >- eval('({a:4, a:5})'); >- // syntax warning, need to eval to catch >- actual = 'No warning'; >- } >- catch(ex) >- { >- actual = ex + ''; >- } >- >- reportCompare(expect, actual, summary); >- >- print('test crash from bug 371292 Comment 3'); >- >- try >- { >- expect = 'SyntaxError: property name 1 appears more than once in object literal'; >- eval('({1:1, 1:2})'); >- // syntax warning, need to eval to catch >- actual = 'No warning'; >- } >- catch(ex) >- { >- actual = ex + ''; >- } >- >- reportCompare(expect, actual, summary); >- >- > print('test crash from bug 371292 Comment 9'); > > try > { > expect = "TypeError: can't redefine non-configurable property '5'"; > "012345".__defineSetter__(5, function(){}); > } > catch(ex) >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js >+++ /dev/null >@@ -1,31 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * a. This production is contained in strict code and IsDataDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true >- * >- * @path ch11/11.1/11.1.5/11.1.5-4-4-a-1-s.js >- * @description Object literal - SyntaxError for duplicate date property name in strict mode >- * @onlyStrict >- */ >- >- >-function testcase() { >- >- try >- { >- eval("'use strict'; ({foo:0,foo:1});"); >- return false; >- } >- catch(e) >- { >- return (e instanceof SyntaxError); >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-1.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-1.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-1.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-b-1.js >- * @description Object literal - SyntaxError if a data property definition is followed by get accessor definition with the same name >- */ >- >- >-function testcase() { >- try >- { >- eval("({foo : 1, get foo(){}});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-2.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-2.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-b-2.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-b-2.js >- * @description Object literal - SyntaxError if a data property definition is followed by set accessor definition with the same name >- */ >- >- >-function testcase() { >- try >- { >- eval("({foo : 1, set foo(x){}});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-1.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-1.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-1.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-c-1.js >- * @description Object literal - SyntaxError if a get accessor property definition is followed by a data property definition with the same name >- */ >- >- >-function testcase() { >- try >- { >- eval("({get foo(){}, foo : 1});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-2.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-2.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-c-2.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-c-2.js >- * @description Object literal - SyntaxError if a set accessor property definition is followed by a data property definition with the same name >- */ >- >- >-function testcase() { >- try >- { >- eval("({set foo(x){}, foo : 1});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-1.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-1.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-1.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-1.js >- * @description Object literal - SyntaxError for duplicate property name (get,get) >- */ >- >- >-function testcase() { >- try >- { >- eval("({get foo(){}, get foo(){}});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-2.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-2.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-2.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-2.js >- * @description Object literal - SyntaxError for duplicate property name (set,set) >- */ >- >- >-function testcase() { >- try >- { >- eval("({set foo(arg){}, set foo(arg1){}});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-3.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-3.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-3.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-3.js >- * @description Object literal - SyntaxError for duplicate property name (get,set,get) >- */ >- >- >-function testcase() { >- try >- { >- eval("({get foo(){}, set foo(arg){}, get foo(){}});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-4.js b/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-4.js >deleted file mode 100644 >--- a/js/src/tests/test262/ch11/11.1/11.1.5/11.1.5_4-4-d-4.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-/// Copyright (c) 2012 Ecma International. All rights reserved. >-/// Ecma International makes this code available under the terms and conditions set >-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the >-/// "Use Terms"). Any redistribution of this code must retain the above >-/// copyright and this notice and otherwise comply with the Use Terms. >-/** >- * Refer 11.1.5; >- * The production >- * PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment >- * 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true >- * d. IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true and either both previous and propId.descriptor have [[Get]] fields or both previous and propId.descriptor have [[Set]] fields >- * >- * @path ch11/11.1/11.1.5/11.1.5_4-4-d-4.js >- * @description Object literal - SyntaxError for duplicate property name (set,get,set) >- */ >- >- >-function testcase() { >- try >- { >- eval("({set foo(arg){}, get foo(){}, set foo(arg1){}});"); >- return false; >- } >- catch(e) >- { >- return e instanceof SyntaxError; >- } >- } >-runTestCase(testcase); >diff --git a/js/src/tests/update-test262.sh b/js/src/tests/update-test262.sh >--- a/js/src/tests/update-test262.sh >+++ b/js/src/tests/update-test262.sh >@@ -130,14 +130,15 @@ hg -R ${tmp_dir} log -r. >> ${test262_di > # Update for the patch. > hg addremove ${js_src_tests_dir}/supporting > hg addremove ${test262_dir} > > # Apply a very narrow set of post-fixes to tests that haven't yet been updated > # for spec changes, or where we're experimenting with semantics that disagree > # with those in test262. See below: this isn't every test we don't pass! > patch -d "${js_src_tests_dir}" -p4 < ./function-arguments-caller-changes.diff >+patch -d "${js_src_tests_dir}" -p4 < ./dupl-prop-changes.diff > > # The alert reader may now be wondering: what about test262 tests that we don't > # pass? (And what about any test262 tests whose format we don't yet support?) > # We explicitly disable all such tests in js/src/tests/jstests.list one by one. > # This has the moderate benefit that if a bug is fixed, only that one file must > # be updated, and we don't have to rerun this script.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
gupta.rajagopal
: review+
Actions:
View
|
Diff
|
Review
Attachments on
bug 1041128
:
8470234
|
8472521
|
8473974
| 8477897