Commit eaad793c authored by Erik Arvidsson's avatar Erik Arvidsson

Fix usage of super in js perf test

BUG=none
LOG=N
R=adamk@chromium.org, adamk, dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26558}
parent 9acfd4fe
...@@ -10,39 +10,36 @@ var SuperBenchmark = new BenchmarkSuite('Super', [100], [ ...@@ -10,39 +10,36 @@ var SuperBenchmark = new BenchmarkSuite('Super', [100], [
]); ]);
function Base() { } class Base {
Base.prototype = { constructor() {}
constructor: Base,
get x() { get x() {
return this._x++; return this._x++;
}, }
set x(v) { set x(v) {
this._x += v; this._x += v;
return this._x; return this._x;
} }
f() {
return this._x++;
}
} }
Base.prototype.f = function() {
return this._x++;
}.toMethod(Base.prototype);
function Derived() { class Derived extends Base {
this._x = 1; constructor() {
this._x = 1;
}
SuperCall() {
return super.f();
}
GetterCall() {
return super.x;
}
SetterCall() {
return super.x = 5;
}
} }
Derived.prototype = Object.create(Base.prototype);
Object.setPrototypeOf(Derived, Base);
Derived.prototype.SuperCall = function() {
return super.f();
}.toMethod(Derived.prototype);
Derived.prototype.GetterCall = function() {
return super.x;
}.toMethod(Derived.prototype);
Derived.prototype.SetterCall = function() {
return super.x = 5;
}.toMethod(Derived.prototype);
var derived = new Derived(); var derived = new Derived();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment