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

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

Issue 9373043: Move helpers and interceptors to own library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add TODO Created 8 years, 10 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 | « dart/frog/leg/typechecker.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/tests/leg/src/mock_compiler.dart
diff --git a/dart/frog/tests/leg/src/mock_compiler.dart b/dart/frog/tests/leg/src/mock_compiler.dart
index 2c3ae6ef1da9c26dfc5e0e9796b6158ac9d57e61..c9ebb4d86ab2b8caa3a4cea786ebadec7f5b7008 100644
--- a/dart/frog/tests/leg/src/mock_compiler.dart
+++ b/dart/frog/tests/leg/src/mock_compiler.dart
@@ -20,10 +20,10 @@ class WarningMessage {
toString() => message.toString();
}
-final String DEFAULT_CORELIB = @'''
+final String DEFAULT_HELPERLIB = @'''
lt() {} add(var a, var b) {} sub() {} mul() {} div() {} tdiv() {} mod() {}
neg() {} shl() {} shr() {} eq() {} le() {} gt() {} ge() {}
- or() {} and() {} not() {} print(var obj) {} eqNull(a) {} eqq() {}
+ or() {} and() {} not() {} eqNull(a) {} eqq() {}
guard$array(x) { return x; }
guard$num(x) { return x; }
guard$string(x) { return x; }
@@ -33,7 +33,10 @@ final String DEFAULT_CORELIB = @'''
builtin$filter$1(receiver, predicate) {}
builtin$removeLast$0(receiver) {}
index(a, index) {}
- indexSet(a, index, value) {}
+ indexSet(a, index, value) {}''';
+
+final String DEFAULT_CORELIB = @'''
+ print(var obj) {}
class int {}
class double {}
class bool {}
@@ -46,12 +49,16 @@ class MockCompiler extends Compiler {
Node parsedTree;
WorkItem lastBailoutWork;
- MockCompiler([String coreSource = DEFAULT_CORELIB])
+ MockCompiler([String coreSource = DEFAULT_CORELIB,
+ String helperSource = DEFAULT_HELPERLIB])
: warnings = [], errors = [], super() {
Uri uri = new Uri(scheme: "source");
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);
mainApp = mockLibrary(this, "");
}
@@ -112,7 +119,7 @@ class MockCompiler extends Compiler {
return resolver.resolveType(element);
}
- void scanCoreLibrary() {
+ void scanBuiltinLibraries() {
// Do nothing. The mock core library is already handled in the constructor.
}
}
« no previous file with comments | « dart/frog/leg/typechecker.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698