Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: test/js-perf-test/Classes/super.js

Issue 916573002: Fix usage of super in js perf test (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/js-perf-test/Classes/super.js
diff --git a/test/js-perf-test/Classes/super.js b/test/js-perf-test/Classes/super.js
index a9ec7666884a8f9b683075885c7c7c170ccd38af..f282e9a5c88bfb215cbfe2031c7123065034d05b 100644
--- a/test/js-perf-test/Classes/super.js
+++ b/test/js-perf-test/Classes/super.js
@@ -10,39 +10,36 @@ var SuperBenchmark = new BenchmarkSuite('Super', [100], [
]);
-function Base() { }
-Base.prototype = {
- constructor: Base,
+class Base {
+ constructor() {}
get x() {
return this._x++;
- },
+ }
set x(v) {
this._x += v;
return this._x;
}
+ f() {
+ return this._x++;
+ }
}
-Base.prototype.f = function() {
- return this._x++;
-}.toMethod(Base.prototype);
-function Derived() {
- this._x = 1;
+class Derived extends Base {
+ 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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698