duplicate-__proto__.js (856B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 // Async arrow function parameters. 6 async ({__proto__: a, __proto__: b}) => {}; 7 8 // Async arrow function parameters with defaults (initially parsed as destructuring assignment). 9 async ({__proto__: a, __proto__: b} = {}) => {}; 10 11 // Duplicate __proto__ in CoverCallExpressionAndAsyncArrowHead, but not AsyncArrowHead. 12 assertThrowsInstanceOf(() => eval(` 13 NotAsync({__proto__: a, __proto__: b}); 14 `), SyntaxError); 15 16 // Starts with "async", but not called from AssignmentExpression. 17 assertThrowsInstanceOf(() => eval(` 18 typeof async({__proto__: a, __proto__: b}); 19 `), SyntaxError); 20 21 if (typeof reportCompare === "function") 22 reportCompare(0, 0);