~webapps/unity-js-scopes/node.js

« back to all changes in this revision

Viewing changes to deps/v8/test/mjsunit/regress/polymorphic-accessor-test-context.js

  • Committer: Marcus Tomlinson
  • Date: 2015-11-13 07:59:04 UTC
  • Revision ID: marcus.tomlinson@canonical.com-20151113075904-h0swczmoq1rvstfc
Node v4 (stable)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2014 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
 
 
5
// Flags: --allow-natives-syntax
 
6
 
 
7
function t1() { return this instanceof t1; }
 
8
function t2() { return this instanceof t2; }
 
9
 
 
10
var o1 = new (function() { })();
 
11
Object.defineProperty(o1, "t", {get:function() { return this instanceof o1.constructor; }});
 
12
var o2 = new (function() { })();
 
13
Object.defineProperty(o2, "t", {get:function() { return this instanceof o1.constructor; }});
 
14
var o3 = new (function() { })();
 
15
o3.t = true;
 
16
 
 
17
function f(o) {
 
18
  return 1 + (o.t ? 1 : 2);
 
19
}
 
20
 
 
21
f(o1);
 
22
f(o1);
 
23
f(o2);
 
24
%OptimizeFunctionOnNextCall(f);
 
25
f(o3);