forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolyInliningFixedMethods.js
More file actions
61 lines (48 loc) · 1.48 KB
/
polyInliningFixedMethods.js
File metadata and controls
61 lines (48 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function a() { }
a.prototype.x = function () { WScript.Echo(1); this.y(); };
a.prototype.y = function () { WScript.Echo("a"); };
var a1 = new a();
a1.f = function () { WScript.Echo(1); this.y(); };
function b() { }
b.prototype.p = 1;
b.prototype.x = function () { WScript.Echo("b"); };
b.prototype.f = function () { WScript.Echo("b1"); };
b.prototype.y = function () { WScript.Echo("b"); };
var b1 = new b();
function pr(){};
pr.f = function() {WScript.Echo("pr")};
b.prototype = pr;
b2 = new b();
function Inheriter() {
this.f = function () { WScript.Echo("f"); }
}
function c() { }
c.prototype.x = function () { WScript.Echo(2); };
c.prototype.q = 1;
c.prototype.p = 1;
Inheriter.prototype = a.prototype;
c.prototype = new Inheriter();
var c1 = new c();
function d() { }
d.prototype.x = function () { WScript.Echo(2); };
d.prototype.r = 1;
d.prototype.q = 1;
d.prototype.p = 1;
//Inheriter.prototype = b.prototype;
d.prototype = new Inheriter();
var d1 = new d();
function foo(func) {
func.f();
}
foo(b1);
foo(b2);
foo(b1);
foo(d1);
foo(a1);
foo(b1);
foo(c1);
foo(d1);