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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/js/builder.dart

Issue 99303004: Remove unused API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Utilities for building JS ASTs at runtime. Contains a builder class 5 // Utilities for building JS ASTs at runtime. Contains a builder class
6 // and a parser that parses part of the language. 6 // and a parser that parses part of the language.
7 7
8 part of js; 8 part of js;
9 9
10 class JsBuilder { 10 class JsBuilder {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } else { 83 } else {
84 throw new ArgumentError('parameter should be a String or a Parameter'); 84 throw new ArgumentError('parameter should be a String or a Parameter');
85 } 85 }
86 } 86 }
87 if (parameters is! List) { 87 if (parameters is! List) {
88 parameters = [parameters]; 88 parameters = [parameters];
89 } 89 }
90 return new Fun(parameters.map(toParameter).toList(), block(body)); 90 return new Fun(parameters.map(toParameter).toList(), block(body));
91 } 91 }
92 92
93 Assignment assign(Expression leftHandSide, Expression value) {
94 return new Assignment(leftHandSide, value);
95 }
96
97 Expression undefined() => new Prefix('void', new LiteralNumber('0'));
98
99 VariableDeclarationList defineVar(String name, [initializer]) { 93 VariableDeclarationList defineVar(String name, [initializer]) {
100 if (initializer != null) { 94 if (initializer != null) {
101 initializer = toExpression(initializer); 95 initializer = toExpression(initializer);
102 } 96 }
103 var declaration = new VariableDeclaration(name); 97 var declaration = new VariableDeclaration(name);
104 var initialization = [new VariableInitialization(declaration, initializer)]; 98 var initialization = [new VariableInitialization(declaration, initializer)];
105 return new VariableDeclarationList(initialization); 99 return new VariableDeclarationList(initialization);
106 } 100 }
107 101
108 Statement toStatement(statement) { 102 Statement toStatement(statement) {
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 } 792 }
799 793
800 Node visitLiteralNull(LiteralNull node) { 794 Node visitLiteralNull(LiteralNull node) {
801 return node; 795 return node;
802 } 796 }
803 797
804 Node visitLiteralBool(LiteralBool node) { 798 Node visitLiteralBool(LiteralBool node) {
805 return node; 799 return node;
806 } 800 }
807 } 801 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698