Skip to content

Commit

Permalink
Allow constant static fields to overwrite defaults
Browse files Browse the repository at this point in the history
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 .
  • Loading branch information
smanilov committed Jun 15, 2016
1 parent 76d94c0 commit 5a0353b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/dev_compiler/lib/src/compiler/js_names.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,13 @@ bool invalidVariableName(String keyword, {bool strictMode: true}) {
}

/// Returns true for invalid static field names in strict mode.
/// In particular, "caller" "callee" and "arguments" cannot be used.
/// In particular, "caller" "callee" "arguments" and "name" cannot be used.
bool invalidStaticFieldName(String name) {
switch (name) {
case "arguments":
case "caller":
case "callee":
case "name":
return true;
}
return false;
Expand Down

0 comments on commit 5a0353b

Please sign in to comment.