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

Unified Diff: pkg/dev_compiler/test/codegen_expected/closure.js

Issue 2934623003: fix #29753, use ES5 constructors for ddc (Closed)
Patch Set: rebase Created 3 years, 6 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
Index: pkg/dev_compiler/test/codegen_expected/closure.js
diff --git a/pkg/dev_compiler/test/codegen_expected/closure.js b/pkg/dev_compiler/test/codegen_expected/closure.js
index 91f1bec82d60b7cb039453d23d38c6208416c19d..0a620507d77ace6ca78fa64bc3f2dc72c0ea1801 100644
--- a/pkg/dev_compiler/test/codegen_expected/closure.js
+++ b/pkg/dev_compiler/test/codegen_expected/closure.js
@@ -53,14 +53,8 @@ closure.Foo$ = dart.generic(T => {
set v(value) {
this[v$] = value;
}
- new(i: number, v: T) {
- this[i$] = i;
- this[v$] = v;
- this[b] = null;
- this[s] = null;
- }
static build() {
- return new (FooOfT())(1, null);
+ return new (FooOfT()).new(1, null);
}
untyped_method(a, b) {}
pass(t: T) {
@@ -86,6 +80,12 @@ closure.Foo$ = dart.generic(T => {
}
static set staticProp(value: string) {}
}
+ (Foo.new = function(i: number, v: T) {
+ this[i$] = i;
+ this[v$] = v;
+ this[b] = null;
+ this[s] = null;
+ }).prototype = Foo.prototype;
dart.addTypeTests(Foo);
const i$ = Symbol("Foo.i");
const b = Symbol("Foo.b");
@@ -128,11 +128,12 @@ dart.defineLazy(closure.Foo, {
set some_static_var(_) {}
});
closure.Bar = class Bar extends core.Object {};
-closure.Baz = class Baz extends dart.mixin(closure.Foo$(core.int), closure.Bar) {
- new(i: number) {
- super.new(i, 123);
- }
-};
+(closure.Bar.new = function() {
+}).prototype = closure.Bar.prototype;
+closure.Baz = class Baz extends dart.mixin(closure.Foo$(core.int), closure.Bar) {};
+(closure.Baz.new = function(i: number) {
+ closure.Baz.__proto__.new.call(this, i, 123);
+}).prototype = closure.Baz.prototype;
dart.addSimpleTypeTests(closure.Baz);
closure.main = function(args): void {
};
« no previous file with comments | « pkg/dev_compiler/test/codegen_expected/BenchmarkBase.js ('k') | pkg/dev_compiler/test/codegen_expected/destructuring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698