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

Side by Side Diff: lib/runtime/dart/core.js

Issue 1131143002: Angular workarounds (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase onto latest Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « lib/runtime/dart/convert.js ('k') | lib/runtime/dart/math.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var core = dart.defineLibrary(core, {}); 1 var core = dart.defineLibrary(core, {});
2 var _js_helper = dart.lazyImport(_js_helper); 2 var _js_helper = dart.lazyImport(_js_helper);
3 var _internal = dart.lazyImport(_internal); 3 var _internal = dart.lazyImport(_internal);
4 var collection = dart.lazyImport(collection); 4 var collection = dart.lazyImport(collection);
5 var _interceptors = dart.lazyImport(_interceptors); 5 var _interceptors = dart.lazyImport(_interceptors);
6 var convert = dart.lazyImport(convert); 6 var convert = dart.lazyImport(convert);
7 (function(exports, _js_helper, _internal, collection, _interceptors, convert) { 7 (function(exports, _js_helper, _internal, collection, _interceptors, convert) {
8 'use strict'; 8 'use strict';
9 class Object { 9 class Object {
10 constructor() { 10 constructor() {
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 if (this.message != null && "" != this.message) { 927 if (this.message != null && "" != this.message) {
928 report = `${report}: ${this.message}`; 928 report = `${report}: ${this.message}`;
929 } 929 }
930 let offset = this.offset; 930 let offset = this.offset;
931 if (!(typeof this.source == 'string')) { 931 if (!(typeof this.source == 'string')) {
932 if (offset != -1) { 932 if (offset != -1) {
933 report = dart.notNull(report) + ` (at offset ${offset})`; 933 report = dart.notNull(report) + ` (at offset ${offset})`;
934 } 934 }
935 return report; 935 return report;
936 } 936 }
937 if (offset != -1 && (dart.notNull(offset) < 0 || int['>'](offset, dart.dlo ad(this.source, 'length')))) { 937 if (offset != -1 && (dart.notNull(offset) < 0 || offset['>'](dart.dload(th is.source, 'length')))) {
938 offset = -1; 938 offset = -1;
939 } 939 }
940 if (offset == -1) { 940 if (offset == -1) {
941 let source = dart.as(this.source, String); 941 let source = dart.as(this.source, String);
942 if (dart.notNull(source.length) > 78) { 942 if (dart.notNull(source.length) > 78) {
943 source = dart.notNull(source.substring(0, 75)) + "..."; 943 source = dart.notNull(source.substring(0, 75)) + "...";
944 } 944 }
945 return `${report}\n${source}`; 945 return `${report}\n${source}`;
946 } 946 }
947 let lineNum = 1; 947 let lineNum = 1;
(...skipping 12 matching lines...) Expand all
960 lineStart = dart.notNull(i) + 1; 960 lineStart = dart.notNull(i) + 1;
961 lastWasCR = true; 961 lastWasCR = true;
962 } 962 }
963 } 963 }
964 if (dart.notNull(lineNum) > 1) { 964 if (dart.notNull(lineNum) > 1) {
965 report = dart.notNull(report) + ` (at line ${lineNum}, character ${dart. notNull(offset) - dart.notNull(lineStart) + 1})\n`; 965 report = dart.notNull(report) + ` (at line ${lineNum}, character ${dart. notNull(offset) - dart.notNull(lineStart) + 1})\n`;
966 } else { 966 } else {
967 report = dart.notNull(report) + ` (at character ${dart.notNull(offset) + 1})\n`; 967 report = dart.notNull(report) + ` (at character ${dart.notNull(offset) + 1})\n`;
968 } 968 }
969 let lineEnd = dart.as(dart.dload(this.source, 'length'), int); 969 let lineEnd = dart.as(dart.dload(this.source, 'length'), int);
970 for (let i = offset; int['<'](i, dart.dload(this.source, 'length')); i = d art.notNull(i) + 1) { 970 for (let i = offset; i['<'](dart.dload(this.source, 'length')); i = dart.n otNull(i) + 1) {
971 let char = dart.as(dart.dsend(this.source, 'codeUnitAt', i), int); 971 let char = dart.as(dart.dsend(this.source, 'codeUnitAt', i), int);
972 if (char == 10 || char == 13) { 972 if (char == 10 || char == 13) {
973 lineEnd = i; 973 lineEnd = i;
974 break; 974 break;
975 } 975 }
976 } 976 }
977 let length = dart.notNull(lineEnd) - dart.notNull(lineStart); 977 let length = dart.notNull(lineEnd) - dart.notNull(lineStart);
978 let start = lineStart; 978 let start = lineStart;
979 let end = lineEnd; 979 let end = lineEnd;
980 let prefix = ""; 980 let prefix = "";
981 let postfix = ""; 981 let postfix = "";
982 if (dart.notNull(length) > 78) { 982 if (dart.notNull(length) > 78) {
983 let index = dart.notNull(offset) - dart.notNull(lineStart); 983 let index = dart.notNull(offset) - dart.notNull(lineStart);
984 if (dart.notNull(index) < 75) { 984 if (dart.notNull(index) < 75) {
985 end = dart.notNull(start) + 75; 985 end = dart.notNull(start) + 75;
986 postfix = "..."; 986 postfix = "...";
987 } else if (dart.notNull(end) - dart.notNull(offset) < 75) { 987 } else if (dart.notNull(end) - dart.notNull(offset) < 75) {
988 start = dart.notNull(end) - 75; 988 start = dart.notNull(end) - 75;
989 prefix = "..."; 989 prefix = "...";
990 } else { 990 } else {
991 start = dart.notNull(offset) - 36; 991 start = dart.notNull(offset) - 36;
992 end = dart.notNull(offset) + 36; 992 end = dart.notNull(offset) + 36;
993 prefix = postfix = "..."; 993 prefix = postfix = "...";
994 } 994 }
995 } 995 }
996 let slice = dart.as(dart.dsend(this.source, 'substring', start, end), Stri ng); 996 let slice = dart.as(dart.dsend(this.source, 'substring', start, end), Stri ng);
997 let markOffset = dart.notNull(offset) - dart.notNull(start) + dart.notNull (prefix.length); 997 let markOffset = dart.notNull(offset) - dart.notNull(start) + dart.notNull (prefix.length);
998 return `${report}${prefix}${slice}${postfix}\n${String['*'](" ", markOffse t)}^\n`; 998 return `${report}${prefix}${slice}${postfix}\n${" "['*'](markOffset)}^\n`;
999 } 999 }
1000 } 1000 }
1001 FormatException[dart.implements] = () => [Exception]; 1001 FormatException[dart.implements] = () => [Exception];
1002 class IntegerDivisionByZeroException extends Object { 1002 class IntegerDivisionByZeroException extends Object {
1003 IntegerDivisionByZeroException() { 1003 IntegerDivisionByZeroException() {
1004 } 1004 }
1005 toString() { 1005 toString() {
1006 return "IntegerDivisionByZeroException"; 1006 return "IntegerDivisionByZeroException";
1007 } 1007 }
1008 } 1008 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 return Expando; 1047 return Expando;
1048 }); 1048 });
1049 let Expando = Expando$(); 1049 let Expando = Expando$();
1050 Expando._KEY_PROPERTY_NAME = 'expando$key'; 1050 Expando._KEY_PROPERTY_NAME = 'expando$key';
1051 Expando._EXPANDO_PROPERTY_NAME = 'expando$values'; 1051 Expando._EXPANDO_PROPERTY_NAME = 'expando$values';
1052 Expando._keyCount = 0; 1052 Expando._keyCount = 0;
1053 class Function extends Object { 1053 class Function extends Object {
1054 static apply(f, positionalArguments, namedArguments) { 1054 static apply(f, positionalArguments, namedArguments) {
1055 if (namedArguments === void 0) 1055 if (namedArguments === void 0)
1056 namedArguments = null; 1056 namedArguments = null;
1057 return _js_helper.Primitives.applyFunction(f, positionalArguments, namedAr guments == null ? null : Function._toMangledNames(namedArguments)); 1057 return dart.dcall.apply(null, [f].concat(positionalArguments));
1058 } 1058 }
1059 static _toMangledNames(namedArguments) { 1059 static _toMangledNames(namedArguments) {
1060 let result = dart.map(); 1060 let result = dart.map();
1061 namedArguments.forEach((symbol, value) => { 1061 namedArguments.forEach((symbol, value) => {
1062 result.set(_symbolToString(dart.as(symbol, Symbol)), value); 1062 result.set(_symbolToString(dart.as(symbol, Symbol)), value);
1063 }); 1063 });
1064 return result; 1064 return result;
1065 } 1065 }
1066 } 1066 }
1067 // Function identical: (Object, Object) → bool 1067 // Function identical: (Object, Object) → bool
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 if (length != 0 && dart.notNull(fill != null)) { 1286 if (length != 0 && dart.notNull(fill != null)) {
1287 for (let i = 0; dart.notNull(i) < dart.notNull(result[$length]); i = d art.notNull(i) + 1) { 1287 for (let i = 0; dart.notNull(i) < dart.notNull(result[$length]); i = d art.notNull(i) + 1) {
1288 result[$set](i, fill); 1288 result[$set](i, fill);
1289 } 1289 }
1290 } 1290 }
1291 return result; 1291 return result;
1292 } 1292 }
1293 from(elements, opts) { 1293 from(elements, opts) {
1294 let growable = opts && 'growable' in opts ? opts.growable : true; 1294 let growable = opts && 'growable' in opts ? opts.growable : true;
1295 let list = new (List$(E))(); 1295 let list = new (List$(E))();
1296 for (let e of dart.as(elements, Iterable$(E))) { 1296 for (let e of elements) {
1297 list[$add](e); 1297 list[$add](dart.as(e, E));
1298 } 1298 }
1299 if (growable) 1299 if (growable)
1300 return list; 1300 return list;
1301 return dart.as(_internal.makeListFixedLength(list), List$(E)); 1301 return dart.as(_internal.makeListFixedLength(list), List$(E));
1302 } 1302 }
1303 generate(length, generator, opts) { 1303 generate(length, generator, opts) {
1304 let growable = opts && 'growable' in opts ? opts.growable : true; 1304 let growable = opts && 'growable' in opts ? opts.growable : true;
1305 let result = null; 1305 let result = null;
1306 if (growable) { 1306 if (growable) {
1307 result = dart.setType([], List$(E)); 1307 result = dart.setType([], List$(E));
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 return this[$length] == 0; 1424 return this[$length] == 0;
1425 } 1425 }
1426 get [$isNotEmpty]() { 1426 get [$isNotEmpty]() {
1427 return !dart.notNull(this[$isEmpty]); 1427 return !dart.notNull(this[$isEmpty]);
1428 } 1428 }
1429 [$toString]() { 1429 [$toString]() {
1430 return collection.ListBase.listToString(this); 1430 return collection.ListBase.listToString(this);
1431 } 1431 }
1432 [$toList](opts) { 1432 [$toList](opts) {
1433 let growable = opts && 'growable' in opts ? opts.growable : true; 1433 let growable = opts && 'growable' in opts ? opts.growable : true;
1434 if (growable) { 1434 return dart.as(dart.setType(this.slice(), core.List$(E)), List$(E));
1435 return new (_interceptors.JSArray$(E)).markGrowable(this.slice());
1436 } else {
1437 return new (_interceptors.JSArray$(E)).markFixed(this.slice());
1438 }
1439 } 1435 }
1440 [$toSet]() { 1436 [$toSet]() {
1441 return new (exports.Set$(E)).from(this); 1437 return new (exports.Set$(E)).from(this);
1442 } 1438 }
1443 get [$iterator]() { 1439 get [$iterator]() {
1444 return new (_internal.ListIterator$(E))(this); 1440 return new (_internal.ListIterator$(E))(this);
1445 } 1441 }
1446 get [$hashCode]() { 1442 get [$hashCode]() {
1447 return _js_helper.Primitives.objectHashCode(this); 1443 return _js_helper.Primitives.objectHashCode(this);
1448 } 1444 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 get current() { 1915 get current() {
1920 return this[_currentCodePoint]; 1916 return this[_currentCodePoint];
1921 } 1917 }
1922 get currentSize() { 1918 get currentSize() {
1923 return dart.notNull(this[_nextPosition]) - dart.notNull(this[_position]); 1919 return dart.notNull(this[_nextPosition]) - dart.notNull(this[_position]);
1924 } 1920 }
1925 get currentAsString() { 1921 get currentAsString() {
1926 if (this[_position] == this[_nextPosition]) 1922 if (this[_position] == this[_nextPosition])
1927 return null; 1923 return null;
1928 if (dart.notNull(this[_position]) + 1 == this[_nextPosition]) 1924 if (dart.notNull(this[_position]) + 1 == this[_nextPosition])
1929 return String.get(this.string, this[_position]); 1925 return this.string.get(this[_position]);
1930 return this.string.substring(this[_position], this[_nextPosition]); 1926 return this.string.substring(this[_position], this[_nextPosition]);
1931 } 1927 }
1932 moveNext() { 1928 moveNext() {
1933 this[_position] = this[_nextPosition]; 1929 this[_position] = this[_nextPosition];
1934 if (this[_position] == this.string.length) { 1930 if (this[_position] == this.string.length) {
1935 this[_currentCodePoint] = null; 1931 this[_currentCodePoint] = null;
1936 return false; 1932 return false;
1937 } 1933 }
1938 let codeUnit = this.string.codeUnitAt(this[_position]); 1934 let codeUnit = this.string.codeUnitAt(this[_position]);
1939 let nextPosition = dart.notNull(this[_position]) + 1; 1935 let nextPosition = dart.notNull(this[_position]) + 1;
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 } else { 2408 } else {
2413 path = path.substring(4); 2409 path = path.substring(4);
2414 if (dart.notNull(path.length) < 3 || path.codeUnitAt(1) != Uri._COLON || path.codeUnitAt(2) != Uri._BACKSLASH) { 2410 if (dart.notNull(path.length) < 3 || path.codeUnitAt(1) != Uri._COLON || path.codeUnitAt(2) != Uri._BACKSLASH) {
2415 throw new ArgumentError("Windows paths with \\\\?\\ prefix must be a bsolute"); 2411 throw new ArgumentError("Windows paths with \\\\?\\ prefix must be a bsolute");
2416 } 2412 }
2417 } 2413 }
2418 } else { 2414 } else {
2419 path = path.replaceAll("/", "\\"); 2415 path = path.replaceAll("/", "\\");
2420 } 2416 }
2421 let sep = "\\"; 2417 let sep = "\\";
2422 if (dart.notNull(path.length) > 1 && String.get(path, 1) == ":") { 2418 if (dart.notNull(path.length) > 1 && path.get(1) == ":") {
2423 Uri._checkWindowsDriveLetter(path.codeUnitAt(0), true); 2419 Uri._checkWindowsDriveLetter(path.codeUnitAt(0), true);
2424 if (path.length == 2 || path.codeUnitAt(2) != Uri._BACKSLASH) { 2420 if (path.length == 2 || path.codeUnitAt(2) != Uri._BACKSLASH) {
2425 throw new ArgumentError("Windows paths with drive letter must be absol ute"); 2421 throw new ArgumentError("Windows paths with drive letter must be absol ute");
2426 } 2422 }
2427 let pathSegments = path.split(sep); 2423 let pathSegments = path.split(sep);
2428 Uri._checkWindowsPathReservedCharacters(pathSegments, true, 1); 2424 Uri._checkWindowsPathReservedCharacters(pathSegments, true, 1);
2429 return new Uri({scheme: "file", pathSegments: pathSegments}); 2425 return new Uri({scheme: "file", pathSegments: pathSegments});
2430 } 2426 }
2431 if (dart.notNull(path.length) > 0 && String.get(path, 0) == sep) { 2427 if (dart.notNull(path.length) > 0 && path.get(0) == sep) {
2432 if (dart.notNull(path.length) > 1 && String.get(path, 1) == sep) { 2428 if (dart.notNull(path.length) > 1 && path.get(1) == sep) {
2433 let pathStart = path.indexOf("\\", 2); 2429 let pathStart = path.indexOf("\\", 2);
2434 let hostPart = pathStart == -1 ? path.substring(2) : path.substring(2, pathStart); 2430 let hostPart = pathStart == -1 ? path.substring(2) : path.substring(2, pathStart);
2435 let pathPart = pathStart == -1 ? "" : path.substring(dart.notNull(path Start) + 1); 2431 let pathPart = pathStart == -1 ? "" : path.substring(dart.notNull(path Start) + 1);
2436 let pathSegments = pathPart.split(sep); 2432 let pathSegments = pathPart.split(sep);
2437 Uri._checkWindowsPathReservedCharacters(pathSegments, true); 2433 Uri._checkWindowsPathReservedCharacters(pathSegments, true);
2438 return new Uri({scheme: "file", host: hostPart, pathSegments: pathSegm ents}); 2434 return new Uri({scheme: "file", host: hostPart, pathSegments: pathSegm ents});
2439 } else { 2435 } else {
2440 let pathSegments = path.split(sep); 2436 let pathSegments = path.split(sep);
2441 Uri._checkWindowsPathReservedCharacters(pathSegments, true); 2437 Uri._checkWindowsPathReservedCharacters(pathSegments, true);
2442 return new Uri({scheme: "file", pathSegments: pathSegments}); 2438 return new Uri({scheme: "file", pathSegments: pathSegments});
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
3485 exports.Stopwatch = Stopwatch; 3481 exports.Stopwatch = Stopwatch;
3486 exports.String = String; 3482 exports.String = String;
3487 exports.RuneIterator = RuneIterator; 3483 exports.RuneIterator = RuneIterator;
3488 exports.StringBuffer = StringBuffer; 3484 exports.StringBuffer = StringBuffer;
3489 exports.StringSink = StringSink; 3485 exports.StringSink = StringSink;
3490 exports.Symbol = Symbol; 3486 exports.Symbol = Symbol;
3491 exports.Type = Type; 3487 exports.Type = Type;
3492 exports.Uri = Uri; 3488 exports.Uri = Uri;
3493 exports.SupportJsExtensionMethods = SupportJsExtensionMethods; 3489 exports.SupportJsExtensionMethods = SupportJsExtensionMethods;
3494 })(core, _js_helper, _internal, collection, _interceptors, convert); 3490 })(core, _js_helper, _internal, collection, _interceptors, convert);
OLDNEW
« no previous file with comments | « lib/runtime/dart/convert.js ('k') | lib/runtime/dart/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698