OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library dev_compiler.src.codegen.js_names; | |
6 | |
7 import 'dart:collection'; | 5 import 'dart:collection'; |
8 | 6 |
9 import '../js/js_ast.dart'; | 7 import '../js/js_ast.dart'; |
10 | 8 |
11 /// Unique instance for temporary variables. Will be renamed consistently | 9 /// Unique instance for temporary variables. Will be renamed consistently |
12 /// across the entire file. Different instances will be named differently | 10 /// across the entire file. Different instances will be named differently |
13 /// even if they have the same name, this makes it safe to use in code | 11 /// even if they have the same name, this makes it safe to use in code |
14 /// generation without needing global knowledge. See [JSNamer]. | 12 /// generation without needing global knowledge. See [JSNamer]. |
15 /// | 13 /// |
16 // TODO(jmesserly): move into js_ast? add a boolean to Identifier? | 14 // TODO(jmesserly): move into js_ast? add a boolean to Identifier? |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 /// In particular, "caller" "callee" and "arguments" cannot be used. | 287 /// In particular, "caller" "callee" and "arguments" cannot be used. |
290 bool invalidStaticFieldName(String name) { | 288 bool invalidStaticFieldName(String name) { |
291 switch (name) { | 289 switch (name) { |
292 case "arguments": | 290 case "arguments": |
293 case "caller": | 291 case "caller": |
294 case "callee": | 292 case "callee": |
295 return true; | 293 return true; |
296 } | 294 } |
297 return false; | 295 return false; |
298 } | 296 } |
OLD | NEW |