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

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: rebased 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
« no previous file with comments | « lib/runtime/dart/isolate.js ('k') | lib/runtime/dart/math.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/js.js
diff --git a/lib/runtime/dart/js.js b/lib/runtime/dart/js.js
index 902089002e7a12c499e9f3cdf90e07d59da5a2b2..7568271f5693a4c0798b61a81b07d789ef508f62 100644
--- a/lib/runtime/dart/js.js
+++ b/lib/runtime/dart/js.js
@@ -20,8 +20,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());
@@ -108,13 +107,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()));
@@ -245,8 +242,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) {
@@ -255,21 +251,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]);
}
@@ -352,10 +344,8 @@ dart_library.library('dart/js', null, /* Imports */[
}
dart.fn(_wrapDartFunction);
function _convertToDart(o, isBrowserType) {
- if (isBrowserType === void 0)
- isBrowserType = null;
- if (isBrowserType == null)
- isBrowserType = _isBrowserType;
+ if (isBrowserType === void 0) isBrowserType = null;
+ if (isBrowserType == null) isBrowserType = _isBrowserType;
if (o == null || typeof o == "string" || typeof o == "number" || typeof o == "boolean" || dart.notNull(dart.dcall(isBrowserType, o))) {
return o;
} else if (o instanceof Date) {
« no previous file with comments | « lib/runtime/dart/isolate.js ('k') | lib/runtime/dart/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698