OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /// This file use methods that aren't used by dart2js.dart, but that we wish to | 5 /// This file use methods that aren't used by dart2js.dart, but that we wish to |
6 /// keep anyway. This might be general API that isn't currently in use, | 6 /// keep anyway. This might be general API that isn't currently in use, |
7 /// debugging aids, or API only used for testing (see TODO below). | 7 /// debugging aids, or API only used for testing (see TODO below). |
8 | 8 |
9 library dart2js.use_unused_api; | 9 library dart2js.use_unused_api; |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 PartialFunctionElement; | 45 PartialFunctionElement; |
46 | 46 |
47 class ElementVisitor extends elements_visitor.BaseElementVisitor { | 47 class ElementVisitor extends elements_visitor.BaseElementVisitor { |
48 visitElement(e, a) {} | 48 visitElement(e, a) {} |
49 } | 49 } |
50 | 50 |
51 void main(List<String> arguments) { | 51 void main(List<String> arguments) { |
52 useApi(); | 52 useApi(); |
53 dart2js.main(arguments); | 53 dart2js.main(arguments); |
54 dart2jslib.isPublicName(null); | 54 dart2jslib.isPublicName(null); |
55 useConstant(null, null, null); | 55 useConstant(null, null, null, null, null); |
56 useNode(null); | 56 useNode(null); |
57 useUtil(null); | 57 useUtil(null); |
58 useSetlet(null); | 58 useSetlet(null); |
59 useImmutableEmptySet(null); | 59 useImmutableEmptySet(null); |
60 useElementVisitor(new ElementVisitor()); | 60 useElementVisitor(new ElementVisitor()); |
61 useJsNode(new js.Program(null)); | 61 useJsNode(new js.Program(null)); |
62 useJsNode(new js.NamedFunction(null, null)); | 62 useJsNode(new js.NamedFunction(null, null)); |
63 useJsNode(new js.ArrayHole()); | 63 useJsNode(new js.ArrayHole()); |
64 useJsOther(new js.SimpleJavaScriptPrintingContext()); | 64 useJsOther(new js.SimpleJavaScriptPrintingContext()); |
65 useJsBackend(null); | 65 useJsBackend(null); |
(...skipping 12 matching lines...) Expand all Loading... |
78 useProgramBuilder(null); | 78 useProgramBuilder(null); |
79 useSemanticVisitor(); | 79 useSemanticVisitor(); |
80 useTreeVisitors(); | 80 useTreeVisitors(); |
81 } | 81 } |
82 | 82 |
83 useApi() { | 83 useApi() { |
84 api.ReadStringFromUri uri; | 84 api.ReadStringFromUri uri; |
85 } | 85 } |
86 | 86 |
87 void useConstant(constants.ConstantValue constant, | 87 void useConstant(constants.ConstantValue constant, |
| 88 constants.ConstantExpression expression, |
88 constants.ConstructedConstantExpression constructedConstant, | 89 constants.ConstructedConstantExpression constructedConstant, |
89 constants.ConstantSystem cs) { | 90 constants.ConstantSystem cs, |
| 91 constants.Environment env) { |
| 92 |
90 constant.isObject; | 93 constant.isObject; |
91 cs.isBool(constant); | 94 cs.isBool(constant); |
92 constructedConstant.computeInstanceType(); | 95 constructedConstant.computeInstanceType(); |
93 constructedConstant.computeInstanceFields(); | 96 constructedConstant.computeInstanceFields(); |
| 97 expression.evaluate(null, null); |
94 } | 98 } |
95 | 99 |
96 void useNode(tree.Node node) { | 100 void useNode(tree.Node node) { |
97 node | 101 node |
98 ..asAsyncModifier() | 102 ..asAsyncModifier() |
99 ..asAsyncForIn() | 103 ..asAsyncForIn() |
100 ..asAwait() | 104 ..asAwait() |
101 ..asBreakStatement() | 105 ..asBreakStatement() |
102 ..asCascade() | 106 ..asCascade() |
103 ..asCatchBlock() | 107 ..asCatchBlock() |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 visitFieldDefinition(tree_ir.FieldDefinition node) {} | 310 visitFieldDefinition(tree_ir.FieldDefinition node) {} |
307 | 311 |
308 visitFieldInitializer(tree_ir.FieldInitializer node) {} | 312 visitFieldInitializer(tree_ir.FieldInitializer node) {} |
309 visitSuperInitializer(tree_ir.SuperInitializer node) {} | 313 visitSuperInitializer(tree_ir.SuperInitializer node) {} |
310 } | 314 } |
311 | 315 |
312 useTreeVisitors() { | 316 useTreeVisitors() { |
313 new DummyTreeVisitor().visitRootNode(null); | 317 new DummyTreeVisitor().visitRootNode(null); |
314 new DummyTreeVisitor().visitInitializer(null); | 318 new DummyTreeVisitor().visitInitializer(null); |
315 } | 319 } |
OLD | NEW |