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

Unified Diff: pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart

Issue 2990223002: Reformat untouched files. (Closed)
Patch Set: Created 3 years, 4 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
Index: pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
index a3e64d4c79b614d4a0010b20eb38a386ef9d31aa..f4d117b7aea26550b41b1cd32577cb93590c215d 100644
--- a/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
@@ -153,8 +153,7 @@ class InterceptorStubGenerator {
: _commonElements.jsNumberClass);
if (hasInt) {
- whenNumber = js.statement(
- '''{
+ whenNumber = js.statement('''{
if (Math.floor(receiver) == receiver) return #;
return #;
}''',
@@ -187,21 +186,19 @@ class InterceptorStubGenerator {
}
if (hasNative) {
- statements.add(js.statement(
- r'''{
+ statements.add(js.statement(r'''{
if (typeof receiver != "object") {
if (typeof receiver == "function" ) return #;
return receiver;
}
if (receiver instanceof #) return receiver;
return #(receiver);
- }''',
- [
- interceptorFor(_commonElements.jsJavaScriptFunctionClass),
- _emitter.constructorAccess(_commonElements.objectClass),
- _emitter.staticFunctionAccess(
- _commonElements.getNativeInterceptorMethod)
- ]));
+ }''', [
+ interceptorFor(_commonElements.jsJavaScriptFunctionClass),
+ _emitter.constructorAccess(_commonElements.objectClass),
+ _emitter
+ .staticFunctionAccess(_commonElements.getNativeInterceptorMethod)
+ ]));
} else {
ClassEntity jsUnknown = _commonElements.jsUnknownJavaScriptObjectClass;
if (_codegenWorldBuilder.directlyInstantiatedClasses
@@ -339,14 +336,12 @@ class InterceptorStubGenerator {
typeCheck = orExp(typeCheck, indexableCheck);
}
- return js.statement(
- '''
+ return js.statement('''
if (typeof a0 === "number")
if (#)
if ((a0 >>> 0) === a0 && a0 < receiver.length)
return receiver[a0];
- ''',
- typeCheck);
+ ''', typeCheck);
} else {
jsAst.Expression typeCheck;
if (containsArray) {
@@ -357,14 +352,12 @@ class InterceptorStubGenerator {
typeCheck = orExp(typeCheck, indexableCheck);
}
- return js.statement(
- r'''
+ return js.statement(r'''
if (typeof a0 === "number")
if (# && !receiver.immutable$list &&
(a0 >>> 0) === a0 && a0 < receiver.length)
return receiver[a0] = a1;
- ''',
- typeCheck);
+ ''', typeCheck);
}
}
return null;

Powered by Google App Engine
This is Rietveld 408576698