Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Generated by dart2js (fast startup emitter, strong), the Dart to JavaScript compiler version: 2.7.0-edge.5b7c981086141d367077c9b9a8efdb7e9fc5d784.
- // The code supports the following hooks:
- // dartPrint(message):
- // if this function is defined it is called instead of the Dart [print]
- // method.
- //
- // dartMainRunner(main, args):
- // if this function is defined, the Dart [main] method will not be invoked
- // directly. Instead, a closure that will invoke [main], and its arguments
- // [args] is passed to [dartMainRunner].
- //
- // dartDeferredLibraryLoader(uri, successCallback, errorCallback):
- // if this function is defined, it will be called when a deferred library
- // is loaded. It should load and eval the javascript of `uri`, and call
- // successCallback. If it fails to do so, it should call errorCallback with
- // an error.
- //
- // dartCallInstrumentation(id, qualifiedName):
- // if this function is defined, it will be called at each entry of a
- // method or constructor. Used only when compiling programs with
- // --experiment-call-instrumentation.
- {
- }
- (function dartProgram() {
- function copyProperties(from, to) {
- var keys = Object.keys(from);
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- to[key] = from[key];
- }
- }
- var supportsDirectProtoAccess = function() {
- var cls = function() {
- };
- cls.prototype = {p: {}};
- var object = new cls();
- if (!(object.__proto__ && object.__proto__.p === cls.prototype.p))
- return false;
- try {
- if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0)
- return true;
- if (typeof version == "function" && version.length == 0) {
- var v = version();
- if (/^\d+\.\d+\.\d+\.\d+$/.test(v))
- return true;
- }
- } catch (_) {
- }
- return false;
- }();
- function setFunctionNamesIfNecessary(holders) {
- function t() {
- }
- ;
- if (typeof t.name == "string")
- return;
- for (var i = 0; i < holders.length; i++) {
- var holder = holders[i];
- var keys = Object.keys(holder);
- for (var j = 0; j < keys.length; j++) {
- var key = keys[j];
- var f = holder[key];
- if (typeof f == 'function')
- f.name = key;
- }
- }
- }
- function inherit(cls, sup) {
- cls.prototype.constructor = cls;
- cls.prototype["$is" + cls.name] = cls;
- if (sup != null) {
- if (supportsDirectProtoAccess) {
- cls.prototype.__proto__ = sup.prototype;
- return;
- }
- var clsPrototype = Object.create(sup.prototype);
- copyProperties(cls.prototype, clsPrototype);
- cls.prototype = clsPrototype;
- }
- }
- function inheritMany(sup, classes) {
- for (var i = 0; i < classes.length; i++)
- inherit(classes[i], sup);
- }
- function mixin(cls, mixin) {
- copyProperties(mixin.prototype, cls.prototype);
- cls.prototype.constructor = cls;
- }
- function lazy(holder, name, getterName, initializer) {
- var uninitializedSentinel = holder;
- holder[name] = uninitializedSentinel;
- holder[getterName] = function() {
- holder[getterName] = function() {
- H.throwCyclicInit(name);
- };
- var result;
- var sentinelInProgress = initializer;
- try {
- if (holder[name] === uninitializedSentinel) {
- result = holder[name] = sentinelInProgress;
- result = holder[name] = initializer();
- } else
- result = holder[name];
- } finally {
- if (result === sentinelInProgress)
- holder[name] = null;
- holder[getterName] = function() {
- return this[name];
- };
- }
- return result;
- };
- }
- function makeConstList(list) {
- list.immutable$list = Array;
- list.fixed$length = Array;
- return list;
- }
- function convertToFastObject(properties) {
- function t() {
- }
- t.prototype = properties;
- new t();
- return properties;
- }
- function convertAllToFastObject(arrayOfObjects) {
- for (var i = 0; i < arrayOfObjects.length; ++i)
- convertToFastObject(arrayOfObjects[i]);
- }
- var functionCounter = 0;
- function tearOffGetter(funcs, applyTrampolineIndex, reflectionInfo, name, isIntercepted) {
- return isIntercepted ? new Function("funcs", "applyTrampolineIndex", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "(receiver) {" + "if (c === null) c = " + "H.closureFromTearOff" + "(" + "this, funcs, applyTrampolineIndex, reflectionInfo, false, true, name);" + "return new c(this, funcs[0], receiver, name);" + "}")(funcs, applyTrampolineIndex, reflectionInfo, name, H, null) : new Function("funcs", "applyTrampolineIndex", "reflectionInfo", "name", "H", "c", "return function tearOff_" + name + functionCounter++ + "() {" + "if (c === null) c = " + "H.closureFromTearOff" + "(" + "this, funcs, applyTrampolineIndex, reflectionInfo, false, false, name);" + "return new c(this, funcs[0], null, name);" + "}")(funcs, applyTrampolineIndex, reflectionInfo, name, H, null);
- }
- function tearOff(funcs, applyTrampolineIndex, reflectionInfo, isStatic, name, isIntercepted) {
- var cache = null;
- return isStatic ? function() {
- if (cache === null)
- cache = H.closureFromTearOff(this, funcs, applyTrampolineIndex, reflectionInfo, true, false, name).prototype;
- return cache;
- } : tearOffGetter(funcs, applyTrampolineIndex, reflectionInfo, name, isIntercepted);
- }
- var typesOffset = 0;
- function installTearOff(container, getterName, isStatic, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) {
- var funs = [];
- for (var i = 0; i < funsOrNames.length; i++) {
- var fun = funsOrNames[i];
- if (typeof fun == 'string')
- fun = container[fun];
- fun.$callName = callNames[i];
- funs.push(fun);
- }
- var fun = funs[0];
- fun.$requiredArgCount = requiredParameterCount;
- fun.$defaultValues = optionalParameterDefaultValues;
- var reflectionInfo = funType;
- if (typeof reflectionInfo == "number")
- reflectionInfo += typesOffset;
- var name = funsOrNames[0];
- fun.$stubName = name;
- var getterFunction = tearOff(funs, applyIndex || 0, reflectionInfo, isStatic, name, isIntercepted);
- container[getterName] = getterFunction;
- if (isStatic)
- fun.$tearOff = getterFunction;
- }
- function installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) {
- return installTearOff(container, getterName, true, false, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex);
- }
- function installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) {
- return installTearOff(container, getterName, false, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex);
- }
- function setOrUpdateInterceptorsByTag(newTags) {
- var tags = init.interceptorsByTag;
- if (!tags) {
- init.interceptorsByTag = newTags;
- return;
- }
- copyProperties(newTags, tags);
- }
- function setOrUpdateLeafTags(newTags) {
- var tags = init.leafTags;
- if (!tags) {
- init.leafTags = newTags;
- return;
- }
- copyProperties(newTags, tags);
- }
- function updateTypes(newTypes) {
- var types = init.types;
- var length = types.length;
- types.push.apply(types, newTypes);
- return length;
- }
- function updateHolder(holder, newHolder) {
- copyProperties(newHolder, holder);
- return holder;
- }
- var hunkHelpers = function() {
- var mkInstance = function(isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) {
- return function(container, getterName, name, funType) {
- return installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex);
- };
- },
- mkStatic = function(requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) {
- return function(container, getterName, name, funType) {
- return installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex);
- };
- };
- return {inherit: inherit, inheritMany: inheritMany, mixin: mixin, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, _instance_0u: mkInstance(0, 0, null, ["call$0"], 0), _instance_1u: mkInstance(0, 1, null, ["call$1"], 0), _instance_2u: mkInstance(0, 2, null, ["call$2"], 0), _instance_0i: mkInstance(1, 0, null, ["call$0"], 0), _instance_1i: mkInstance(1, 1, null, ["call$1"], 0), _instance_2i: mkInstance(1, 2, null, ["call$2"], 0), _static_0: mkStatic(0, null, ["call$0"], 0), _static_1: mkStatic(1, null, ["call$1"], 0), _static_2: mkStatic(2, null, ["call$2"], 0), makeConstList: makeConstList, lazy: lazy, updateHolder: updateHolder, convertToFastObject: convertToFastObject, setFunctionNamesIfNecessary: setFunctionNamesIfNecessary, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags};
- }();
- function initializeDeferredHunk(hunk) {
- typesOffset = init.types.length;
- hunk(hunkHelpers, init, holders, $);
- }
- function getGlobalFromName(name) {
- for (var i = 0; i < holders.length; i++) {
- if (holders[i] == C)
- continue;
- if (holders[i][name])
- return holders[i][name];
- }
- }
- var C = {},
- H = {JS_CONST: function JS_CONST() {
- },
- unminifyOrTag: function(rawClassName) {
- var preserved = H.unmangleGlobalNameIfPreservedAnyways(rawClassName);
- if (typeof preserved === "string")
- return preserved;
- return rawClassName;
- },
- S: function(value) {
- var res;
- if (typeof value === "string")
- return value;
- if (typeof value === "number") {
- if (value !== 0)
- return "" + value;
- } else if (true === value)
- return "true";
- else if (false === value)
- return "false";
- else if (value == null)
- return "null";
- res = J.toString$0$(value);
- if (typeof res !== "string")
- throw H.wrapException(H.argumentErrorValue(value));
- return res;
- },
- Primitives_objectTypeName: function(object) {
- return H.Primitives__objectClassName(object) + H._joinArguments(H.getRuntimeTypeInfo(object), 0, null);
- },
- Primitives__objectClassName: function(object) {
- var interceptorConstructorName, $name, t1, dispatchName, objectConstructor, match, decompiledName, endIndex, _null = null,
- interceptor = J.getInterceptor$(object),
- interceptorConstructor = interceptor.constructor;
- if (typeof interceptorConstructor == "function") {
- interceptorConstructorName = interceptorConstructor.name;
- $name = typeof interceptorConstructorName === "string" ? interceptorConstructorName : _null;
- } else
- $name = _null;
- t1 = $name == null;
- if (t1 || interceptor === C.Interceptor_methods || false) {
- dispatchName = C.C_JS_CONST(object);
- if (t1)
- $name = dispatchName;
- if (dispatchName === "Object") {
- objectConstructor = object.constructor;
- if (typeof objectConstructor == "function") {
- match = String(objectConstructor).match(/^\s*function\s*([\w$]*)\s*\(/);
- decompiledName = match == null ? _null : match[1];
- if (typeof decompiledName === "string" && /^\w+$/.test(decompiledName))
- $name = decompiledName;
- }
- }
- return $name;
- }
- $name = $name;
- endIndex = $name.length;
- if (endIndex > 1 && C.JSString_methods._codeUnitAt$1($name, 0) === 36) {
- if (1 > endIndex)
- H.throwExpression(P.RangeError$value(1, _null));
- if (endIndex > endIndex)
- H.throwExpression(P.RangeError$value(endIndex, _null));
- $name = $name.substring(1, endIndex);
- }
- return H.unminifyOrTag($name);
- },
- ioore: function(receiver, index) {
- if (receiver == null)
- J.get$length$as(receiver);
- throw H.wrapException(H.diagnoseIndexError(receiver, index));
- },
- diagnoseIndexError: function(indexable, index) {
- var $length, _s5_ = "index";
- if (typeof index !== "number" || Math.floor(index) !== index)
- return new P.ArgumentError(index, _s5_, null);
- $length = J.get$length$as(indexable);
- if (index < 0 || index >= $length)
- return new P.IndexError($length, index, _s5_, "Index out of range");
- return P.RangeError$value(index, _s5_);
- },
- argumentErrorValue: function(object) {
- return new P.ArgumentError(object, null, null);
- },
- wrapException: function(ex) {
- var wrapper;
- if (ex == null)
- ex = new P.NullThrownError();
- wrapper = new Error();
- wrapper.dartException = ex;
- if ("defineProperty" in Object) {
- Object.defineProperty(wrapper, "message", {get: H.toStringWrapper});
- wrapper.name = "";
- } else
- wrapper.toString = H.toStringWrapper;
- return wrapper;
- },
- toStringWrapper: function() {
- return J.toString$0$(this.dartException);
- },
- throwExpression: function(ex) {
- throw H.wrapException(ex);
- },
- throwConcurrentModificationError: function(collection) {
- throw H.wrapException(new P.ConcurrentModificationError(collection));
- },
- stringTypeCheck: function(value) {
- if (value == null)
- return value;
- if (typeof value === "string")
- return value;
- throw H.wrapException(H.TypeErrorImplementation$(value, "String"));
- },
- numTypeCheck: function(value) {
- if (value == null)
- return value;
- if (typeof value === "number")
- return value;
- throw H.wrapException(H.TypeErrorImplementation$(value, "num"));
- },
- intTypeCheck: function(value) {
- if (value == null)
- return value;
- if (typeof value === "number" && Math.floor(value) === value)
- return value;
- throw H.wrapException(H.TypeErrorImplementation$(value, "int"));
- },
- extractFunctionTypeObjectFromInternal: function(o) {
- var signature;
- if ("$signature" in o) {
- signature = o.$signature;
- if (typeof signature == "number")
- return init.types[H.intTypeCheck(signature)];
- else
- return o.$signature();
- }
- return;
- },
- functionTypeTest: function(value, functionTypeRti) {
- var functionTypeObject;
- if (typeof value == "function")
- return true;
- functionTypeObject = H.extractFunctionTypeObjectFromInternal(J.getInterceptor$(value));
- if (functionTypeObject == null)
- return false;
- return H._isFunctionSubtype(functionTypeObject, null, functionTypeRti, null);
- },
- TypeErrorImplementation$: function(value, type) {
- return new H.TypeErrorImplementation("TypeError: " + P.Error_safeToString(value) + ": type '" + H.S(H._typeDescription(value)) + "' is not a subtype of type '" + type + "'");
- },
- _typeDescription: function(value) {
- var functionTypeObject,
- t1 = J.getInterceptor$(value);
- if (!!t1.$isClosure) {
- functionTypeObject = H.extractFunctionTypeObjectFromInternal(t1);
- if (functionTypeObject != null)
- return H.runtimeTypeToString(functionTypeObject);
- return "Closure";
- }
- return H.Primitives_objectTypeName(value);
- },
- throwCyclicInit: function(staticName) {
- throw H.wrapException(new P.CyclicInitializationError(staticName));
- },
- setRuntimeTypeInfo: function(target, rti) {
- target.$ti = rti;
- return target;
- },
- getRuntimeTypeInfo: function(target) {
- if (target == null)
- return;
- return target.$ti;
- },
- getTypeArgumentByIndex: function(target, index) {
- var rti = H.getRuntimeTypeInfo(target);
- return rti == null ? null : rti[index];
- },
- runtimeTypeToString: function(rti) {
- return H._runtimeTypeToString(rti, null);
- },
- _runtimeTypeToString: function(rti, genericContext) {
- var t1, t2;
- if (rti == null)
- return "dynamic";
- if (rti === -1)
- return "void";
- if (typeof rti === "object" && rti !== null && rti.constructor === Array)
- return H.unminifyOrTag(rti[0].name) + H._joinArguments(rti, 1, genericContext);
- if (typeof rti == "function")
- return H.unminifyOrTag(rti.name);
- if (rti === -2)
- return "dynamic";
- if (typeof rti === "number") {
- H.intTypeCheck(rti);
- if (genericContext == null || rti < 0 || rti >= genericContext.length)
- return "unexpected-generic-index:" + rti;
- t1 = genericContext.length;
- t2 = t1 - rti - 1;
- if (t2 < 0 || t2 >= t1)
- return H.ioore(genericContext, t2);
- return H.S(genericContext[t2]);
- }
- if ('func' in rti)
- return H._functionRtiToString(rti, genericContext);
- if ('futureOr' in rti)
- return "FutureOr<" + H._runtimeTypeToString("type" in rti ? rti.type : null, genericContext) + ">";
- return "unknown-reified-type";
- },
- _functionRtiToString: function(rti, genericContext) {
- var boundsRti, outerContextLength, offset, i, i0, typeParameters, typeSep, t1, t2, boundRti, returnTypeText, $arguments, argumentsText, sep, _i, argument, optionalArguments, namedArguments, t3, _s2_ = ", ";
- if ("bounds" in rti) {
- boundsRti = rti.bounds;
- if (genericContext == null) {
- genericContext = H.setRuntimeTypeInfo([], [P.String]);
- outerContextLength = null;
- } else
- outerContextLength = genericContext.length;
- offset = genericContext.length;
- for (i = boundsRti.length, i0 = i; i0 > 0; --i0)
- C.JSArray_methods.add$1(genericContext, "T" + (offset + i0));
- for (typeParameters = "<", typeSep = "", i0 = 0; i0 < i; ++i0, typeSep = _s2_) {
- typeParameters += typeSep;
- t1 = genericContext.length;
- t2 = t1 - i0 - 1;
- if (t2 < 0)
- return H.ioore(genericContext, t2);
- typeParameters = C.JSString_methods.$add(typeParameters, genericContext[t2]);
- boundRti = boundsRti[i0];
- if (boundRti != null && boundRti !== P.Object)
- typeParameters += " extends " + H._runtimeTypeToString(boundRti, genericContext);
- }
- typeParameters += ">";
- } else {
- typeParameters = "";
- outerContextLength = null;
- }
- returnTypeText = !!rti.v ? "void" : H._runtimeTypeToString(rti.ret, genericContext);
- if ("args" in rti) {
- $arguments = rti.args;
- for (t1 = $arguments.length, argumentsText = "", sep = "", _i = 0; _i < t1; ++_i, sep = _s2_) {
- argument = $arguments[_i];
- argumentsText = argumentsText + sep + H._runtimeTypeToString(argument, genericContext);
- }
- } else {
- argumentsText = "";
- sep = "";
- }
- if ("opt" in rti) {
- optionalArguments = rti.opt;
- argumentsText += sep + "[";
- for (t1 = optionalArguments.length, sep = "", _i = 0; _i < t1; ++_i, sep = _s2_) {
- argument = optionalArguments[_i];
- argumentsText = argumentsText + sep + H._runtimeTypeToString(argument, genericContext);
- }
- argumentsText += "]";
- }
- if ("named" in rti) {
- namedArguments = rti.named;
- argumentsText += sep + "{";
- for (t1 = H.extractKeys(namedArguments), t2 = t1.length, sep = "", _i = 0; _i < t2; ++_i, sep = _s2_) {
- t3 = H.stringTypeCheck(t1[_i]);
- argumentsText = argumentsText + sep + H._runtimeTypeToString(namedArguments[t3], genericContext) + (" " + H.S(t3));
- }
- argumentsText += "}";
- }
- if (outerContextLength != null)
- genericContext.length = outerContextLength;
- return typeParameters + "(" + argumentsText + ") => " + returnTypeText;
- },
- _joinArguments: function(types, startIndex, genericContext) {
- var buffer, index, separator, allDynamic, t1, argument;
- if (types == null)
- return "";
- buffer = new P.StringBuffer("");
- for (index = startIndex, separator = "", allDynamic = true, t1 = ""; index < types.length; ++index, separator = ", ") {
- buffer._contents = t1 + separator;
- argument = types[index];
- if (argument != null)
- allDynamic = false;
- t1 = buffer._contents += H._runtimeTypeToString(argument, genericContext);
- }
- return "<" + buffer.toString$0(0) + ">";
- },
- substitute: function(substitution, $arguments) {
- if (substitution == null)
- return $arguments;
- substitution = substitution.apply(null, $arguments);
- if (substitution == null)
- return;
- if (typeof substitution === "object" && substitution !== null && substitution.constructor === Array)
- return substitution;
- if (typeof substitution == "function")
- return substitution.apply(null, $arguments);
- return $arguments;
- },
- checkSubtype: function(object, isField, checks, asField) {
- var $arguments, interceptor;
- if (object == null)
- return false;
- $arguments = H.getRuntimeTypeInfo(object);
- interceptor = J.getInterceptor$(object);
- if (interceptor[isField] == null)
- return false;
- return H.areSubtypes(H.substitute(interceptor[asField], $arguments), null, checks, null);
- },
- assertSubtype: function(object, isField, checks, asField) {
- if (object == null)
- return object;
- if (H.checkSubtype(object, isField, checks, asField))
- return object;
- throw H.wrapException(H.TypeErrorImplementation$(object, function(str, names) {
- return str.replace(/[^<,> ]+/g, function(m) {
- return names[m] || m;
- });
- }(H.unminifyOrTag(isField.substring(3)) + H._joinArguments(checks, 0, null), init.mangledGlobalNames)));
- },
- areSubtypes: function(s, sEnv, t, tEnv) {
- var len, i;
- if (t == null)
- return true;
- if (s == null) {
- len = t.length;
- for (i = 0; i < len; ++i)
- if (!H._isSubtype(null, null, t[i], tEnv))
- return false;
- return true;
- }
- len = s.length;
- for (i = 0; i < len; ++i)
- if (!H._isSubtype(s[i], sEnv, t[i], tEnv))
- return false;
- return true;
- },
- isSupertypeOfNullRecursive: function(type) {
- var typeArgument;
- if (typeof type === "number")
- return false;
- if ('futureOr' in type) {
- typeArgument = "type" in type ? type.type : null;
- return type == null || type.name === "Object" || type.name === "Null" || type === -1 || type === -2 || H.isSupertypeOfNullRecursive(typeArgument);
- }
- return false;
- },
- checkSubtypeOfRuntimeType: function(o, t) {
- var type, rti;
- if (o == null)
- return t == null || t.name === "Object" || t.name === "Null" || t === -1 || t === -2 || H.isSupertypeOfNullRecursive(t);
- if (t == null || t === -1 || t.name === "Object" || t === -2)
- return true;
- if (typeof t == "object") {
- if ('futureOr' in t)
- if (H.checkSubtypeOfRuntimeType(o, "type" in t ? t.type : null))
- return true;
- if ('func' in t)
- return H.functionTypeTest(o, t);
- }
- type = J.getInterceptor$(o).constructor;
- rti = H.getRuntimeTypeInfo(o);
- if (rti != null) {
- rti = rti.slice();
- rti.splice(0, 0, type);
- type = rti;
- }
- return H._isSubtype(type, null, t, null);
- },
- assertSubtypeOfRuntimeType: function(object, type) {
- if (object != null && !H.checkSubtypeOfRuntimeType(object, type))
- throw H.wrapException(H.TypeErrorImplementation$(object, H.runtimeTypeToString(type)));
- return object;
- },
- _isSubtype: function(s, sEnv, t, tEnv) {
- var t1, typeOfS, tTypeArgument, futureSubstitution, futureArguments, t2, typeOfT, typeOfTString, substitution, _null = null;
- if (s === t)
- return true;
- if (t == null || t === -1 || t.name === "Object" || t === -2)
- return true;
- if (s === -2)
- return true;
- if (s == null || s === -1 || s.name === "Object" || s === -2) {
- if (typeof t === "number")
- return false;
- if ('futureOr' in t)
- return H._isSubtype(s, sEnv, "type" in t ? t.type : _null, tEnv);
- return false;
- }
- if (typeof s === "number")
- return H._isSubtype(sEnv[H.intTypeCheck(s)], sEnv, t, tEnv);
- if (typeof t === "number")
- return false;
- if (s.name === "Null")
- return true;
- t1 = typeof s === "object" && s !== null && s.constructor === Array;
- typeOfS = t1 ? s[0] : s;
- if ('futureOr' in t) {
- tTypeArgument = "type" in t ? t.type : _null;
- if ('futureOr' in s)
- return H._isSubtype("type" in s ? s.type : _null, sEnv, tTypeArgument, tEnv);
- else if (H._isSubtype(s, sEnv, tTypeArgument, tEnv))
- return true;
- else {
- if (!('$is' + "Future" in typeOfS.prototype))
- return false;
- futureSubstitution = typeOfS.prototype["$as" + "Future"];
- futureArguments = H.substitute(futureSubstitution, t1 ? s.slice(1) : _null);
- return H._isSubtype(typeof futureArguments === "object" && futureArguments !== null && futureArguments.constructor === Array ? futureArguments[0] : _null, sEnv, tTypeArgument, tEnv);
- }
- }
- if ('func' in t)
- return H._isFunctionSubtype(s, sEnv, t, tEnv);
- if ('func' in s)
- return t.name === "Function";
- t2 = typeof t === "object" && t !== null && t.constructor === Array;
- typeOfT = t2 ? t[0] : t;
- if (typeOfT !== typeOfS) {
- typeOfTString = typeOfT.name;
- if (!('$is' + typeOfTString in typeOfS.prototype))
- return false;
- substitution = typeOfS.prototype["$as" + typeOfTString];
- } else
- substitution = _null;
- if (!t2)
- return true;
- t1 = t1 ? s.slice(1) : _null;
- t2 = t.slice(1);
- return H.areSubtypes(H.substitute(substitution, t1), sEnv, t2, tEnv);
- },
- _isFunctionSubtype: function(s, sEnv, t, tEnv) {
- var sBounds, tBounds, sParameterTypes, tParameterTypes, sOptionalParameterTypes, tOptionalParameterTypes, sParametersLen, tParametersLen, sOptionalParametersLen, tOptionalParametersLen, pos, tPos, sPos, sNamedParameters, tNamedParameters;
- if (!('func' in s))
- return false;
- if ("bounds" in s) {
- if (!("bounds" in t))
- return false;
- sBounds = s.bounds;
- tBounds = t.bounds;
- if (sBounds.length !== tBounds.length)
- return false;
- sEnv = sEnv == null ? sBounds : sBounds.concat(sEnv);
- tEnv = tEnv == null ? tBounds : tBounds.concat(tEnv);
- } else if ("bounds" in t)
- return false;
- if (!H._isSubtype(s.ret, sEnv, t.ret, tEnv))
- return false;
- sParameterTypes = s.args;
- tParameterTypes = t.args;
- sOptionalParameterTypes = s.opt;
- tOptionalParameterTypes = t.opt;
- sParametersLen = sParameterTypes != null ? sParameterTypes.length : 0;
- tParametersLen = tParameterTypes != null ? tParameterTypes.length : 0;
- sOptionalParametersLen = sOptionalParameterTypes != null ? sOptionalParameterTypes.length : 0;
- tOptionalParametersLen = tOptionalParameterTypes != null ? tOptionalParameterTypes.length : 0;
- if (sParametersLen > tParametersLen)
- return false;
- if (sParametersLen + sOptionalParametersLen < tParametersLen + tOptionalParametersLen)
- return false;
- for (pos = 0; pos < sParametersLen; ++pos)
- if (!H._isSubtype(tParameterTypes[pos], tEnv, sParameterTypes[pos], sEnv))
- return false;
- for (tPos = pos, sPos = 0; tPos < tParametersLen; ++sPos, ++tPos)
- if (!H._isSubtype(tParameterTypes[tPos], tEnv, sOptionalParameterTypes[sPos], sEnv))
- return false;
- for (tPos = 0; tPos < tOptionalParametersLen; ++sPos, ++tPos)
- if (!H._isSubtype(tOptionalParameterTypes[tPos], tEnv, sOptionalParameterTypes[sPos], sEnv))
- return false;
- sNamedParameters = s.named;
- tNamedParameters = t.named;
- if (tNamedParameters == null)
- return true;
- if (sNamedParameters == null)
- return false;
- return H.namedParametersSubtypeCheck(sNamedParameters, sEnv, tNamedParameters, tEnv);
- },
- namedParametersSubtypeCheck: function(s, sEnv, t, tEnv) {
- var t1, i, $name,
- names = Object.getOwnPropertyNames(t);
- for (t1 = names.length, i = 0; i < t1; ++i) {
- $name = names[i];
- if (!Object.hasOwnProperty.call(s, $name))
- return false;
- if (!H._isSubtype(t[$name], tEnv, s[$name], sEnv))
- return false;
- }
- return true;
- },
- Closure: function Closure() {
- },
- TypeErrorImplementation: function TypeErrorImplementation(t0) {
- this.message = t0;
- },
- extractKeys: function(victim) {
- return J.JSArray_JSArray$markFixed(victim ? Object.keys(victim) : [], null);
- },
- unmangleGlobalNameIfPreservedAnyways: function($name) {
- return init.mangledGlobalNames[$name];
- },
- printString: function(string) {
- if (typeof dartPrint == "function") {
- dartPrint(string);
- return;
- }
- if (typeof console == "object" && typeof console.log != "undefined") {
- console.log(string);
- return;
- }
- if (typeof window == "object")
- return;
- if (typeof print == "function") {
- print(string);
- return;
- }
- throw "Unable to print message: " + String(string);
- }
- },
- J = {
- JSArray_JSArray$markFixed: function(allocation, $E) {
- return J.JSArray_markFixedList(H.setRuntimeTypeInfo(allocation, [$E]));
- },
- JSArray_markFixedList: function(list) {
- list.fixed$length = Array;
- return list;
- },
- getInterceptor$: function(receiver) {
- if (typeof receiver == "number") {
- if (Math.floor(receiver) == receiver)
- return J.JSInt.prototype;
- return J.JSDouble.prototype;
- }
- if (typeof receiver == "string")
- return J.JSString.prototype;
- if (receiver == null)
- return J.JSNull.prototype;
- if (typeof receiver == "boolean")
- return J.JSBool.prototype;
- if (receiver.constructor == Array)
- return J.JSArray.prototype;
- return receiver;
- },
- getInterceptor$as: function(receiver) {
- if (typeof receiver == "string")
- return J.JSString.prototype;
- if (receiver == null)
- return receiver;
- if (receiver.constructor == Array)
- return J.JSArray.prototype;
- return receiver;
- },
- get$length$as: function(receiver) {
- return J.getInterceptor$as(receiver).get$length(receiver);
- },
- toString$0$: function(receiver) {
- return J.getInterceptor$(receiver).toString$0(receiver);
- },
- Interceptor: function Interceptor() {
- },
- JSBool: function JSBool() {
- },
- JSNull: function JSNull() {
- },
- JSArray: function JSArray(t0) {
- this.$ti = t0;
- },
- JSUnmodifiableArray: function JSUnmodifiableArray(t0) {
- this.$ti = t0;
- },
- ArrayIterator: function ArrayIterator(t0, t1, t2) {
- var _ = this;
- _._iterable = t0;
- _._length = t1;
- _._index = 0;
- _._current = null;
- _.$ti = t2;
- },
- JSNumber: function JSNumber() {
- },
- JSInt: function JSInt() {
- },
- JSDouble: function JSDouble() {
- },
- JSString: function JSString() {
- }
- },
- P = {
- Error__objectToString: function(object) {
- if (object instanceof H.Closure)
- return object.toString$0(0);
- return "Instance of '" + H.S(H.Primitives_objectTypeName(object)) + "'";
- },
- StringBuffer__writeAll: function(string, objects, separator) {
- var iterator = new J.ArrayIterator(objects, objects.length, [H.getTypeArgumentByIndex(objects, 0)]);
- if (!iterator.moveNext$0())
- return string;
- if (separator.length === 0) {
- do
- string += H.S(iterator._current);
- while (iterator.moveNext$0());
- } else {
- string += H.S(iterator._current);
- for (; iterator.moveNext$0();)
- string = string + separator + H.S(iterator._current);
- }
- return string;
- },
- Error_safeToString: function(object) {
- if (typeof object === "number" || typeof object === "boolean" || null == object)
- return J.toString$0$(object);
- if (typeof object === "string")
- return JSON.stringify(object);
- return P.Error__objectToString(object);
- },
- ArgumentError$value: function(value, $name, message) {
- return new P.ArgumentError(value, $name, message);
- },
- RangeError$value: function(value, $name) {
- return new P.RangeError(null, null, value, $name, "Value not in range");
- },
- UnsupportedError$: function(message) {
- return new P.UnsupportedError(message);
- },
- bool: function bool() {
- },
- double: function double() {
- },
- Error: function Error() {
- },
- NullThrownError: function NullThrownError() {
- },
- ArgumentError: function ArgumentError(t0, t1, t2) {
- this.invalidValue = t0;
- this.name = t1;
- this.message = t2;
- },
- RangeError: function RangeError(t0, t1, t2, t3, t4) {
- var _ = this;
- _.start = t0;
- _.end = t1;
- _.invalidValue = t2;
- _.name = t3;
- _.message = t4;
- },
- IndexError: function IndexError(t0, t1, t2, t3) {
- var _ = this;
- _.length = t0;
- _.invalidValue = t1;
- _.name = t2;
- _.message = t3;
- },
- UnsupportedError: function UnsupportedError(t0) {
- this.message = t0;
- },
- ConcurrentModificationError: function ConcurrentModificationError(t0) {
- this.modifiedObject = t0;
- },
- CyclicInitializationError: function CyclicInitializationError(t0) {
- this.variableName = t0;
- },
- int: function int() {
- },
- List: function List() {
- },
- Null: function Null() {
- },
- num: function num() {
- },
- Object: function Object() {
- },
- String: function String() {
- },
- StringBuffer: function StringBuffer(t0) {
- this._contents = t0;
- },
- IterableBase_iterableToFullString: function(iterable, leftDelimiter, rightDelimiter) {
- var buffer, t1;
- if (P._isToStringVisiting(iterable))
- return leftDelimiter + "..." + rightDelimiter;
- buffer = new P.StringBuffer(leftDelimiter);
- C.JSArray_methods.add$1($._toStringVisiting, iterable);
- try {
- t1 = buffer;
- t1._contents = P.StringBuffer__writeAll(t1._contents, iterable, ", ");
- } finally {
- if (0 >= $._toStringVisiting.length)
- return H.ioore($._toStringVisiting, -1);
- $._toStringVisiting.pop();
- }
- buffer._contents += rightDelimiter;
- t1 = buffer._contents;
- return t1.charCodeAt(0) == 0 ? t1 : t1;
- },
- _isToStringVisiting: function(o) {
- var t1, i;
- for (t1 = $._toStringVisiting.length, i = 0; i < t1; ++i)
- if (o === $._toStringVisiting[i])
- return true;
- return false;
- }
- },
- G = {
- main: function() {
- var t1, i, out;
- for (t1 = [P.String], i = 1; i <= 100; ++i) {
- out = H.setRuntimeTypeInfo([], t1);
- if (i % 3 === 0)
- C.JSArray_methods.add$1(out, "Fizz");
- if (i % 5 === 0)
- C.JSArray_methods.add$1(out, "Buzz");
- H.printString(H.S(out.length > 0 ? C.JSArray_methods.join$1(out, "") : i));
- }
- }
- };
- var holders = [C, H, J, P, G];
- hunkHelpers.setFunctionNamesIfNecessary(holders);
- var $ = {};
- H.JS_CONST.prototype = {};
- J.Interceptor.prototype = {
- toString$0: function(receiver) {
- return "Instance of '" + H.S(H.Primitives_objectTypeName(receiver)) + "'";
- }
- };
- J.JSBool.prototype = {
- toString$0: function(receiver) {
- return String(receiver);
- },
- $isbool: 1
- };
- J.JSNull.prototype = {
- toString$0: function(receiver) {
- return "null";
- }
- };
- J.JSArray.prototype = {
- add$1: function(receiver, value) {
- H.assertSubtypeOfRuntimeType(value, H.getTypeArgumentByIndex(receiver, 0));
- if (!!receiver.fixed$length)
- H.throwExpression(P.UnsupportedError$("add"));
- receiver.push(value);
- },
- join$1: function(receiver, separator) {
- var i,
- list = new Array(receiver.length);
- list.fixed$length = Array;
- for (i = 0; i < receiver.length; ++i)
- this.$indexSet(list, i, H.S(receiver[i]));
- return list.join(separator);
- },
- toString$0: function(receiver) {
- return P.IterableBase_iterableToFullString(receiver, "[", "]");
- },
- get$length: function(receiver) {
- return receiver.length;
- },
- $indexSet: function(receiver, index, value) {
- H.assertSubtypeOfRuntimeType(value, H.getTypeArgumentByIndex(receiver, 0));
- if (!!receiver.immutable$list)
- H.throwExpression(P.UnsupportedError$("indexed set"));
- if (index >= receiver.length || false)
- throw H.wrapException(H.diagnoseIndexError(receiver, index));
- receiver[index] = value;
- },
- $isIterable: 1
- };
- J.JSUnmodifiableArray.prototype = {};
- J.ArrayIterator.prototype = {
- moveNext$0: function() {
- var t2, _this = this,
- t1 = _this._iterable,
- $length = t1.length;
- if (_this._length !== $length)
- throw H.wrapException(H.throwConcurrentModificationError(t1));
- t2 = _this._index;
- if (t2 >= $length) {
- _this.set$_current(null);
- return false;
- }
- _this.set$_current(t1[t2]);
- ++_this._index;
- return true;
- },
- set$_current: function(_current) {
- this._current = H.assertSubtypeOfRuntimeType(_current, H.getTypeArgumentByIndex(this, 0));
- }
- };
- J.JSNumber.prototype = {
- toString$0: function(receiver) {
- if (receiver === 0 && 1 / receiver < 0)
- return "-0.0";
- else
- return "" + receiver;
- },
- $isnum: 1
- };
- J.JSInt.prototype = {$isint: 1};
- J.JSDouble.prototype = {};
- J.JSString.prototype = {
- _codeUnitAt$1: function(receiver, index) {
- if (index >= receiver.length)
- throw H.wrapException(H.diagnoseIndexError(receiver, index));
- return receiver.charCodeAt(index);
- },
- $add: function(receiver, other) {
- if (typeof other !== "string")
- throw H.wrapException(P.ArgumentError$value(other, null, null));
- return receiver + other;
- },
- toString$0: function(receiver) {
- return receiver;
- },
- get$length: function(receiver) {
- return receiver.length;
- },
- $isString: 1
- };
- H.Closure.prototype = {
- get$$call: function() {
- return this;
- },
- "call*": "call$1",
- $requiredArgCount: 1,
- $defaultValues: null
- };
- H.TypeErrorImplementation.prototype = {
- toString$0: function(_) {
- return this.message;
- }
- };
- P.bool.prototype = {
- toString$0: function(_) {
- return this ? "true" : "false";
- }
- };
- P.double.prototype = {};
- P.Error.prototype = {};
- P.NullThrownError.prototype = {
- toString$0: function(_) {
- return "Throw of null.";
- }
- };
- P.ArgumentError.prototype = {
- get$_errorName: function() {
- return "Invalid argument";
- },
- get$_errorExplanation: function() {
- return "";
- },
- toString$0: function(_) {
- var message, prefix, explanation, errorValue, _this = this,
- t1 = _this.name,
- nameString = t1 != null ? " (" + t1 + ")" : "";
- t1 = _this.message;
- message = t1 == null ? "" : ": " + t1;
- prefix = _this.get$_errorName() + nameString + message;
- explanation = _this.get$_errorExplanation();
- errorValue = P.Error_safeToString(_this.invalidValue);
- return prefix + explanation + ": " + errorValue;
- }
- };
- P.RangeError.prototype = {
- get$_errorName: function() {
- return "RangeError";
- },
- get$_errorExplanation: function() {
- var explanation, t2,
- t1 = this.start;
- if (t1 == null) {
- t1 = this.end;
- explanation = t1 != null ? ": Not less than or equal to " + H.S(t1) : "";
- } else {
- t2 = this.end;
- if (t2 == null)
- explanation = ": Not greater than or equal to " + H.S(t1);
- else if (t2 > t1)
- explanation = ": Not in range " + H.S(t1) + ".." + H.S(t2) + ", inclusive";
- else
- explanation = t2 < t1 ? ": Valid value range is empty" : ": Only valid value is " + H.S(t1);
- }
- return explanation;
- }
- };
- P.IndexError.prototype = {
- get$_errorName: function() {
- return "RangeError";
- },
- get$_errorExplanation: function() {
- var t1,
- invalidValue = H.intTypeCheck(this.invalidValue);
- if (typeof invalidValue !== "number")
- return invalidValue.$lt();
- if (invalidValue < 0)
- return ": index must not be negative";
- t1 = this.length;
- if (t1 === 0)
- return ": no indices are valid";
- return ": index should be less than " + t1;
- },
- get$length: function(receiver) {
- return this.length;
- }
- };
- P.UnsupportedError.prototype = {
- toString$0: function(_) {
- return "Unsupported operation: " + this.message;
- }
- };
- P.ConcurrentModificationError.prototype = {
- toString$0: function(_) {
- var t1 = this.modifiedObject;
- if (t1 == null)
- return "Concurrent modification during iteration.";
- return "Concurrent modification during iteration: " + P.Error_safeToString(t1) + ".";
- }
- };
- P.CyclicInitializationError.prototype = {
- toString$0: function(_) {
- var t1 = this.variableName;
- return t1 == null ? "Reading static variable during its initialization" : "Reading static variable '" + t1 + "' during its initialization";
- }
- };
- P.int.prototype = {};
- P.List.prototype = {$isIterable: 1};
- P.Null.prototype = {
- toString$0: function(_) {
- return "null";
- }
- };
- P.num.prototype = {};
- P.Object.prototype = {constructor: P.Object, $isObject: 1,
- toString$0: function(_) {
- return "Instance of '" + H.S(H.Primitives_objectTypeName(this)) + "'";
- },
- toString: function() {
- return this.toString$0(this);
- }
- };
- P.String.prototype = {};
- P.StringBuffer.prototype = {
- get$length: function(_) {
- return this._contents.length;
- },
- toString$0: function(_) {
- var t1 = this._contents;
- return t1.charCodeAt(0) == 0 ? t1 : t1;
- }
- };
- (function inheritance() {
- var _inherit = hunkHelpers.inherit,
- _inheritMany = hunkHelpers.inheritMany;
- _inherit(P.Object, null);
- _inheritMany(P.Object, [H.JS_CONST, J.Interceptor, J.ArrayIterator, H.Closure, P.Error, P.bool, P.num, P.List, P.Null, P.String, P.StringBuffer]);
- _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JSArray, J.JSNumber, J.JSString]);
- _inherit(J.JSUnmodifiableArray, J.JSArray);
- _inheritMany(J.JSNumber, [J.JSInt, J.JSDouble]);
- _inheritMany(P.Error, [H.TypeErrorImplementation, P.NullThrownError, P.ArgumentError, P.UnsupportedError, P.ConcurrentModificationError, P.CyclicInitializationError]);
- _inheritMany(P.num, [P.double, P.int]);
- _inheritMany(P.ArgumentError, [P.RangeError, P.IndexError]);
- })();
- var init = {mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List"}, mangledNames: {}, getTypeFromName: getGlobalFromName, metadata: [], types: []};
- (function constants() {
- C.Interceptor_methods = J.Interceptor.prototype;
- C.JSArray_methods = J.JSArray.prototype;
- C.JSString_methods = J.JSString.prototype;
- C.C_JS_CONST = function getTagFallback(o) {
- var s = Object.prototype.toString.call(o);
- return s.substring(8, s.length - 1);
- };
- })();
- (function staticFields() {
- $._toStringVisiting = [];
- })();
- convertAllToFastObject(holders);
- convertToFastObject($);
- (function(callback) {
- if (typeof document === "undefined") {
- callback(null);
- return;
- }
- if (typeof document.currentScript != 'undefined') {
- callback(document.currentScript);
- return;
- }
- var scripts = document.scripts;
- function onLoad(event) {
- for (var i = 0; i < scripts.length; ++i)
- scripts[i].removeEventListener("load", onLoad, false);
- callback(event.target);
- }
- for (var i = 0; i < scripts.length; ++i)
- scripts[i].addEventListener("load", onLoad, false);
- })(function(currentScript) {
- init.currentScript = currentScript;
- if (typeof dartMainRunner === "function")
- dartMainRunner(G.main, []);
- else
- G.main([]);
- });
- })();
- //# sourceMappingURL=fizzbuzz.js.map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement