-
Notifications
You must be signed in to change notification settings - Fork 27
Runtime error on static field named 'name' #587
Comments
Looks like we don't check statics for conflicts in |
Huh. I could swear this used to work. :) We need to use Object.defineProperty to define it. I think we used to send these down the lazy field path, which uses defineProperty, so it worked. It would also be fine to |
Should we be overwriting Alternatively, we could revisit putting statics here. |
Yeah we shouldn't rename it. It's equivalent to this perfectly legal ES6 code: class Field {
static get name() { return 'Foo'; }
} |
I'm not sure I can reproduce this. (Update: I can, leaving this comment for future reference.) I'm invoking DDC like this:
where |
My problem was I was not actually running the code. Explanation on how to run the code here: #485 Running the code as explained in the linked bug reproduces the error. |
Now one can overwrite fields like 'name' as 'static const' fields in their class definition and not get runtime errors. BUG= #587 R=jmesserly@google.com Review URL: https://codereview.chromium.org/2071593003 .
BUG= #587 R=jmesserly@google.com Review URL: https://codereview.chromium.org/2075493002 .
Now one can overwrite fields like 'name' as 'static const' fields in their class definition and not get runtime errors. BUG= dart-archive/dev_compiler#587 R=jmesserly@google.com Review URL: https://codereview.chromium.org/2071593003 .
BUG= dart-archive/dev_compiler#587 R=jmesserly@google.com Review URL: https://codereview.chromium.org/2075493002 .
triggers this at runtime:
The text was updated successfully, but these errors were encountered: