OLD | NEW |
1 var _js_helper = dart.defineLibrary(_js_helper, {}); | 1 var _js_helper = dart.defineLibrary(_js_helper, {}); |
2 var core = dart.import(core); | 2 var core = dart.import(core); |
3 var collection = dart.import(collection); | 3 var collection = dart.import(collection); |
4 var _internal = dart.import(_internal); | 4 var _internal = dart.import(_internal); |
5 var _foreign_helper = dart.import(_foreign_helper); | 5 var _foreign_helper = dart.import(_foreign_helper); |
6 var _js_embedded_names = dart.import(_js_embedded_names); | 6 var _js_embedded_names = dart.import(_js_embedded_names); |
7 var _interceptors = dart.lazyImport(_interceptors); | 7 var _interceptors = dart.lazyImport(_interceptors); |
8 var _js_names = dart.import(_js_names); | 8 var _js_names = dart.import(_js_names); |
9 var async = dart.import(async); | 9 var async = dart.import(async); |
10 var _isolate_helper = dart.lazyImport(_isolate_helper); | 10 var _isolate_helper = dart.lazyImport(_isolate_helper); |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 } | 952 } |
953 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI
ndex))); | 953 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI
ndex))); |
954 return dart.toString(buffer); | 954 return dart.toString(buffer); |
955 } | 955 } |
956 dart.fn(stringReplaceAllStringFuncUnchecked); | 956 dart.fn(stringReplaceAllStringFuncUnchecked); |
957 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) { | 957 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) { |
958 if (startIndex === void 0) | 958 if (startIndex === void 0) |
959 startIndex = 0; | 959 startIndex = 0; |
960 if (typeof from == 'string') { | 960 if (typeof from == 'string') { |
961 let index = dart.dsend(receiver, 'indexOf', from, startIndex); | 961 let index = dart.dsend(receiver, 'indexOf', from, startIndex); |
962 if (dart.dsend(index, '<', 0)) | 962 if (dart.as(dart.dsend(index, '<', 0), core.bool)) |
963 return receiver; | 963 return receiver; |
964 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse
nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`; | 964 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse
nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`; |
965 } else if (dart.is(from, JSSyntaxRegExp)) { | 965 } else if (dart.is(from, JSSyntaxRegExp)) { |
966 return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as
(from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startInd
ex); | 966 return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as
(from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startInd
ex); |
967 } else { | 967 } else { |
968 checkNull(from); | 968 checkNull(from); |
969 throw "String.replace(Pattern) UNIMPLEMENTED"; | 969 throw "String.replace(Pattern) UNIMPLEMENTED"; |
970 } | 970 } |
971 } | 971 } |
972 dart.fn(stringReplaceFirstUnchecked, core.Object, [core.Object, core.Object, c
ore.Object], [core.int]); | 972 dart.fn(stringReplaceFirstUnchecked, core.Object, [core.Object, core.Object, c
ore.Object], [core.int]); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 return isSupertypeOfNull(t); | 1209 return isSupertypeOfNull(t); |
1210 if (t == null) | 1210 if (t == null) |
1211 return true; | 1211 return true; |
1212 let rti = getRuntimeTypeInfo(o); | 1212 let rti = getRuntimeTypeInfo(o); |
1213 o = _interceptors.getInterceptor(o); | 1213 o = _interceptors.getInterceptor(o); |
1214 let type = o.constructor; | 1214 let type = o.constructor; |
1215 if (rti != null) { | 1215 if (rti != null) { |
1216 rti = rti.slice(); | 1216 rti = rti.slice(); |
1217 rti.splice(0, 0, type); | 1217 rti.splice(0, 0, type); |
1218 type = rti; | 1218 type = rti; |
1219 } else if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | 1219 } else if (dart.as(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`),
core.bool)) { |
1220 let signatureName = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}_${getField
(t, _foreign_helper.JS_FUNCTION_TYPE_TAG())}`; | 1220 let signatureName = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}_${getField
(t, _foreign_helper.JS_FUNCTION_TYPE_TAG())}`; |
1221 if (hasField(o, signatureName)) | 1221 if (dart.as(hasField(o, signatureName), core.bool)) |
1222 return true; | 1222 return true; |
1223 let targetSignatureFunction = getField(o, `${_foreign_helper.JS_SIGNATURE_
NAME()}`); | 1223 let targetSignatureFunction = getField(o, `${_foreign_helper.JS_SIGNATURE_
NAME()}`); |
1224 if (targetSignatureFunction == null) | 1224 if (targetSignatureFunction == null) |
1225 return false; | 1225 return false; |
1226 type = invokeOn(targetSignatureFunction, o, null); | 1226 type = invokeOn(targetSignatureFunction, o, null); |
1227 return isFunctionSubtype(type, t); | 1227 return isFunctionSubtype(type, t); |
1228 } | 1228 } |
1229 return isSubtype(type, t); | 1229 return isSubtype(type, t); |
1230 } | 1230 } |
1231 dart.fn(checkSubtypeOfRuntimeType, core.bool, [core.Object, core.Object]); | 1231 dart.fn(checkSubtypeOfRuntimeType, core.bool, [core.Object, core.Object]); |
(...skipping 14 matching lines...) Expand all Loading... |
1246 dart.fn(assertSubtypeOfRuntimeType, core.Object, [core.Object, core.Object]); | 1246 dart.fn(assertSubtypeOfRuntimeType, core.Object, [core.Object, core.Object]); |
1247 function getArguments(type) { | 1247 function getArguments(type) { |
1248 return isJsArray(type) ? type.slice(1) : null; | 1248 return isJsArray(type) ? type.slice(1) : null; |
1249 } | 1249 } |
1250 dart.fn(getArguments); | 1250 dart.fn(getArguments); |
1251 function isSubtype(s, t) { | 1251 function isSubtype(s, t) { |
1252 if (isIdentical(s, t)) | 1252 if (isIdentical(s, t)) |
1253 return true; | 1253 return true; |
1254 if (dart.notNull(s == null) || dart.notNull(t == null)) | 1254 if (dart.notNull(s == null) || dart.notNull(t == null)) |
1255 return true; | 1255 return true; |
1256 if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | 1256 if (dart.as(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`), core.b
ool)) { |
1257 return isFunctionSubtype(s, t); | 1257 return isFunctionSubtype(s, t); |
1258 } | 1258 } |
1259 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | 1259 if (dart.as(hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`), core.b
ool)) { |
1260 return getConstructorName(t) == _foreign_helper.JS_FUNCTION_CLASS_NAME(); | 1260 return getConstructorName(t) == _foreign_helper.JS_FUNCTION_CLASS_NAME(); |
1261 } | 1261 } |
1262 let typeOfS = isJsArray(s) ? getIndex(s, 0) : s; | 1262 let typeOfS = isJsArray(s) ? getIndex(s, 0) : s; |
1263 let typeOfT = isJsArray(t) ? getIndex(t, 0) : t; | 1263 let typeOfT = isJsArray(t) ? getIndex(t, 0) : t; |
1264 let name = runtimeTypeToString(typeOfT); | 1264 let name = runtimeTypeToString(typeOfT); |
1265 let substitution = null; | 1265 let substitution = null; |
1266 if (isNotIdentical(typeOfT, typeOfS)) { | 1266 if (isNotIdentical(typeOfT, typeOfS)) { |
1267 let test = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}${name}`; | 1267 let test = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}${name}`; |
1268 let typeOfSPrototype = typeOfS.prototype; | 1268 let typeOfSPrototype = typeOfS.prototype; |
1269 if (hasNoField(typeOfSPrototype, test)) | 1269 if (dart.as(hasNoField(typeOfSPrototype, test), core.bool)) |
1270 return false; | 1270 return false; |
1271 let field = `${_foreign_helper.JS_OPERATOR_AS_PREFIX()}${runtimeTypeToStri
ng(typeOfT)}`; | 1271 let field = `${_foreign_helper.JS_OPERATOR_AS_PREFIX()}${runtimeTypeToStri
ng(typeOfT)}`; |
1272 substitution = getField(typeOfSPrototype, field); | 1272 substitution = getField(typeOfSPrototype, field); |
1273 } | 1273 } |
1274 if (!dart.notNull(isJsArray(s)) && dart.notNull(substitution == null) || !da
rt.notNull(isJsArray(t))) { | 1274 if (!dart.notNull(isJsArray(s)) && dart.notNull(substitution == null) || !da
rt.notNull(isJsArray(t))) { |
1275 return true; | 1275 return true; |
1276 } | 1276 } |
1277 return checkArguments(substitution, getArguments(s), getArguments(t)); | 1277 return checkArguments(substitution, getArguments(s), getArguments(t)); |
1278 } | 1278 } |
1279 dart.fn(isSubtype, core.bool, [core.Object, core.Object]); | 1279 dart.fn(isSubtype, core.bool, [core.Object, core.Object]); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 let tType = t[name]; | 1323 let tType = t[name]; |
1324 let sType = s[name]; | 1324 let sType = s[name]; |
1325 if (!dart.notNull(isAssignable(tType, sType))) | 1325 if (!dart.notNull(isAssignable(tType, sType))) |
1326 return false; | 1326 return false; |
1327 } | 1327 } |
1328 return true; | 1328 return true; |
1329 } | 1329 } |
1330 dart.fn(areAssignableMaps, core.bool, [core.Object, core.Object]); | 1330 dart.fn(areAssignableMaps, core.bool, [core.Object, core.Object]); |
1331 function isFunctionSubtype(s, t) { | 1331 function isFunctionSubtype(s, t) { |
1332 dart.assert(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)); | 1332 dart.assert(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)); |
1333 if (hasNoField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) | 1333 if (dart.as(hasNoField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`), core
.bool)) |
1334 return false; | 1334 return false; |
1335 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()}`)) { | 1335 if (dart.as(hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG(
)}`), core.bool)) { |
1336 if (dart.notNull(dart.as(hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE
_VOID_RETURN_TAG()}`), core.bool)) && dart.notNull(dart.as(hasField(t, `${_forei
gn_helper.JS_FUNCTION_TYPE_RETURN_TYPE_TAG()}`), core.bool))) { | 1336 if (dart.notNull(dart.as(hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE
_VOID_RETURN_TAG()}`), core.bool)) && dart.notNull(dart.as(hasField(t, `${_forei
gn_helper.JS_FUNCTION_TYPE_RETURN_TYPE_TAG()}`), core.bool))) { |
1337 return false; | 1337 return false; |
1338 } | 1338 } |
1339 } else if (hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG
()}`)) { | 1339 } else if (dart.as(hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RE
TURN_TAG()}`), core.bool)) { |
1340 let sReturnType = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); | 1340 let sReturnType = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); |
1341 let tReturnType = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); | 1341 let tReturnType = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); |
1342 if (!dart.notNull(isAssignable(sReturnType, tReturnType))) | 1342 if (!dart.notNull(isAssignable(sReturnType, tReturnType))) |
1343 return false; | 1343 return false; |
1344 } | 1344 } |
1345 let sParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); | 1345 let sParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); |
1346 let tParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); | 1346 let tParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); |
1347 let sOptionalParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); | 1347 let sOptionalParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); |
1348 let tOptionalParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); | 1348 let tOptionalParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); |
1349 let sParametersLen = sParameterTypes != null ? getLength(sParameterTypes) :
0; | 1349 let sParametersLen = sParameterTypes != null ? getLength(sParameterTypes) :
0; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 dart.fn(getLength, core.int, [core.Object]); | 1418 dart.fn(getLength, core.int, [core.Object]); |
1419 function isJsArray(value) { | 1419 function isJsArray(value) { |
1420 return dart.is(value, _interceptors.JSArray); | 1420 return dart.is(value, _interceptors.JSArray); |
1421 } | 1421 } |
1422 dart.fn(isJsArray, core.bool, [core.Object]); | 1422 dart.fn(isJsArray, core.bool, [core.Object]); |
1423 function hasField(object, name) { | 1423 function hasField(object, name) { |
1424 return name in object; | 1424 return name in object; |
1425 } | 1425 } |
1426 dart.fn(hasField); | 1426 dart.fn(hasField); |
1427 function hasNoField(object, name) { | 1427 function hasNoField(object, name) { |
1428 return dart.dsend(hasField(object, name), '!'); | 1428 return !dart.notNull(dart.as(hasField(object, name), core.bool)); |
1429 } | 1429 } |
1430 dart.fn(hasNoField); | 1430 dart.fn(hasNoField); |
1431 function isJsFunction(o) { | 1431 function isJsFunction(o) { |
1432 return typeof o == "function"; | 1432 return typeof o == "function"; |
1433 } | 1433 } |
1434 dart.fn(isJsFunction, core.bool, [core.Object]); | 1434 dart.fn(isJsFunction, core.bool, [core.Object]); |
1435 function isJsObject(o) { | 1435 function isJsObject(o) { |
1436 return typeof o == 'object'; | 1436 return typeof o == 'object'; |
1437 } | 1437 } |
1438 dart.fn(isJsObject, core.bool, [core.Object]); | 1438 dart.fn(isJsObject, core.bool, [core.Object]); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 return new CachedCatchAllInvocation(name, method, isIntercepted, dart.
as(interceptor, _interceptors.Interceptor)); | 1620 return new CachedCatchAllInvocation(name, method, isIntercepted, dart.
as(interceptor, _interceptors.Interceptor)); |
1621 } else { | 1621 } else { |
1622 return new CachedInvocation(name, method, isIntercepted, dart.as(inter
ceptor, _interceptors.Interceptor)); | 1622 return new CachedInvocation(name, method, isIntercepted, dart.as(inter
ceptor, _interceptors.Interceptor)); |
1623 } | 1623 } |
1624 } else { | 1624 } else { |
1625 return new CachedNoSuchMethodInvocation(interceptor); | 1625 return new CachedNoSuchMethodInvocation(interceptor); |
1626 } | 1626 } |
1627 } | 1627 } |
1628 static invokeFromMirror(invocation, victim) { | 1628 static invokeFromMirror(invocation, victim) { |
1629 let cached = invocation[_getCachedInvocation](victim); | 1629 let cached = invocation[_getCachedInvocation](victim); |
1630 if (dart.dload(cached, 'isNoSuchMethod')) { | 1630 if (dart.as(dart.dload(cached, 'isNoSuchMethod'), core.bool)) { |
1631 return dart.dsend(cached, 'invokeOn', victim, invocation); | 1631 return dart.dsend(cached, 'invokeOn', victim, invocation); |
1632 } else { | 1632 } else { |
1633 return dart.dsend(cached, 'invokeOn', victim, invocation[_arguments]); | 1633 return dart.dsend(cached, 'invokeOn', victim, invocation[_arguments]); |
1634 } | 1634 } |
1635 } | 1635 } |
1636 static getCachedInvocation(invocation, victim) { | 1636 static getCachedInvocation(invocation, victim) { |
1637 return invocation[_getCachedInvocation](victim); | 1637 return invocation[_getCachedInvocation](victim); |
1638 } | 1638 } |
1639 } | 1639 } |
1640 JSInvocationMirror[dart.implements] = () => [core.Invocation]; | 1640 JSInvocationMirror[dart.implements] = () => [core.Invocation]; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 } | 2023 } |
2024 result = result + String.fromCharCode.apply(null, subarray); | 2024 result = result + String.fromCharCode.apply(null, subarray); |
2025 } | 2025 } |
2026 return result; | 2026 return result; |
2027 } | 2027 } |
2028 static stringFromCodePoints(codePoints) { | 2028 static stringFromCodePoints(codePoints) { |
2029 let a = dart.setType([], core.List$(core.int)); | 2029 let a = dart.setType([], core.List$(core.int)); |
2030 for (let i of dart.as(codePoints, core.Iterable)) { | 2030 for (let i of dart.as(codePoints, core.Iterable)) { |
2031 if (!(typeof i == 'number')) | 2031 if (!(typeof i == 'number')) |
2032 throw new core.ArgumentError(i); | 2032 throw new core.ArgumentError(i); |
2033 if (dart.dsend(i, '<=', 65535)) { | 2033 if (dart.as(dart.dsend(i, '<=', 65535), core.bool)) { |
2034 a[core.$add](dart.as(i, core.int)); | 2034 a[core.$add](dart.as(i, core.int)); |
2035 } else if (dart.dsend(i, '<=', 1114111)) { | 2035 } else if (dart.as(dart.dsend(i, '<=', 1114111), core.bool)) { |
2036 a[core.$add]((55296)['+'](dart.as(dart.dsend(dart.dsend(dart.dsend(i,
'-', 65536), '>>', 10), '&', 1023), core.num))); | 2036 a[core.$add]((55296)['+'](dart.as(dart.dsend(dart.dsend(dart.dsend(i,
'-', 65536), '>>', 10), '&', 1023), core.num))); |
2037 a[core.$add]((56320)['+'](dart.as(dart.dsend(i, '&', 1023), core.num))
); | 2037 a[core.$add]((56320)['+'](dart.as(dart.dsend(i, '&', 1023), core.num))
); |
2038 } else { | 2038 } else { |
2039 throw new core.ArgumentError(i); | 2039 throw new core.ArgumentError(i); |
2040 } | 2040 } |
2041 } | 2041 } |
2042 return Primitives._fromCharCodeApply(a); | 2042 return Primitives._fromCharCodeApply(a); |
2043 } | 2043 } |
2044 static stringFromCharCodes(charCodes) { | 2044 static stringFromCharCodes(charCodes) { |
2045 for (let i of dart.as(charCodes, core.Iterable)) { | 2045 for (let i of dart.as(charCodes, core.Iterable)) { |
2046 if (!(typeof i == 'number')) | 2046 if (!(typeof i == 'number')) |
2047 throw new core.ArgumentError(i); | 2047 throw new core.ArgumentError(i); |
2048 if (dart.dsend(i, '<', 0)) | 2048 if (dart.as(dart.dsend(i, '<', 0), core.bool)) |
2049 throw new core.ArgumentError(i); | 2049 throw new core.ArgumentError(i); |
2050 if (dart.dsend(i, '>', 65535)) | 2050 if (dart.as(dart.dsend(i, '>', 65535), core.bool)) |
2051 return Primitives.stringFromCodePoints(charCodes); | 2051 return Primitives.stringFromCodePoints(charCodes); |
2052 } | 2052 } |
2053 return Primitives._fromCharCodeApply(dart.as(charCodes, core.List$(core.in
t))); | 2053 return Primitives._fromCharCodeApply(dart.as(charCodes, core.List$(core.in
t))); |
2054 } | 2054 } |
2055 static stringFromCharCode(charCode) { | 2055 static stringFromCharCode(charCode) { |
2056 if (0 <= dart.notNull(dart.as(charCode, core.num))) { | 2056 if (0 <= dart.notNull(dart.as(charCode, core.num))) { |
2057 if (dart.dsend(charCode, '<=', 65535)) { | 2057 if (dart.as(dart.dsend(charCode, '<=', 65535), core.bool)) { |
2058 return String.fromCharCode(charCode); | 2058 return String.fromCharCode(charCode); |
2059 } | 2059 } |
2060 if (dart.dsend(charCode, '<=', 1114111)) { | 2060 if (dart.as(dart.dsend(charCode, '<=', 1114111), core.bool)) { |
2061 let bits = dart.dsend(charCode, '-', 65536); | 2061 let bits = dart.dsend(charCode, '-', 65536); |
2062 let low = (56320)['|'](dart.as(dart.dsend(bits, '&', 1023), core.int))
; | 2062 let low = (56320)['|'](dart.as(dart.dsend(bits, '&', 1023), core.int))
; |
2063 let high = (55296)['|'](dart.as(dart.dsend(bits, '>>', 10), core.int))
; | 2063 let high = (55296)['|'](dart.as(dart.dsend(bits, '>>', 10), core.int))
; |
2064 return String.fromCharCode(high, low); | 2064 return String.fromCharCode(high, low); |
2065 } | 2065 } |
2066 } | 2066 } |
2067 throw new core.RangeError.range(dart.as(charCode, core.num), 0, 1114111); | 2067 throw new core.RangeError.range(dart.as(charCode, core.num), 0, 1114111); |
2068 } | 2068 } |
2069 static stringConcatUnchecked(string1, string2) { | 2069 static stringConcatUnchecked(string1, string2) { |
2070 return _foreign_helper.JS_STRING_CONCAT(string1, string2); | 2070 return _foreign_helper.JS_STRING_CONCAT(string1, string2); |
(...skipping 22 matching lines...) Expand all Loading... |
2093 checkInt(years); | 2093 checkInt(years); |
2094 checkInt(month); | 2094 checkInt(month); |
2095 checkInt(day); | 2095 checkInt(day); |
2096 checkInt(hours); | 2096 checkInt(hours); |
2097 checkInt(minutes); | 2097 checkInt(minutes); |
2098 checkInt(seconds); | 2098 checkInt(seconds); |
2099 checkInt(milliseconds); | 2099 checkInt(milliseconds); |
2100 checkBool(isUtc); | 2100 checkBool(isUtc); |
2101 let jsMonth = dart.dsend(month, '-', 1); | 2101 let jsMonth = dart.dsend(month, '-', 1); |
2102 let value = null; | 2102 let value = null; |
2103 if (isUtc) { | 2103 if (dart.as(isUtc, core.bool)) { |
2104 value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseco
nds); | 2104 value = Date.UTC(years, jsMonth, day, hours, minutes, seconds, milliseco
nds); |
2105 } else { | 2105 } else { |
2106 value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseco
nds).valueOf(); | 2106 value = new Date(years, jsMonth, day, hours, minutes, seconds, milliseco
nds).valueOf(); |
2107 } | 2107 } |
2108 if (dart.notNull(dart.as(dart.dload(value, 'isNaN'), core.bool)) || dart.n
otNull(dart.as(dart.dsend(value, '<', -dart.notNull(MAX_MILLISECONDS_SINCE_EPOCH
)), core.bool)) || dart.notNull(dart.as(dart.dsend(value, '>', MAX_MILLISECONDS_
SINCE_EPOCH), core.bool))) { | 2108 if (dart.notNull(dart.as(dart.dload(value, 'isNaN'), core.bool)) || dart.n
otNull(dart.as(dart.dsend(value, '<', -dart.notNull(MAX_MILLISECONDS_SINCE_EPOCH
)), core.bool)) || dart.notNull(dart.as(dart.dsend(value, '>', MAX_MILLISECONDS_
SINCE_EPOCH), core.bool))) { |
2109 return null; | 2109 return null; |
2110 } | 2110 } |
2111 if (dart.notNull(dart.as(dart.dsend(years, '<=', 0), core.bool)) || dart.n
otNull(dart.as(dart.dsend(years, '<', 100), core.bool))) | 2111 if (dart.notNull(dart.as(dart.dsend(years, '<=', 0), core.bool)) || dart.n
otNull(dart.as(dart.dsend(years, '<', 100), core.bool))) |
2112 return Primitives.patchUpY2K(value, years, isUtc); | 2112 return Primitives.patchUpY2K(value, years, isUtc); |
2113 return value; | 2113 return value; |
2114 } | 2114 } |
2115 static patchUpY2K(value, years, isUtc) { | 2115 static patchUpY2K(value, years, isUtc) { |
2116 let date = new Date(value); | 2116 let date = new Date(value); |
2117 if (isUtc) { | 2117 if (dart.as(isUtc, core.bool)) { |
2118 date.setUTCFullYear(years); | 2118 date.setUTCFullYear(years); |
2119 } else { | 2119 } else { |
2120 date.setFullYear(years); | 2120 date.setFullYear(years); |
2121 } | 2121 } |
2122 return date.valueOf(); | 2122 return date.valueOf(); |
2123 } | 2123 } |
2124 static lazyAsJsDate(receiver) { | 2124 static lazyAsJsDate(receiver) { |
2125 if (receiver.date === void 0) { | 2125 if (receiver.date === void 0) { |
2126 receiver.date = new Date(dart.dload(receiver, 'millisecondsSinceEpoch'))
; | 2126 receiver.date = new Date(dart.dload(receiver, 'millisecondsSinceEpoch'))
; |
2127 } | 2127 } |
2128 return receiver.date; | 2128 return receiver.date; |
2129 } | 2129 } |
2130 static getYear(receiver) { | 2130 static getYear(receiver) { |
2131 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCFullYear() + 0 : Primitives.lazyAsJsDate(receiver).getFullYear() + 0; | 2131 return dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitives.lazy
AsJsDate(receiver).getUTCFullYear() + 0 : Primitives.lazyAsJsDate(receiver).getF
ullYear() + 0; |
2132 } | 2132 } |
2133 static getMonth(receiver) { | 2133 static getMonth(receiver) { |
2134 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCMonth() + 1 : Primitives.lazyAsJsDate(receiver).getMonth() + 1; | 2134 return dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitives.lazy
AsJsDate(receiver).getUTCMonth() + 1 : Primitives.lazyAsJsDate(receiver).getMont
h() + 1; |
2135 } | 2135 } |
2136 static getDay(receiver) { | 2136 static getDay(receiver) { |
2137 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCDate() + 0 : Primitives.lazyAsJsDate(receiver).getDate() + 0; | 2137 return dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitives.lazy
AsJsDate(receiver).getUTCDate() + 0 : Primitives.lazyAsJsDate(receiver).getDate(
) + 0; |
2138 } | 2138 } |
2139 static getHours(receiver) { | 2139 static getHours(receiver) { |
2140 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCHours() + 0 : Primitives.lazyAsJsDate(receiver).getHours() + 0; | 2140 return dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitives.lazy
AsJsDate(receiver).getUTCHours() + 0 : Primitives.lazyAsJsDate(receiver).getHour
s() + 0; |
2141 } | 2141 } |
2142 static getMinutes(receiver) { | 2142 static getMinutes(receiver) { |
2143 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCMinutes() + 0 : Primitives.lazyAsJsDate(receiver).getMinutes() + 0; | 2143 return dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitives.lazy
AsJsDate(receiver).getUTCMinutes() + 0 : Primitives.lazyAsJsDate(receiver).getMi
nutes() + 0; |
2144 } | 2144 } |
2145 static getSeconds(receiver) { | 2145 static getSeconds(receiver) { |
2146 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCSeconds() + 0 : Primitives.lazyAsJsDate(receiver).getSeconds() + 0; | 2146 return dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitives.lazy
AsJsDate(receiver).getUTCSeconds() + 0 : Primitives.lazyAsJsDate(receiver).getSe
conds() + 0; |
2147 } | 2147 } |
2148 static getMilliseconds(receiver) { | 2148 static getMilliseconds(receiver) { |
2149 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCMilliseconds() + 0 : Primitives.lazyAsJsDate(receiver).getMilliseconds() +
0; | 2149 return dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitives.lazy
AsJsDate(receiver).getUTCMilliseconds() + 0 : Primitives.lazyAsJsDate(receiver).
getMilliseconds() + 0; |
2150 } | 2150 } |
2151 static getWeekday(receiver) { | 2151 static getWeekday(receiver) { |
2152 let weekday = dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(rece
iver).getUTCDay() + 0 : Primitives.lazyAsJsDate(receiver).getDay() + 0; | 2152 let weekday = dart.as(dart.dload(receiver, 'isUtc'), core.bool) ? Primitiv
es.lazyAsJsDate(receiver).getUTCDay() + 0 : Primitives.lazyAsJsDate(receiver).ge
tDay() + 0; |
2153 return (dart.notNull(weekday) + 6) % 7 + 1; | 2153 return (dart.notNull(weekday) + 6) % 7 + 1; |
2154 } | 2154 } |
2155 static valueFromDateString(str) { | 2155 static valueFromDateString(str) { |
2156 if (!(typeof str == 'string')) | 2156 if (!(typeof str == 'string')) |
2157 throw new core.ArgumentError(str); | 2157 throw new core.ArgumentError(str); |
2158 let value = Date.parse(str); | 2158 let value = Date.parse(str); |
2159 if (value.isNaN) | 2159 if (value.isNaN) |
2160 throw new core.ArgumentError(str); | 2160 throw new core.ArgumentError(str); |
2161 return value; | 2161 return value; |
2162 } | 2162 } |
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4380 exports.jsonEncodeNative = jsonEncodeNative; | 4380 exports.jsonEncodeNative = jsonEncodeNative; |
4381 exports.getIsolateAffinityTag = getIsolateAffinityTag; | 4381 exports.getIsolateAffinityTag = getIsolateAffinityTag; |
4382 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; | 4382 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; |
4383 exports.DeferredLoadCallback = DeferredLoadCallback; | 4383 exports.DeferredLoadCallback = DeferredLoadCallback; |
4384 exports.loadDeferredLibrary = loadDeferredLibrary; | 4384 exports.loadDeferredLibrary = loadDeferredLibrary; |
4385 exports.MainError = MainError; | 4385 exports.MainError = MainError; |
4386 exports.missingMain = missingMain; | 4386 exports.missingMain = missingMain; |
4387 exports.badMain = badMain; | 4387 exports.badMain = badMain; |
4388 exports.mainHasTooManyParameters = mainHasTooManyParameters; | 4388 exports.mainHasTooManyParameters = mainHasTooManyParameters; |
4389 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names,
_interceptors, _js_names, async, _isolate_helper); | 4389 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names,
_interceptors, _js_names, async, _isolate_helper); |
OLD | NEW |