blob: 8ded6464c965ab56a0c546ca98f39ba0ff115b62 [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// Copyright 2015 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00005assertThrows(`for(const { method() {} } = this) {}`, SyntaxError);
6assertThrows(`var { method() {} } = this;`, SyntaxError);
7assertThrows(`for(const { *method() {} } = this) {}`, SyntaxError);
8assertThrows(`var { *method() {} } = this;`, SyntaxError);
9assertThrows(`for(var { get foo() {} } = this) {}`, SyntaxError);
10assertThrows(`for(var { set foo() {} } = this) {}`, SyntaxError);
11
12// Still OK in other objects
13for (var { name = "" + { toString() { return "test" } } } in { a: 1}) break;
14assertEquals(name, "test");