Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 3981326

Browse files
committed
Allow constant static fields to overwrite defaults
Now one can overwrite fields like 'name' as 'static const' fields in their class definition and not get runtime errors. BUG= #587 [email protected] Review URL: https://codereview.chromium.org/2071593003 .
1 parent 70e2996 commit 3981326

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/compiler/js_names.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,13 @@ bool invalidVariableName(String keyword, {bool strictMode: true}) {
283283
}
284284

285285
/// Returns true for invalid static field names in strict mode.
286-
/// In particular, "caller" "callee" and "arguments" cannot be used.
286+
/// In particular, "caller" "callee" "arguments" and "name" cannot be used.
287287
bool invalidStaticFieldName(String name) {
288288
switch (name) {
289289
case "arguments":
290290
case "caller":
291291
case "callee":
292+
case "name":
292293
return true;
293294
}
294295
return false;

0 commit comments

Comments
 (0)