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

Unified Diff: lib/runtime/dart/js.js

Issue 1524843002: JS: Format if statements with no else on a single line (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Cleanup Created 5 years 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: lib/runtime/dart/js.js
diff --git a/lib/runtime/dart/js.js b/lib/runtime/dart/js.js
index db2f65eb8ca61283c4141600cfdfbd663f358f00..6737e87e53e0ac4e53a907e47cee09720b6b10d7 100644
--- a/lib/runtime/dart/js.js
+++ b/lib/runtime/dart/js.js
@@ -19,8 +19,7 @@ dart_library.library('dart/js', null, /* Imports */[
dart.assert(this[_jsObject] != null);
}
static new(constructor, arguments$) {
- if (arguments$ === void 0)
- arguments$ = null;
+ if (arguments$ === void 0) arguments$ = null;
let ctor = constructor[_jsObject];
if (arguments$ == null) {
return _wrapToDart(new ctor());
@@ -107,13 +106,11 @@ dart_library.library('dart/js', null, /* Imports */[
}
callMethod(method, args) {
- if (args === void 0)
- args = null;
+ if (args === void 0) args = null;
if (!(typeof method == 'string') && !(typeof method == 'number')) {
dart.throw(new core.ArgumentError("method is not a String or num"));
}
- if (args != null)
- args = core.List.from(args[dartx.map](_convertToJS));
+ if (args != null) args = core.List.from(args[dartx.map](_convertToJS));
let fn = this[_jsObject][method];
if (!(fn instanceof Function)) {
dart.throw(new core.NoSuchMethodError(this[_jsObject], core.Symbol.new(dart.as(method, core.String)), args, dart.map()));
@@ -244,8 +241,7 @@ dart_library.library('dart/js', null, /* Imports */[
return dart.as(dart.dindex(this.callMethod('splice', [index, 1]), 0), E);
}
removeLast() {
- if (this.length == 0)
- dart.throw(new core.RangeError(-1));
+ if (this.length == 0) dart.throw(new core.RangeError(-1));
return dart.as(this.callMethod('pop'), E);
}
removeRange(start, end) {
@@ -254,21 +250,17 @@ dart_library.library('dart/js', null, /* Imports */[
}
setRange(start, end, iterable, skipCount) {
dart.as(iterable, core.Iterable$(E));
- if (skipCount === void 0)
- skipCount = 0;
+ if (skipCount === void 0) skipCount = 0;
JsArray$()._checkRange(start, end, this.length);
let length = dart.notNull(end) - dart.notNull(start);
- if (length == 0)
- return;
- if (dart.notNull(skipCount) < 0)
- dart.throw(new core.ArgumentError(skipCount));
+ if (length == 0) return;
+ if (dart.notNull(skipCount) < 0) dart.throw(new core.ArgumentError(skipCount));
let args = [start, length];
args[dartx.addAll](iterable[dartx.skip](skipCount)[dartx.take](length));
this.callMethod('splice', args);
}
sort(compare) {
- if (compare === void 0)
- compare = null;
+ if (compare === void 0) compare = null;
dart.as(compare, dart.functionType(core.int, [E, E]));
this.callMethod('sort', compare == null ? [] : [compare]);
}
« no previous file with comments | « lib/runtime/dart/isolate.js ('k') | lib/runtime/dart/math.js » ('j') | lib/src/js/printer.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698