Skip to content

Commit 5b9a3f5

Browse files
Markzipancommit-bot@chromium.org
authored andcommitted
[dart2js] Cleaning up no-legacy-mode failures.
Partial revert of: https://dart-review.googlesource.com/c/sdk/+/158160 Change-Id: I81bf4b07a45d3bd83bbbd04cf4fb78d9cc94b68f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196020 Reviewed-by: Joshua Litt <joshualitt@google.com> Commit-Queue: Mark Zhou <markzipan@google.com>
1 parent f88ce67 commit 5b9a3f5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ function setFunctionNamesIfNecessary(holders) {
9292
// proto-property of the classes 'prototype' field.
9393
// Older IEs use `Object.create` and copy over the properties.
9494
function inherit(cls, sup) {
95-
// Note that RTI needs cls.name, but we don't need to set it anymore.
96-
if (#legacyJavaScript) {
97-
cls.prototype.constructor = cls;
98-
}
95+
// cls.prototype.constructor carries the cached RTI. We could avoid this by
96+
// using ES6 classes, but the side effects of this need to be tested.
97+
cls.prototype.constructor = cls;
9998
cls.prototype[#operatorIsPrefix + cls.name] = cls;
10099
101100
// The superclass is only null for the Dart Object.
@@ -813,8 +812,7 @@ class FragmentEmitter {
813812

814813
'call0selector': js.quoteName(call0Name),
815814
'call1selector': js.quoteName(call1Name),
816-
'call2selector': js.quoteName(call2Name),
817-
'legacyJavaScript': _options.legacyJavaScript
815+
'call2selector': js.quoteName(call2Name)
818816
});
819817
if (program.hasSoftDeferredClasses) {
820818
mainCode = js.Block([
@@ -1202,7 +1200,6 @@ class FragmentEmitter {
12021200
properties
12031201
.add(js.Property(js.string("constructor"), classReference(cls)));
12041202
}
1205-
12061203
properties.add(js.Property(_namer.operatorIs(cls.element), js.number(1)));
12071204
}
12081205

0 commit comments

Comments
 (0)