Skip to content

Commit 5a0353b

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= dart-archive/dev_compiler#587 [email protected] Review URL: https://codereview.chromium.org/2071593003 .
1 parent 76d94c0 commit 5a0353b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/dev_compiler/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)