v8/test/mjsunit/regress/regress-crbug-351658.js
rossberg@chromium.org c3c185c173 Make invalid LHSs a parse-time (reference) error
This is required by the spec. It also prevents crashes resulting from the attempt to read type feedback for the RHS of an invalid assignment which full codegen never actually allocated info for.

To do: check properly in preparser already.

R=marja@chromium.org, mstarzinger@chromium.org
BUG=351658
LOG=Y

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 10:21:01 +00:00

15 lines
373 B
JavaScript

// Copyright 2014 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: --allow-natives-syntax
try {
var f = eval("(function(){0 = y + y})");
%OptimizeFunctionOnNextCall(f);
f();
assertUnreachable();
} catch(e) {
assertTrue(e instanceof ReferenceError);
}