v8/test/mjsunit/es6/regress/regress-4585.js
adamk dea9559457 Remove destructuring and default arguments runtime flags
These flags have been on by default since version 4.9, which has been
in stable Chrome for over a week now, demonstrating that they're
here to stay.

Also moved the tests out of harmony/ and into es6/.

Review URL: https://codereview.chromium.org/1776683003

Cr-Commit-Position: refs/heads/master@{#34692}
2016-03-10 23:22:30 +00:00

15 lines
687 B
JavaScript

// 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.
assertThrows(`for(const { method() {} } = this) {}`, SyntaxError);
assertThrows(`var { method() {} } = this;`, SyntaxError);
assertThrows(`for(const { *method() {} } = this) {}`, SyntaxError);
assertThrows(`var { *method() {} } = this;`, SyntaxError);
assertThrows(`for(var { get foo() {} } = this) {}`, SyntaxError);
assertThrows(`for(var { set foo() {} } = this) {}`, SyntaxError);
// Still OK in other objects
for (var { name = "" + { toString() { return "test" } } } in { a: 1}) break;
assertEquals(name, "test");