Fix problems due to unit testing of the compiler.

Review URL: https://codereview.chromium.org//11308227

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15400 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
ngeoffray@google.com 2012-11-27 16:33:16 +00:00
parent 695b2f9160
commit 65a0ccaa3b
4 changed files with 10 additions and 1 deletions

View file

@ -782,7 +782,7 @@ class JavaScriptBackend extends Backend {
jsStringClass.lookupLocalMember(const SourceString('length'));
for (ClassElement cls in classes) {
interceptedClasses[cls] = null;
if (cls != null) interceptedClasses[cls] = null;
}
}

View file

@ -1712,6 +1712,8 @@ if (typeof document !== 'undefined' && document.readyState != 'complete') {
*/
void emitGetInterceptorMethods(CodeBuffer buffer) {
JavaScriptBackend backend = compiler.backend;
// If no class needs to be intercepted, just return.
if (backend.objectInterceptorClass == null) return;
String objectName = namer.isolateAccess(backend.objectInterceptorClass);
backend.specializedGetInterceptors.forEach(
(String key, Collection<ClassElement> classes) {

View file

@ -54,6 +54,10 @@ const String DEFAULT_INTERCEPTORSLIB = r'''
class JSString {
var length;
}
class JSNumber {
}
class ObjectInterceptor {
}
getInterceptor(x) {}''';
const String DEFAULT_CORELIB = r'''

View file

@ -34,6 +34,9 @@ Future<String> provider(Uri uri) {
eqNullB(a) {}""";
} else if (uri.path.endsWith('_patch.dart')) {
source = '';
} else if (uri.path.endsWith('interceptors.dart')) {
source = """class ObjectInterceptor {}
var getInterceptor;""";
} else if (uri.path.endsWith('js_helper.dart')) {
source = 'library jshelper; class JSInvocationMirror {}';
} else {