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

Unified Diff: frog/tests/leg/mock_compiler.dart

Issue 10267020: Move all the builtin$ interceptors to a new interceptors library and shorten the names of them. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/tests/leg/array_static_intercept_test.dart ('k') | lib/compiler/implementation/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/leg/mock_compiler.dart
diff --git a/frog/tests/leg/mock_compiler.dart b/frog/tests/leg/mock_compiler.dart
index 3a1b5bb13d9bfd5fdb855950206640aa543b5993..d898084852aec230cbb4f752c918296bcc61a190 100644
--- a/frog/tests/leg/mock_compiler.dart
+++ b/frog/tests/leg/mock_compiler.dart
@@ -30,20 +30,22 @@ final String DEFAULT_HELPERLIB = @'''
guard$num(x) { return x; }
guard$string(x) { return x; }
guard$stringOrArray(x) { return x; }
- builtin$add$1(receiver, value) {}
- builtin$get$length(var receiver) {}
- builtin$filter$1(receiver, predicate) {}
- builtin$removeLast$0(receiver) {}
index(a, index) {}
indexSet(a, index, value) {}
- builtin$iterator$0() {}
- builtin$next$0() {}
- builtin$hasNext$0() {}
setRuntimeTypeInfo(a, b) {}
getRuntimeTypeInfo(a) {}
stringConcat() {}
stringToString() {}''';
+final String DEFAULT_INTERCEPTORSLIB = @'''
+ add$1(receiver, value) {}
+ get$length(receiver) {}
+ filter(receiver, predicate) {}
+ removeLast(receiver) {}
+ iterator(receiver) {}
+ next(receiver) {}
+ hasNext(receiver) {}''';
+
final String DEFAULT_CORELIB = @'''
print(var obj) {}
class int {}
@@ -65,7 +67,8 @@ class MockCompiler extends Compiler {
Node parsedTree;
MockCompiler([String coreSource = DEFAULT_CORELIB,
- String helperSource = DEFAULT_HELPERLIB])
+ String helperSource = DEFAULT_HELPERLIB,
+ String interceptorsSource = DEFAULT_INTERCEPTORSLIB])
: warnings = [], errors = [],
sources = new Map<String, String>(),
super() {
@@ -73,10 +76,17 @@ class MockCompiler extends Compiler {
var script = new Script(uri, new MockFile(coreSource));
coreLibrary = new LibraryElement(script);
parseScript(coreSource, coreLibrary);
+
script = new Script(uri, new MockFile(helperSource));
jsHelperLibrary = new LibraryElement(script);
parseScript(helperSource, jsHelperLibrary);
+
+ script = new Script(uri, new MockFile(interceptorsSource));
+ interceptorsLibrary = new LibraryElement(script);
+ parseScript(interceptorsSource, interceptorsLibrary);
+
scanner.importLibrary(jsHelperLibrary, coreLibrary, null);
+ scanner.importLibrary(interceptorsLibrary, coreLibrary, null);
mainApp = mockLibrary(this, "");
initializeSpecialClasses();
}
« no previous file with comments | « frog/tests/leg/array_static_intercept_test.dart ('k') | lib/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698