-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dev-compiler-kernel-blockerIssues that block deprecation of analyzer DDCIssues that block deprecation of analyzer DDCweb-dev-compiler
Milestone
Description
Snippet:
class EnumClass {
final String name;
const EnumClass(this.name);
String toString() => name;
}
class Foo extends EnumClass {
static const Foo VALUE = Foo._('HIDDEN');
String get name => DateTime.now().toString();
const Foo._(String name) : super(name);
}
main() {
print(Foo.VALUE.name);
}
prints 'HIDDEN' in DDK but the current date in every other backend.
This is due to the way DDK generates constant objects. The constant field shadows the prototype's getter indirection. E.g.:
dart.defineLazy(CT, {
get C0() {
return C0 = dart.const({
__proto__: pb.Foo.prototype,
name: "HIDDEN"
});
}
});
Related issue: #37839
Metadata
Metadata
Assignees
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dev-compiler-kernel-blockerIssues that block deprecation of analyzer DDCIssues that block deprecation of analyzer DDCweb-dev-compiler