blob: 6345fd468a93f7c082cbcaf9b577d20da8bd485f [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 Murdochda12d292016-06-02 14:46:10 +01005// Flags: --no-harmony-restrictive-declarations
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00006
7// Previously, this caused a CHECK fail in debug mode
8// https://code.google.com/p/chromium/issues/detail?id=542099
9
10var foo = {};
11var bar = foo;
12for (foo.x in {a: 1}) function foo() { return foo; }
13assertEquals("object", typeof bar);
14assertEquals("a", bar.x);
15assertEquals("function", typeof foo);
16assertEquals("function", typeof foo());
17assertSame(foo, foo());
18assertEquals(undefined, foo.x);