Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: lib/src/codegen/js_names.dart

Issue 1266483003: format with dart_style 0.2.0-rc.3 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/codegen/js_module_item_order.dart ('k') | lib/src/codegen/reify_coercions.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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; 5 library dev_compiler.src.codegen.js_names;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'package:dev_compiler/src/js/js_ast.dart'; 8 import 'package:dev_compiler/src/js/js_ast.dart';
9 9
10 /// Unique instance for temporary variables. Will be renamed consistently 10 /// Unique instance for temporary variables. Will be renamed consistently
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 String getName(Identifier node) { 67 String getName(Identifier node) {
68 var rename = scope.renames[identifierKey(node)]; 68 var rename = scope.renames[identifierKey(node)];
69 if (rename != null) return rename; 69 if (rename != null) return rename;
70 return node.name; 70 return node.name;
71 } 71 }
72 72
73 void enterScope(FunctionExpression node) { 73 void enterScope(FunctionExpression node) {
74 scope = scope.functions[node]; 74 scope = scope.functions[node];
75 } 75 }
76
76 void leaveScope() { 77 void leaveScope() {
77 scope = scope.parent; 78 scope = scope.parent;
78 } 79 }
79 } 80 }
80 81
81 /// Represents a complete function scope in JS. 82 /// Represents a complete function scope in JS.
82 /// 83 ///
83 /// We don't currently track ES6 block scopes, because we don't represent them 84 /// We don't currently track ES6 block scopes, because we don't represent them
84 /// in js_ast yet. 85 /// in js_ast yet.
85 class _FunctionScope { 86 class _FunctionScope {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 /// In particular, "caller" "callee" and "arguments" cannot be used. 276 /// In particular, "caller" "callee" and "arguments" cannot be used.
276 bool invalidStaticFieldName(String name) { 277 bool invalidStaticFieldName(String name) {
277 switch (name) { 278 switch (name) {
278 case "arguments": 279 case "arguments":
279 case "caller": 280 case "caller":
280 case "callee": 281 case "callee":
281 return true; 282 return true;
282 } 283 }
283 return false; 284 return false;
284 } 285 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_module_item_order.dart ('k') | lib/src/codegen/reify_coercions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698