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

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

Issue 1045323002: emit interfaces before use (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 | « lib/runtime/dart/convert.js ('k') | lib/runtime/dart/isolate.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/core.js
diff --git a/lib/runtime/dart/core.js b/lib/runtime/dart/core.js
index 2e41df72beae9b4cb72e905ff0e00b27e96f6f03..4a0fb35f295f9d232325755701461c9e43793b8c 100644
--- a/lib/runtime/dart/core.js
+++ b/lib/runtime/dart/core.js
@@ -537,12 +537,9 @@ var core;
return _js_helper.Primitives.extractStackTrace(this);
}
}
- class AssertionError extends Error {
- }
- class TypeError extends AssertionError {
- }
- class CastError extends Error {
- }
+ class AssertionError extends Error {}
+ class TypeError extends AssertionError {}
+ class CastError extends Error {}
class NullThrownError extends Error {
toString() {
return "Throw of null.";
@@ -1151,6 +1148,11 @@ var core;
dart.defineLazyClassGeneric(exports, '_GeneratorIterable', {get: _GeneratorIterable$});
let _index = dart.JsSymbol('_index');
let _current = dart.JsSymbol('_current');
+ let Iterator$ = dart.generic(function(E) {
+ class Iterator extends Object {}
+ return Iterator;
+ });
+ let Iterator = Iterator$(dart.dynamic);
let _GeneratorIterator$ = dart.generic(function(E) {
class _GeneratorIterator extends Object {
_GeneratorIterator(index$, end$, generator$) {
@@ -1178,18 +1180,11 @@ var core;
});
let _GeneratorIterator = _GeneratorIterator$(dart.dynamic);
let BidirectionalIterator$ = dart.generic(function(E) {
- class BidirectionalIterator extends Object {
- }
+ class BidirectionalIterator extends Object {}
BidirectionalIterator[dart.implements] = [Iterator$(E)];
return BidirectionalIterator;
});
let BidirectionalIterator = BidirectionalIterator$(dart.dynamic);
- let Iterator$ = dart.generic(function(E) {
- class Iterator extends Object {
- }
- return Iterator;
- });
- let Iterator = Iterator$(dart.dynamic);
let List$ = dart.generic(function(E) {
class List extends Object {
List(length) {
@@ -1207,7 +1202,7 @@ var core;
result.set(i, fill);
}
}
- return dart.as(result, List$(E));
+ return dart.as(result, exports.List$(E));
}
from(elements, opts) {
let growable = opts && 'growable' in opts ? opts.growable : true;
@@ -1220,7 +1215,7 @@ var core;
result = ((_$) => {
_$.length = length;
return _$;
- }).bind(this)(new List$(E).from([]));
+ }).bind(this)(new exports.List$(E).from([]));
} else {
result = new List(length);
}
@@ -1236,7 +1231,7 @@ var core;
dart.defineNamedConstructor(List, 'generate');
return List;
});
- let List = List$(dart.dynamic);
+ dart.defineLazyClassGeneric(exports, 'List', {get: List$});
let Map$ = dart.generic(function(K, V) {
class Map extends Object {
Map() {
@@ -1272,8 +1267,7 @@ var core;
}
}
dart.defineNamedConstructor(Null, _uninstantiable);
- class Pattern extends Object {
- }
+ class Pattern extends Object {}
// Function print: (Object) → void
function print(object) {
let line = `${object}`;
@@ -1283,8 +1277,7 @@ var core;
dart.dinvokef(_internal.printToZone, line);
}
}
- class Match extends Object {
- }
+ class Match extends Object {}
class RegExp extends Object {
RegExp(source, opts) {
let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false;
@@ -1312,13 +1305,11 @@ var core;
});
dart.defineLazyClassGeneric(exports, 'Set', {get: Set$});
let Sink$ = dart.generic(function(T) {
- class Sink extends Object {
- }
+ class Sink extends Object {}
return Sink;
});
let Sink = Sink$(dart.dynamic);
- class StackTrace extends Object {
- }
+ class StackTrace extends Object {}
let _frequency = dart.JsSymbol('_frequency');
let _stop = dart.JsSymbol('_stop');
let _initTicker = dart.JsSymbol('_initTicker');
@@ -1391,7 +1382,7 @@ var core;
if (!dart.is(charCodes, _interceptors.JSArray)) {
return String[_stringFromIterable](charCodes, start, end);
}
- let list = dart.as(charCodes, List);
+ let list = dart.as(charCodes, exports.List);
let len = list.length;
if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(len)) {
throw new RangeError.range(start, 0, len);
@@ -1425,7 +1416,7 @@ var core;
throw new RangeError.range(start, 0, i);
}
}
- let list = new List.from([]);
+ let list = new exports.List.from([]);
if (end == null) {
while (it.moveNext())
list.add(it.current);
@@ -1582,6 +1573,7 @@ var core;
dart.defineNamedConstructor(RuneIterator, 'at');
let _contents = dart.JsSymbol('_contents');
let _writeString = dart.JsSymbol('_writeString');
+ class StringSink extends Object {}
class StringBuffer extends Object {
StringBuffer(content) {
if (content === void 0)
@@ -1638,15 +1630,12 @@ var core;
}
}
StringBuffer[dart.implements] = [StringSink];
- class StringSink extends Object {
- }
class Symbol extends Object {
Symbol(name) {
return new _internal.Symbol(name);
}
}
- class Type extends Object {
- }
+ class Type extends Object {}
let _writeAuthority = dart.JsSymbol('_writeAuthority');
let _userInfo = dart.JsSymbol('_userInfo');
let _host = dart.JsSymbol('_host');
@@ -2180,7 +2169,7 @@ var core;
get pathSegments() {
if (this[_pathSegments] == null) {
let pathToSplit = !dart.notNull(this.path.isEmpty) && this.path.codeUnitAt(0) == Uri[_SLASH] ? this.path.substring(1) : this.path;
- this[_pathSegments] = dart.as(new collection.UnmodifiableListView(pathToSplit == "" ? /* Unimplemented const */new List$(String).from([]) : pathToSplit.split("/").map(Uri.decodeComponent).toList({growable: false})), List$(String));
+ this[_pathSegments] = dart.as(new collection.UnmodifiableListView(pathToSplit == "" ? /* Unimplemented const */new exports.List$(String).from([]) : pathToSplit.split("/").map(Uri.decodeComponent).toList({growable: false})), exports.List$(String));
}
return this[_pathSegments];
}
@@ -2318,7 +2307,7 @@ var core;
static [_makeUserInfo](userInfo, start, end) {
if (userInfo == null)
return "";
- return Uri[_normalize](userInfo, start, end, dart.as(Uri[_userinfoTable], List$(int)));
+ return Uri[_normalize](userInfo, start, end, dart.as(Uri[_userinfoTable], exports.List$(int)));
}
static [_makePath](path, start, end, pathSegments, ensureLeadingSlash, isFile) {
if (dart.notNull(path == null) && dart.notNull(pathSegments == null))
@@ -2328,9 +2317,9 @@ var core;
}
let result = null;
if (path != null) {
- result = Uri[_normalize](path, start, end, dart.as(Uri[_pathCharOrSlashTable], List$(int)));
+ result = Uri[_normalize](path, start, end, dart.as(Uri[_pathCharOrSlashTable], exports.List$(int)));
} else {
- result = pathSegments.map(dart.closureWrap((s) => Uri[_uriEncode](dart.as(Uri[_pathCharTable], List$(int)), dart.as(s, String)), "(String) → dynamic")).join("/");
+ result = pathSegments.map(dart.closureWrap((s) => Uri[_uriEncode](dart.as(Uri[_pathCharTable], exports.List$(int)), dart.as(s, String)), "(String) → dynamic")).join("/");
}
if (dart.dload(result, 'isEmpty')) {
if (isFile)
@@ -2347,7 +2336,7 @@ var core;
throw new ArgumentError('Both query and queryParameters specified');
}
if (query != null)
- return Uri[_normalize](query, start, end, dart.as(Uri[_queryCharTable], List$(int)));
+ return Uri[_normalize](query, start, end, dart.as(Uri[_queryCharTable], exports.List$(int)));
let result = new StringBuffer();
let first = true;
queryParameters.forEach(dart.closureWrap(((key, value) => {
@@ -2366,7 +2355,7 @@ var core;
static [_makeFragment](fragment, start, end) {
if (fragment == null)
return null;
- return Uri[_normalize](fragment, start, end, dart.as(Uri[_queryCharTable], List$(int)));
+ return Uri[_normalize](fragment, start, end, dart.as(Uri[_queryCharTable], exports.List$(int)));
}
static [_stringOrNullLength](s) {
return s == null ? 0 : s.length;
@@ -2538,7 +2527,7 @@ var core;
[_removeDotSegments](path) {
if (!dart.notNull(this[_hasDotSegments](path)))
return path;
- let output = dart.as(new List.from([]), List$(String));
+ let output = dart.as(new exports.List.from([]), exports.List$(String));
let appendSlash = false;
for (let segment of path.split("/")) {
appendSlash = false;
@@ -2738,11 +2727,11 @@ var core;
}
}
static encodeComponent(component) {
- return Uri[_uriEncode](dart.as(Uri[_unreserved2396Table], List$(int)), component);
+ return Uri[_uriEncode](dart.as(Uri[_unreserved2396Table], exports.List$(int)), component);
}
static encodeQueryComponent(component, opts) {
let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8;
- return Uri[_uriEncode](dart.as(Uri[_unreservedTable], List$(int)), component, {encoding: encoding, spaceToPlus: true});
+ return Uri[_uriEncode](dart.as(Uri[_unreservedTable], exports.List$(int)), component, {encoding: encoding, spaceToPlus: true});
}
static decodeComponent(encodedComponent) {
return Uri[_uriDecode](encodedComponent);
@@ -2752,7 +2741,7 @@ var core;
return Uri[_uriDecode](encodedComponent, {plusToSpace: true, encoding: encoding});
}
static encodeFull(uri) {
- return Uri[_uriEncode](dart.as(Uri[_encodeFullTable], List$(int)), uri);
+ return Uri[_uriEncode](dart.as(Uri[_encodeFullTable], exports.List$(int)), uri);
}
static decodeFull(uri) {
return Uri[_uriDecode](uri);
@@ -2788,7 +2777,7 @@ var core;
error('each part must be in the range of `0..255`');
}
return byte;
- }, "(String) → dynamic")).toList(), List$(int));
+ }, "(String) → dynamic")).toList(), exports.List$(int));
}
static parseIPv6Address(host, start, end) {
if (start === void 0)
@@ -2816,7 +2805,7 @@ var core;
}
if (dart.notNull(host.length) < 2)
error('address is too short');
- let parts = dart.as(new List.from([]), List$(int));
+ let parts = dart.as(new exports.List.from([]), exports.List$(int));
let wildcardSeen = false;
let partStart = start;
for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
@@ -2885,7 +2874,7 @@ var core;
index = 2;
}
}
- return dart.as(bytes, List$(int));
+ return dart.as(bytes, exports.List$(int));
}
static [_uriEncode](canonicalTable, text, opts) {
let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8;
@@ -2944,7 +2933,7 @@ var core;
bytes = text.codeUnits;
}
} else {
- bytes = dart.as(new List(), List$(int));
+ bytes = dart.as(new List(), exports.List$(int));
for (let i = 0; dart.notNull(i) < dart.notNull(text.length); i = dart.notNull(i) + 1) {
let codeUnit = text.codeUnitAt(i);
if (dart.notNull(codeUnit) > 127) {
@@ -2998,18 +2987,18 @@ var core;
Uri._LOWER_CASE_F = 102;
Uri._LOWER_CASE_Z = 122;
Uri._BAR = 124;
- Uri._unreservedTable = /* Unimplemented const */new List.from([0, 0, 24576, 1023, 65534, 34815, 65534, 18431]);
- Uri._unreserved2396Table = /* Unimplemented const */new List.from([0, 0, 26498, 1023, 65534, 34815, 65534, 18431]);
- Uri._encodeFullTable = /* Unimplemented const */new List.from([0, 0, 65498, 45055, 65535, 34815, 65534, 18431]);
- Uri._schemeTable = /* Unimplemented const */new List.from([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]);
- Uri._schemeLowerTable = /* Unimplemented const */new List.from([0, 0, 26624, 1023, 0, 0, 65534, 2047]);
- Uri._subDelimitersTable = /* Unimplemented const */new List.from([0, 0, 32722, 11263, 65534, 34815, 65534, 18431]);
- Uri._genDelimitersTable = /* Unimplemented const */new List.from([0, 0, 32776, 33792, 1, 10240, 0, 0]);
- Uri._userinfoTable = /* Unimplemented const */new List.from([0, 0, 32722, 12287, 65534, 34815, 65534, 18431]);
- Uri._regNameTable = /* Unimplemented const */new List.from([0, 0, 32754, 11263, 65534, 34815, 65534, 18431]);
- Uri._pathCharTable = /* Unimplemented const */new List.from([0, 0, 32722, 12287, 65535, 34815, 65534, 18431]);
- Uri._pathCharOrSlashTable = /* Unimplemented const */new List.from([0, 0, 65490, 12287, 65535, 34815, 65534, 18431]);
- Uri._queryCharTable = /* Unimplemented const */new List.from([0, 0, 65490, 45055, 65535, 34815, 65534, 18431]);
+ Uri._unreservedTable = /* Unimplemented const */new exports.List.from([0, 0, 24576, 1023, 65534, 34815, 65534, 18431]);
+ Uri._unreserved2396Table = /* Unimplemented const */new exports.List.from([0, 0, 26498, 1023, 65534, 34815, 65534, 18431]);
+ Uri._encodeFullTable = /* Unimplemented const */new exports.List.from([0, 0, 65498, 45055, 65535, 34815, 65534, 18431]);
+ Uri._schemeTable = /* Unimplemented const */new exports.List.from([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]);
+ Uri._schemeLowerTable = /* Unimplemented const */new exports.List.from([0, 0, 26624, 1023, 0, 0, 65534, 2047]);
+ Uri._subDelimitersTable = /* Unimplemented const */new exports.List.from([0, 0, 32722, 11263, 65534, 34815, 65534, 18431]);
+ Uri._genDelimitersTable = /* Unimplemented const */new exports.List.from([0, 0, 32776, 33792, 1, 10240, 0, 0]);
+ Uri._userinfoTable = /* Unimplemented const */new exports.List.from([0, 0, 32722, 12287, 65534, 34815, 65534, 18431]);
+ Uri._regNameTable = /* Unimplemented const */new exports.List.from([0, 0, 32754, 11263, 65534, 34815, 65534, 18431]);
+ Uri._pathCharTable = /* Unimplemented const */new exports.List.from([0, 0, 32722, 12287, 65535, 34815, 65534, 18431]);
+ Uri._pathCharOrSlashTable = /* Unimplemented const */new exports.List.from([0, 0, 65490, 12287, 65535, 34815, 65534, 18431]);
+ Uri._queryCharTable = /* Unimplemented const */new exports.List.from([0, 0, 65490, 45055, 65535, 34815, 65534, 18431]);
// Function _symbolToString: (Symbol) → String
function _symbolToString(symbol) {
return _internal.Symbol.getName(dart.as(symbol, _internal.Symbol));
@@ -3071,12 +3060,10 @@ var core;
exports.Invocation = Invocation;
exports.Iterable = Iterable;
exports.Iterable$ = Iterable$;
- exports.BidirectionalIterator = BidirectionalIterator;
- exports.BidirectionalIterator$ = BidirectionalIterator$;
exports.Iterator = Iterator;
exports.Iterator$ = Iterator$;
- exports.List = List;
- exports.List$ = List$;
+ exports.BidirectionalIterator = BidirectionalIterator;
+ exports.BidirectionalIterator$ = BidirectionalIterator$;
exports.Map = Map;
exports.Map$ = Map$;
exports.Null = Null;
« no previous file with comments | « lib/runtime/dart/convert.js ('k') | lib/runtime/dart/isolate.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698