Chromium Code Reviews| Index: test/mjsunit/harmony/regress/regress-4585.js |
| diff --git a/test/mjsunit/harmony/regress/regress-4585.js b/test/mjsunit/harmony/regress/regress-4585.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf26948cdf90668bace9c1e587245a3f5d8af6e7 |
| --- /dev/null |
| +++ b/test/mjsunit/harmony/regress/regress-4585.js |
| @@ -0,0 +1,13 @@ |
| +// Copyright 2015 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// Flags: --harmony-destructuring-bind |
| + |
| +assertThrows(`for(const { function(){} } = this) {}`, SyntaxError); |
|
adamk
2015/12/01 18:27:57
Can you put these tests in test-parsing instead? T
|
| +assertThrows(`var { function() {} } = this;`, SyntaxError); |
|
adamk
2015/12/01 18:27:57
Also can you use 'method' instead of 'function'? I
|
| +assertThrows(`for(var { get foo() {} } = this) {}`, SyntaxError); |
|
adamk
2015/12/01 18:27:57
Also add a test for 'set foo(arg)'
|
| + |
| +// Still OK in other objects |
| +for (var { name = "" + { toString() { return "test" } } } in { a: 1}) break; |
| +assertEquals(name, "test"); |