diff --git a/Makefile b/Makefile index c09bda5..5681088 100644 --- a/Makefile +++ b/Makefile @@ -10,33 +10,33 @@ test: # make dep runs without sudo dep: - sudo apt-get -y install git screen hostapd autossh bluez bluez-tools bridge-utils policykit-1 genisoimage iodine haveged - sudo apt-get -y install tcpdump - sudo apt-get -y install python-pip python-dev + # sudo apt-get -y install git screen hostapd autossh bluez bluez-tools bridge-utils policykit-1 genisoimage iodine haveged + # sudo apt-get -y install tcpdump + # sudo apt-get -y install python-pip python-dev # before installing dnsmasq, the nameserver from /etc/resolv.conf should be saved # to restore after install (gets overwritten by dnsmasq package) - cp /etc/resolv.conf /tmp/backup_resolv.conf - sudo apt-get -y install dnsmasq - sudo /bin/bash -c 'cat /tmp/backup_resolv.conf > /etc/resolv.conf' + # cp /etc/resolv.conf /tmp/backup_resolv.conf + # sudo apt-get -y install dnsmasq + # sudo /bin/bash -c 'cat /tmp/backup_resolv.conf > /etc/resolv.conf' # python dependencies for HIDbackdoor - sudo pip install pycrypto # already present on stretch - sudo pip install pydispatcher + # sudo pip install pycrypto # already present on stretch + # sudo pip install pydispatcher # install go - wget https://storage.googleapis.com/golang/go1.10.linux-armv6l.tar.gz - sudo tar -C /usr/local -xzf go1.10.linux-armv6l.tar.gz + # wget https://storage.googleapis.com/golang/go1.10.linux-armv6l.tar.gz + # sudo tar -C /usr/local -xzf go1.10.linux-armv6l.tar.gz export PATH="$$PATH:/usr/local/go/bin" # put into ~/.profile # ToDo: check if already present - echo "export PATH=\$$PATH:/usr/local/go/bin" >> ~/.profile - sudo bash -c 'echo export PATH=\$$PATH:/usr/local/go/bin >> ~/.profile' + # echo "export PATH=\$$PATH:/usr/local/go/bin" >> ~/.profile + # sudo bash -c 'echo export PATH=\$$PATH:/usr/local/go/bin >> ~/.profile' # install gopherjs - go get -u github.com/gopherjs/gopherjs + go install github.com/gopherjs/gopherjs # we don't need protoc + protoc-grpc-web, because the proto file is shipped pre-compiled @@ -45,8 +45,12 @@ dep: #go get -u github.com/improbable-eng/grpc-web/go/grpcweb #go get -u github.com/gorilla/websocket +# This target probably needs to be run at least once to get the dependencies on +# the go path. But after that, you probably actually want to run: +# $ cd build_support && ./build.sh && cd .. +# instead, to build with the right GOOS and GOARCH settings. compile: - go get -u github.com/mame82/P4wnP1_aloa/... # partially downloads again, but we need the library packages in go path to build + go get github.com/mame82/P4wnP1_aloa/... # partially downloads again, but we need the library packages in go path to build # <--- second compilation, maybe -d flag on go get above is better env GOBIN=$(CURDIR)/build go install ./cmd/... # compile all main packages to the build folder @@ -113,15 +117,15 @@ install: # careful testing #sudo update-rc.d dhcpcd disable #sudo update-rc.d dnsmasq disable - systemctl disable networking.service # disable network service, relevant parts are wrapped by P4wnP1 (boottime below 20 seconds) + # systemctl disable networking.service # disable network service, relevant parts are wrapped by P4wnP1 (boottime below 20 seconds) # reinit service daemon - systemctl daemon-reload + # systemctl daemon-reload # enable service - systemctl enable haveged - systemctl enable P4wnP1.service + # systemctl enable haveged + # systemctl enable P4wnP1.service # start service - service P4wnP1 start + # service P4wnP1 start remove: # stop service diff --git a/build/.gitkeep b/build/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/build/P4wnP1_cli b/build/P4wnP1_cli index 35dcc9f..4305687 100755 Binary files a/build/P4wnP1_cli and b/build/P4wnP1_cli differ diff --git a/build/P4wnP1_service b/build/P4wnP1_service index d60d37e..a9fe00e 100755 Binary files a/build/P4wnP1_service and b/build/P4wnP1_service differ diff --git a/build/webapp.js b/build/webapp.js index a78d748..dd14e20 100644 --- a/build/webapp.js +++ b/build/webapp.js @@ -1,8 +1,10 @@ "use strict"; (function() { +var $goVersion = "go1.18.1"; Error.stackTraceLimit = Infinity; +var $NaN = NaN; var $global, $module; if (typeof window !== "undefined") { /* web page */ $global = window; @@ -22,6 +24,41 @@ if (typeof module !== "undefined") { $module = module; } +if (!$global.fs && $global.require) { + try { + var fs = $global.require('fs'); + if (typeof fs === "object" && fs !== null && Object.keys(fs).length !== 0) { + $global.fs = fs; + } + } catch(e) { /* Ignore if the module couldn't be loaded. */ } +} + +if (!$global.fs) { + var outputBuf = ""; + var decoder = new TextDecoder("utf-8"); + $global.fs = { + constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused + writeSync: function writeSync(fd, buf) { + outputBuf += decoder.decode(buf); + var nl = outputBuf.lastIndexOf("\n"); + if (nl != -1) { + console.log(outputBuf.substr(0, nl)); + outputBuf = outputBuf.substr(nl + 1); + } + return buf.length; + }, + write: function write(fd, buf, offset, length, position, callback) { + if (offset !== 0 || length !== buf.length || position !== null) { + callback(enosys()); + return; + } + var n = this.writeSync(fd, buf); + callback(null, n); + } + }; +} + +var $linknames = {} // Collection of functions referenced by a go:linkname directive. var $packages = {}, $idCounter = 0; var $keys = function(m) { return m ? Object.keys(m) : []; }; var $flushConsole = function() {}; @@ -30,6 +67,27 @@ var $throwNilPointerError = function() { $throwRuntimeError("invalid memory addr var $call = function(fn, rcvr, args) { return fn.apply(rcvr, args); }; var $makeFunc = function(fn) { return function() { return $externalize(fn(this, new ($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments, []))), $emptyInterface); }; }; var $unused = function(v) {}; +var $print = console.log; +// Under Node we can emulate print() more closely by avoiding a newline. +if (($global.process !== undefined) && $global.require) { + try { + var util = $global.require('util'); + $print = function() { $global.process.stderr.write(util.format.apply(this, arguments)); }; + } catch (e) { + // Failed to require util module, keep using console.log(). + } +} +var $println = console.log + +var $initAllLinknames = function() { + var names = $keys($packages); + for (var i = 0; i < names.length; i++) { + var f = $packages[names[i]]["$initLinknames"]; + if (typeof f == 'function') { + f(); + } + } +} var $mapArray = function(array, f) { var newArray = new array.constructor(array.length); @@ -39,6 +97,16 @@ var $mapArray = function(array, f) { return newArray; }; +// $mapIndex returns the value of the given key in m, or undefined if m is nil/undefined or not a map +var $mapIndex = function(m, key) { + return typeof m.get === "function" ? m.get(key) : undefined; +}; +// $mapDelete deletes the key and associated value from m. If m is nil/undefined or not a map, $mapDelete is a no-op +var $mapDelete = function(m, key) { + typeof m.delete === "function" && m.delete(key) +}; +// Returns a method bound to the receiver instance, safe to invoke as a +// standalone function. Bound function is cached for later reuse. var $methodVal = function(recv, name) { var vals = recv.$methodVals || {}; recv.$methodVals = vals; /* noop for primitives */ @@ -47,14 +115,7 @@ var $methodVal = function(recv, name) { return f; } var method = recv[name]; - f = function() { - $stackDepthOffset--; - try { - return method.apply(recv, arguments); - } finally { - $stackDepthOffset++; - } - }; + f = method.bind(recv); vals[name] = f; return f; }; @@ -120,13 +181,53 @@ var $substring = function(str, low, high) { return str.substring(low, high); }; -var $sliceToArray = function(slice) { +// Convert Go slice to an equivalent JS array type. +var $sliceToNativeArray = function(slice) { if (slice.$array.constructor !== Array) { return slice.$array.subarray(slice.$offset, slice.$offset + slice.$length); } return slice.$array.slice(slice.$offset, slice.$offset + slice.$length); }; +// Convert Go slice to a pointer to an underlying Go array. +// +// Note that an array pointer can be represented by an "unwrapped" native array +// type, and it will be wrapped back into its Go type when necessary. +var $sliceToGoArray = function(slice, arrayPtrType) { + var arrayType = arrayPtrType.elem; + if (arrayType !== undefined && slice.$length < arrayType.len) { + $throwRuntimeError("cannot convert slice with length " + slice.$length + " to pointer to array with length " + arrayType.len); + } + if (slice == slice.constructor.nil) { + return arrayPtrType.nil; // Nil slice converts to nil array pointer. + } + if (slice.$array.constructor !== Array) { + return slice.$array.subarray(slice.$offset, slice.$offset + arrayType.len); + } + if (slice.$offset == 0 && slice.$length == slice.$capacity && slice.$length == arrayType.len) { + return slice.$array; + } + if (arrayType.len == 0) { + return new arrayType([]); + } + + // Array.slice (unlike TypedArray.subarray) returns a copy of an array range, + // which is not sharing memory with the original one, which violates the spec + // for slice to array conversion. This is incompatible with the Go spec, in + // particular that the assignments to the array elements would be visible in + // the slice. Prefer to fail explicitly instead of creating subtle bugs. + $throwRuntimeError("gopherjs: non-numeric slice to underlying array conversion is not supported for subslices"); +}; + +// Convert between compatible slice types (e.g. native and names). +var $convertSliceType = function(slice, desiredType) { + if (slice == slice.constructor.nil) { + return desiredType.nil; // Preserve nil value. + } + + return $subslice(new desiredType(slice.$array), slice.$offset, slice.$offset + slice.$length); +} + var $decodeRune = function(str, pos) { var c0 = str.charCodeAt(pos); @@ -419,6 +520,60 @@ var $interfaceIsEqual = function(a, b) { return $equal(a.$val, b.$val, a.constructor); }; +var $unsafeMethodToFunction = function(typ, name, isPtr) { + if (isPtr) { + return function(r, ...args) { + var ptrType = $ptrType(typ); + if (r.constructor != ptrType) { + switch (typ.kind) { + case $kindStruct: + r = $pointerOfStructConversion(r, ptrType); + break; + case $kindArray: + r = new ptrType(r); + break; + default: + r = new ptrType(r.$get,r.$set,r.$target); + } + } + return r[name](...args); + } + } else { + return function(r, ...args) { + var ptrType = $ptrType(typ); + if (r.constructor != ptrType) { + switch (typ.kind) { + case $kindStruct: + r = $clone(r, typ); + break; + case $kindSlice: + r = $convertSliceType(r, typ); + break; + case $kindComplex64: + case $kindComplex128: + r = new typ(r.$real, r.$imag); + break; + default: + r = new typ(r); + } + } + return r[name](...args); + } + } +}; + +var $id = function(x) { + return x; +}; + +var $instanceOf = function(x, y) { + return x instanceof y; +}; + +var $typeOf = function(x) { + return typeof(x); +}; + var $min = Math.min; var $mod = function(x, y) { return x % y; }; var $parseInt = parseInt; @@ -498,23 +653,43 @@ var $shiftRightUint64 = function(x, y) { }; var $mul64 = function(x, y) { - var high = 0, low = 0; - if ((y.$low & 1) !== 0) { - high = x.$high; - low = x.$low; - } - for (var i = 1; i < 32; i++) { - if ((y.$low & 1<>> (32 - i); - low += (x.$low << i) >>> 0; - } - } - for (var i = 0; i < 32; i++) { - if ((y.$high & 1<>> 16; + var x32 = x.$high & 0xFFFF; + var x16 = x.$low >>> 16; + var x00 = x.$low & 0xFFFF; + + var y48 = y.$high >>> 16; + var y32 = y.$high & 0xFFFF; + var y16 = y.$low >>> 16; + var y00 = y.$low & 0xFFFF; + + var z48 = 0, z32 = 0, z16 = 0, z00 = 0; + z00 += x00 * y00; + z16 += z00 >>> 16; + z00 &= 0xFFFF; + z16 += x16 * y00; + z32 += z16 >>> 16; + z16 &= 0xFFFF; + z16 += x00 * y16; + z32 += z16 >>> 16; + z16 &= 0xFFFF; + z32 += x32 * y00; + z48 += z32 >>> 16; + z32 &= 0xFFFF; + z32 += x16 * y16; + z48 += z32 >>> 16; + z32 &= 0xFFFF; + z32 += x00 * y32; + z48 += z32 >>> 16; + z32 &= 0xFFFF; + z48 += x48 * y00 + x32 * y16 + x16 * y32 + x00 * y48; + z48 &= 0xFFFF; + + var hi = ((z48 << 16) | z32) >>> 0; + var lo = ((z16 << 16) | z00) >>> 0; + + var r = new x.constructor(hi, lo); + return r; }; var $div64 = function(x, y, returnRemainder) { @@ -672,6 +847,16 @@ var $idKey = function(x) { return String(x.$id); }; +// Creates constructor functions for array pointer types. Returns a new function +// instace each time to make sure each type is independent of the other. +var $arrayPtrCtor = function() { + return function(array) { + this.$get = function() { return array; }; + this.$set = function(v) { typ.copy(this, v); }; + this.$val = array; + } +} + var $newType = function(size, kind, string, named, pkg, exported, constructor) { var typ; switch(kind) { @@ -743,11 +928,7 @@ var $newType = function(size, kind, string, named, pkg, exported, constructor) { case $kindArray: typ = function(v) { this.$val = v; }; typ.wrapped = true; - typ.ptr = $newType(4, $kindPtr, "*" + string, false, "", false, function(array) { - this.$get = function() { return array; }; - this.$set = function(v) { typ.copy(this, v); }; - this.$val = array; - }); + typ.ptr = $newType(4, $kindPtr, "*" + string, false, "", false, $arrayPtrCtor()); typ.init = function(elem, len) { typ.elem = elem; typ.len = len; @@ -1087,7 +1268,7 @@ var $Float64 = $newType( 8, $kindFloat64, "float64", true, "" var $Complex64 = $newType( 8, $kindComplex64, "complex64", true, "", false, null); var $Complex128 = $newType(16, $kindComplex128, "complex128", true, "", false, null); var $String = $newType( 8, $kindString, "string", true, "", false, null); -var $UnsafePointer = $newType( 4, $kindUnsafePointer, "unsafe.Pointer", true, "", false, null); +var $UnsafePointer = $newType( 4, $kindUnsafePointer, "unsafe.Pointer", true, "unsafe", false, null); var $nativeArray = function(elemKind) { switch (elemKind) { @@ -1129,7 +1310,7 @@ var $arrayType = function(elem, len) { var typeKey = elem.id + "$" + len; var typ = $arrayTypes[typeKey]; if (typ === undefined) { - typ = $newType(12, $kindArray, "[" + len + "]" + elem.string, false, "", false, null); + typ = $newType(elem.size*len, $kindArray, "[" + len + "]" + elem.string, false, "", false, null); $arrayTypes[typeKey] = typ; typ.init(elem, len); } @@ -1137,7 +1318,12 @@ var $arrayType = function(elem, len) { }; var $chanType = function(elem, sendOnly, recvOnly) { - var string = (recvOnly ? "<-" : "") + "chan" + (sendOnly ? "<- " : " ") + elem.string; + var string = (recvOnly ? "<-" : "") + "chan" + (sendOnly ? "<- " : " "); + if (!sendOnly && !recvOnly && (elem.string[0] == "<")) { + string += "(" + elem.string + ")"; + } else { + string += elem.string; + } var field = sendOnly ? "SendChan" : (recvOnly ? "RecvChan" : "Chan"); var typ = elem[field]; if (typ === undefined) { @@ -1217,10 +1403,10 @@ var $mapType = function(key, elem) { return typ; }; var $makeMap = function(keyForFunc, entries) { - var m = {}; + var m = new Map(); for (var i = 0; i < entries.length; i++) { var e = entries[i]; - m[keyForFunc(e.k)] = e; + m.set(keyForFunc(e.k), e); } return m; }; @@ -1243,8 +1429,17 @@ var $newDataPointer = function(data, constructor) { }; var $indexPtr = function(array, index, constructor) { - array.$ptr = array.$ptr || {}; - return array.$ptr[index] || (array.$ptr[index] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); + if (array.buffer) { + // Pointers to the same underlying ArrayBuffer share cache. + var cache = array.buffer.$ptr = array.buffer.$ptr || {}; + // Pointers of different primitive types are non-comparable and stored in different caches. + var typeCache = cache[array.name] = cache[array.name] || {}; + var cacheIdx = array.BYTES_PER_ELEMENT * index + array.byteOffset; + return typeCache[cacheIdx] || (typeCache[cacheIdx] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); + } else { + array.$ptr = array.$ptr || {}; + return array.$ptr[index] || (array.$ptr[index] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); + } }; var $sliceType = function(elem) { @@ -1281,7 +1476,11 @@ var $structType = function(pkgPath, fields) { var typ = $structTypes[typeKey]; if (typ === undefined) { var string = "struct { " + $mapArray(fields, function(f) { - return f.name + " " + f.typ.string + (f.tag !== "" ? (" \"" + f.tag.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"") : ""); + var str = f.typ.string + (f.tag !== "" ? (" \"" + f.tag.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"") : ""); + if (f.embedded) { + return str; + } + return f.name + " " + str; }).join("; ") + " }"; if (fields.length === 0) { string = "struct {}"; @@ -1290,6 +1489,9 @@ var $structType = function(pkgPath, fields) { this.$val = this; for (var i = 0; i < fields.length; i++) { var f = fields[i]; + if (f.name == '_') { + continue; + } var arg = arguments[i]; this[f.prop] = arg !== undefined ? arg : f.typ.zero(); } @@ -1367,18 +1569,16 @@ var $getStackDepth = function() { var $panicStackDepth = null, $panicValue; var $callDeferred = function(deferred, jsErr, fromPanic) { - if (!fromPanic && deferred !== null && deferred.index >= $curGoroutine.deferStack.length) { + if (!fromPanic && deferred !== null && $curGoroutine.deferStack.indexOf(deferred) == -1) { throw jsErr; } if (jsErr !== null) { var newErr = null; try { - $curGoroutine.deferStack.push(deferred); $panic(new $jsErrorPtr(jsErr)); } catch (err) { newErr = err; } - $curGoroutine.deferStack.pop(); $callDeferred(deferred, newErr); return; } @@ -1438,9 +1638,25 @@ var $callDeferred = function(deferred, jsErr, fromPanic) { } if (localPanicValue !== undefined && $panicStackDepth === null) { - throw null; /* error was recovered */ + /* error was recovered */ + if (fromPanic) { + throw null; + } + return; } } + } catch(e) { + // Deferred function threw a JavaScript exception or tries to unwind stack + // to the point where a panic was handled. + if (fromPanic) { + // Re-throw the exception to reach deferral execution call at the end + // of the function. + throw e; + } + // We are at the end of the function, handle the error or re-throw to + // continue unwinding if necessary, or simply stop unwinding if we got far + // enough. + $callDeferred(deferred, e, fromPanic); } finally { if (localPanicValue !== undefined) { if ($panicStackDepth !== null) { @@ -1467,7 +1683,7 @@ var $recover = function() { var $throw = function(err) { throw err; }; var $noGoroutine = { asleep: false, exit: false, deferStack: [], panicStack: [] }; -var $curGoroutine = $noGoroutine, $totalGoroutines = 0, $awakeGoroutines = 0, $checkForDeadlock = true; +var $curGoroutine = $noGoroutine, $totalGoroutines = 0, $awakeGoroutines = 0, $checkForDeadlock = true, $exportedFunctions = 0; var $mainFinished = false; var $go = function(fun, args) { $totalGoroutines++; @@ -1494,7 +1710,7 @@ var $go = function(fun, args) { } if ($goroutine.asleep) { $awakeGoroutines--; - if (!$mainFinished && $awakeGoroutines === 0 && $checkForDeadlock) { + if (!$mainFinished && $awakeGoroutines === 0 && $checkForDeadlock && $exportedFunctions === 0) { console.error("fatal error: all goroutines are asleep - deadlock!"); if ($global.process !== undefined) { $global.process.exit(2); @@ -1512,14 +1728,28 @@ var $go = function(fun, args) { var $scheduled = []; var $runScheduled = function() { + // For nested setTimeout calls browsers enforce 4ms minimum delay. We minimize + // the effect of this penalty by queueing the timer preemptively before we run + // the goroutines, and later cancelling it if it turns out unneeded. See: + // https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#nested_timeouts + var nextRun = setTimeout($runScheduled); try { + var start = Date.now(); var r; while ((r = $scheduled.shift()) !== undefined) { r(); + // We need to interrupt this loop in order to allow the event loop to + // process timers, IO, etc. However, invoking scheduling through + // setTimeout is ~1000 times more expensive, so we amortize this cost by + // looping until the 4ms minimal delay has elapsed (assuming there are + // scheduled goroutines to run), and then yield to the event loop. + var elapsed = Date.now() - start; + if (elapsed > 4 || elapsed < 0) { break; } } } finally { - if ($scheduled.length > 0) { - setTimeout($runScheduled, 0); + if ($scheduled.length == 0) { + // Cancel scheduling pass if there's nothing to run. + clearTimeout(nextRun); } } }; @@ -1550,6 +1780,13 @@ var $block = function() { $curGoroutine.asleep = true; }; +var $restore = function(context, params) { + if (context !== undefined && context.$blk !== undefined) { + return context; + } + return params; +} + var $send = function(chan, value) { if (chan.$closed) { $throwRuntimeError("send on closed channel"); @@ -1733,7 +1970,7 @@ var $needsExternalization = function(t) { } }; -var $externalize = function(v, t) { +var $externalize = function(v, t, makeWrapper) { if (t === $jsObjectPtr) { return v; } @@ -1756,11 +1993,11 @@ var $externalize = function(v, t) { return $flatten64(v); case $kindArray: if ($needsExternalization(t.elem)) { - return $mapArray(v, function(e) { return $externalize(e, t.elem); }); + return $mapArray(v, function(e) { return $externalize(e, t.elem, makeWrapper); }); } return v; case $kindFunc: - return $externalizeFunction(v, t, false); + return $externalizeFunction(v, t, false, makeWrapper); case $kindInterface: if (v === $ifaceNil) { return null; @@ -1768,25 +2005,25 @@ var $externalize = function(v, t) { if (v.constructor === $jsObjectPtr) { return v.$val.object; } - return $externalize(v.$val, v.constructor); + return $externalize(v.$val, v.constructor, makeWrapper); case $kindMap: var m = {}; - var keys = $keys(v); + var keys = Array.from(v.keys()); for (var i = 0; i < keys.length; i++) { - var entry = v[keys[i]]; - m[$externalize(entry.k, t.key)] = $externalize(entry.v, t.elem); + var entry = v.get(keys[i]); + m[$externalize(entry.k, t.key, makeWrapper)] = $externalize(entry.v, t.elem, makeWrapper); } return m; case $kindPtr: if (v === t.nil) { return null; } - return $externalize(v.$get(), t.elem); + return $externalize(v.$get(), t.elem, makeWrapper); case $kindSlice: if ($needsExternalization(t.elem)) { - return $mapArray($sliceToArray(v), function(e) { return $externalize(e, t.elem); }); + return $mapArray($sliceToNativeArray(v), function(e) { return $externalize(e, t.elem, makeWrapper); }); } - return $sliceToArray(v); + return $sliceToNativeArray(v); case $kindString: if ($isASCII(v)) { return v; @@ -1836,20 +2073,24 @@ var $externalize = function(v, t) { return o; } + if (makeWrapper !== undefined) { + return makeWrapper(v); + } + o = {}; for (var i = 0; i < t.fields.length; i++) { var f = t.fields[i]; if (!f.exported) { continue; } - o[f.name] = $externalize(v[f.prop], f.typ); + o[f.name] = $externalize(v[f.prop], f.typ, makeWrapper); } return o; } $throwRuntimeError("cannot externalize " + t.string); }; -var $externalizeFunction = function(v, t, passThis) { +var $externalizeFunction = function(v, t, passThis, makeWrapper) { if (v === $throwNilPointerError) { return null; } @@ -1861,22 +2102,22 @@ var $externalizeFunction = function(v, t, passThis) { if (t.variadic && i === t.params.length - 1) { var vt = t.params[i].elem, varargs = []; for (var j = i; j < arguments.length; j++) { - varargs.push($internalize(arguments[j], vt)); + varargs.push($internalize(arguments[j], vt, makeWrapper)); } args.push(new (t.params[i])(varargs)); break; } - args.push($internalize(arguments[i], t.params[i])); + args.push($internalize(arguments[i], t.params[i], makeWrapper)); } var result = v.apply(passThis ? this : undefined, args); switch (t.results.length) { case 0: return; case 1: - return $externalize(result, t.results[0]); + return $externalize($copyIfRequired(result, t.results[0]), t.results[0], makeWrapper); default: for (var i = 0; i < t.results.length; i++) { - result[i] = $externalize(result[i], t.results[i]); + result[i] = $externalize($copyIfRequired(result[i], t.results[i]), t.results[i], makeWrapper); } return result; } @@ -1885,7 +2126,7 @@ var $externalizeFunction = function(v, t, passThis) { return v.$externalizeWrapper; }; -var $internalize = function(v, t, recv) { +var $internalize = function(v, t, recv, seen, makeWrapper) { if (t === $jsObjectPtr) { return v; } @@ -1902,6 +2143,13 @@ var $internalize = function(v, t, recv) { } return timePkg.Unix(new $Int64(0, 0), new $Int64(0, v.getTime() * 1000000)); } + + // Cache for values we've already internalized in order to deal with circular + // references. + if (seen === undefined) { seen = new Map(); } + if (!seen.has(t)) { seen.set(t, new Map()); } + if (seen.get(t).has(v)) { return seen.get(t).get(v); } + switch (t.kind) { case $kindBool: return !!v; @@ -1932,7 +2180,7 @@ var $internalize = function(v, t, recv) { if (v.length !== t.len) { $throwRuntimeError("got array with wrong size from JavaScript native"); } - return $mapArray(v, function(e) { return $internalize(e, t.elem); }); + return $mapArray(v, function(e) { return $internalize(e, t.elem, makeWrapper); }); case $kindFunc: return function() { var args = []; @@ -1940,21 +2188,21 @@ var $internalize = function(v, t, recv) { if (t.variadic && i === t.params.length - 1) { var vt = t.params[i].elem, varargs = arguments[i]; for (var j = 0; j < varargs.$length; j++) { - args.push($externalize(varargs.$array[varargs.$offset + j], vt)); + args.push($externalize(varargs.$array[varargs.$offset + j], vt, makeWrapper)); } break; } - args.push($externalize(arguments[i], t.params[i])); + args.push($externalize(arguments[i], t.params[i], makeWrapper)); } var result = v.apply(recv, args); switch (t.results.length) { case 0: return; case 1: - return $internalize(result, t.results[0]); + return $internalize(result, t.results[0], makeWrapper); default: for (var i = 0; i < t.results.length; i++) { - result[i] = $internalize(result[i], t.results[i]); + result[i] = $internalize(result[i], t.results[i], makeWrapper); } return result; } @@ -1987,7 +2235,7 @@ var $internalize = function(v, t, recv) { case Float64Array: return new ($sliceType($Float64))(v); case Array: - return $internalize(v, $sliceType($emptyInterface)); + return $internalize(v, $sliceType($emptyInterface), makeWrapper); case Boolean: return new $Bool(!!v); case Date: @@ -1995,35 +2243,36 @@ var $internalize = function(v, t, recv) { /* time package is not present, internalize as &js.Object{Date} so it can be externalized into original Date. */ return new $jsObjectPtr(v); } - return new timePkg.Time($internalize(v, timePkg.Time)); - case Function: + return new timePkg.Time($internalize(v, timePkg.Time, makeWrapper)); + case (function () { }).constructor: // is usually Function, but in Chrome extensions it is something else var funcType = $funcType([$sliceType($emptyInterface)], [$jsObjectPtr], true); - return new funcType($internalize(v, funcType)); + return new funcType($internalize(v, funcType, makeWrapper)); case Number: return new $Float64(parseFloat(v)); case String: - return new $String($internalize(v, $String)); + return new $String($internalize(v, $String, makeWrapper)); default: if ($global.Node && v instanceof $global.Node) { return new $jsObjectPtr(v); } var mapType = $mapType($String, $emptyInterface); - return new mapType($internalize(v, mapType)); + return new mapType($internalize(v, mapType, recv, seen, makeWrapper)); } case $kindMap: - var m = {}; + var m = new Map(); + seen.get(t).set(v, m); var keys = $keys(v); for (var i = 0; i < keys.length; i++) { - var k = $internalize(keys[i], t.key); - m[t.key.keyFor(k)] = { k: k, v: $internalize(v[keys[i]], t.elem) }; + var k = $internalize(keys[i], t.key, recv, seen, makeWrapper); + m.set(t.key.keyFor(k), { k: k, v: $internalize(v[keys[i]], t.elem, recv, seen, makeWrapper) }); } return m; case $kindPtr: if (t.elem.kind === $kindStruct) { - return $internalize(v, t.elem); + return $internalize(v, t.elem, makeWrapper); } case $kindSlice: - return new t($mapArray(v, function(e) { return $internalize(e, t.elem); })); + return new t($mapArray(v, function(e) { return $internalize(e, t.elem, makeWrapper); })); case $kindString: v = String(v); if ($isASCII(v)) { @@ -2077,6 +2326,20 @@ var $internalize = function(v, t, recv) { $throwRuntimeError("cannot internalize " + t.string); }; +var $copyIfRequired = function(v, typ) { + // interface values + if (v && v.constructor && v.constructor.copy) { + return new v.constructor($clone(v.$val, v.constructor)) + } + // array and struct values + if (typ.copy) { + var clone = typ.zero(); + typ.copy(clone, v); + return clone; + } + return v; +} + /* $isASCII reports whether string s contains only ASCII characters. */ var $isASCII = function(s) { for (var i = 0; i < s.length; i++) { @@ -2247,43 +2510,9 @@ $packages["github.com/gopherjs/gopherjs/js"] = (function() { $pkg.$init = $init; return $pkg; })(); -$packages["internal/cpu"] = (function() { - var $pkg = {}, $init; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["internal/bytealg"] = (function() { - var $pkg = {}, $init, cpu; - cpu = $packages["internal/cpu"]; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = cpu.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["runtime/internal/sys"] = (function() { - var $pkg = {}, $init; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); $packages["runtime"] = (function() { - var $pkg = {}, $init, js, bytealg, sys, _type, TypeAssertionError, errorString, ptrType, ptrType$4, init, GOROOT, Goexit, SetFinalizer, KeepAlive, throw$1; + var $pkg = {}, $init, js, _type, TypeAssertionError, basicFrame, Func, errorString, ptrType, sliceType, ptrType$1, structType, sliceType$1, ptrType$2, knownPositions, positionCounters, hiddenFrames, knownFrames, buildVersion, init, GOROOT, registerPosition, itoa, callstack, parseCallstack, ParseCallFrame, Caller, SetFinalizer, FuncForPC, KeepAlive, throw$1, nanotime, fastrand; js = $packages["github.com/gopherjs/gopherjs/js"]; - bytealg = $packages["internal/bytealg"]; - sys = $packages["runtime/internal/sys"]; _type = $pkg._type = $newType(0, $kindStruct, "runtime._type", true, "runtime", false, function(str_) { this.$val = this; if (arguments.length === 0) { @@ -2295,9 +2524,9 @@ $packages["runtime"] = (function() { TypeAssertionError = $pkg.TypeAssertionError = $newType(0, $kindStruct, "runtime.TypeAssertionError", true, "runtime", true, function(_interface_, concrete_, asserted_, missingMethod_) { this.$val = this; if (arguments.length === 0) { - this._interface = ptrType.nil; - this.concrete = ptrType.nil; - this.asserted = ptrType.nil; + this._interface = ptrType$1.nil; + this.concrete = ptrType$1.nil; + this.asserted = ptrType$1.nil; this.missingMethod = ""; return; } @@ -2306,9 +2535,41 @@ $packages["runtime"] = (function() { this.asserted = asserted_; this.missingMethod = missingMethod_; }); + basicFrame = $pkg.basicFrame = $newType(0, $kindStruct, "runtime.basicFrame", true, "runtime", false, function(FuncName_, File_, Line_, Col_) { + this.$val = this; + if (arguments.length === 0) { + this.FuncName = ""; + this.File = ""; + this.Line = 0; + this.Col = 0; + return; + } + this.FuncName = FuncName_; + this.File = File_; + this.Line = Line_; + this.Col = Col_; + }); + Func = $pkg.Func = $newType(0, $kindStruct, "runtime.Func", true, "runtime", true, function(name_, file_, line_, opaque_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.file = ""; + this.line = 0; + this.opaque = new structType.ptr(); + return; + } + this.name = name_; + this.file = file_; + this.line = line_; + this.opaque = opaque_; + }); errorString = $pkg.errorString = $newType(8, $kindString, "runtime.errorString", true, "runtime", false, null); - ptrType = $ptrType(_type); - ptrType$4 = $ptrType(TypeAssertionError); + ptrType = $ptrType(Func); + sliceType = $sliceType(ptrType); + ptrType$1 = $ptrType(_type); + structType = $structType("", []); + sliceType$1 = $sliceType(basicFrame); + ptrType$2 = $ptrType(TypeAssertionError); _type.ptr.prototype.string = function() { var t; t = this; @@ -2321,46 +2582,6 @@ $packages["runtime"] = (function() { return ""; }; _type.prototype.pkgpath = function() { return this.$val.pkgpath(); }; - init = function() { - var e, jsPkg; - jsPkg = $packages[$externalize("github.com/gopherjs/gopherjs/js", $String)]; - $jsObjectPtr = jsPkg.Object.ptr; - $jsErrorPtr = jsPkg.Error.ptr; - $throwRuntimeError = throw$1; - e = $ifaceNil; - e = new TypeAssertionError.ptr(ptrType.nil, ptrType.nil, ptrType.nil, ""); - $unused(e); - }; - GOROOT = function() { - var goroot, process; - process = $global.process; - if (process === undefined) { - return "/"; - } - goroot = process.env.GOROOT; - if (!(goroot === undefined)) { - return $internalize(goroot, $String); - } - return "/usr/local/go"; - }; - $pkg.GOROOT = GOROOT; - Goexit = function() { - $curGoroutine.exit = $externalize(true, $Bool); - $throw(null); - }; - $pkg.Goexit = Goexit; - SetFinalizer = function(x, f) { - var f, x; - }; - $pkg.SetFinalizer = SetFinalizer; - KeepAlive = function(param) { - var param; - }; - $pkg.KeepAlive = KeepAlive; - throw$1 = function(s) { - var s; - $panic(new errorString((s))); - }; TypeAssertionError.ptr.prototype.RuntimeError = function() { }; TypeAssertionError.prototype.RuntimeError = function() { return this.$val.RuntimeError(); }; @@ -2368,11 +2589,11 @@ $packages["runtime"] = (function() { var as, cs, e, inter, msg; e = this; inter = "interface"; - if (!(e._interface === ptrType.nil)) { + if (!(e._interface === ptrType$1.nil)) { inter = e._interface.string(); } as = e.asserted.string(); - if (e.concrete === ptrType.nil) { + if (e.concrete === ptrType$1.nil) { return "interface conversion: " + inter + " is nil, not " + as; } cs = e.concrete.string(); @@ -2390,6 +2611,204 @@ $packages["runtime"] = (function() { return "interface conversion: " + cs + " is not " + as + ": missing method " + e.missingMethod; }; TypeAssertionError.prototype.Error = function() { return this.$val.Error(); }; + init = function() { + var e, jsPkg; + jsPkg = $packages[$externalize("github.com/gopherjs/gopherjs/js", $String)]; + $jsObjectPtr = jsPkg.Object.ptr; + $jsErrorPtr = jsPkg.Error.ptr; + $throwRuntimeError = throw$1; + buildVersion = $internalize($goVersion, $String); + e = $ifaceNil; + e = new TypeAssertionError.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ""); + $unused(e); + }; + GOROOT = function() { + var process, v, v$1; + process = $global.process; + if (process === undefined) { + return "/"; + } + v = process.env.GOPHERJS_GOROOT; + if (!(v === undefined) && !($internalize(v, $String) === "")) { + return $internalize(v, $String); + } else { + v$1 = process.env.GOROOT; + if (!(v$1 === undefined) && !($internalize(v$1, $String) === "")) { + return $internalize(v$1, $String); + } + } + return "/usr/local/go"; + }; + $pkg.GOROOT = GOROOT; + registerPosition = function(funcName, file, line, col) { + var _entry, _key, _tuple, col, f, file, found, funcName, key, line, pc, pc$1; + key = file + ":" + itoa(line) + ":" + itoa(col); + _tuple = (_entry = $mapIndex(knownPositions,$String.keyFor(key)), _entry !== undefined ? [_entry.v, true] : [0, false]); + pc = _tuple[0]; + found = _tuple[1]; + if (found) { + return pc; + } + f = new Func.ptr(funcName, file, line, new structType.ptr()); + pc$1 = ((positionCounters.$length >>> 0)); + positionCounters = $append(positionCounters, f); + _key = key; (knownPositions || $throwRuntimeError("assignment to entry in nil map")).set($String.keyFor(_key), { k: _key, v: pc$1 }); + return pc$1; + }; + itoa = function(i) { + var i; + return $internalize(new ($global.String)(i), $String); + }; + callstack = function(skip, limit) { + var limit, lines, skip; + skip = (skip + 1 >> 0) + 1 >> 0; + lines = new ($global.Error)().stack.split($externalize("\n", $String)).slice(skip, skip + limit >> 0); + return parseCallstack(lines); + }; + parseCallstack = function(lines) { + var _entry, _entry$1, _tuple, alias, frame, frames, i, l, lines, ok; + frames = new sliceType$1([]); + l = $parseInt(lines.length); + i = 0; + while (true) { + if (!(i < l)) { break; } + frame = $clone(ParseCallFrame(lines[i]), basicFrame); + if ((_entry = $mapIndex(hiddenFrames,$String.keyFor(frame.FuncName)), _entry !== undefined ? _entry.v : false)) { + i = i + (1) >> 0; + continue; + } + _tuple = (_entry$1 = $mapIndex(knownFrames,$String.keyFor(frame.FuncName)), _entry$1 !== undefined ? [_entry$1.v, true] : ["", false]); + alias = _tuple[0]; + ok = _tuple[1]; + if (ok) { + frame.FuncName = alias; + } + frames = $append(frames, frame); + if (frame.FuncName === "runtime.goexit") { + break; + } + i = i + (1) >> 0; + } + return frames; + }; + ParseCallFrame = function(info) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, col, file, fn, funcName, idx, info, line, openIdx, parts, parts$1, parts$2, pos, split; + if (($parseInt(info.indexOf($externalize("@", $String))) >> 0) >= 0) { + split = new ($global.RegExp)($externalize("[@:]", $String)); + parts = info.split(split); + return new basicFrame.ptr($internalize(parts[0], $String), $internalize(parts.slice(1, $parseInt(parts.length) - 2 >> 0).join($externalize(":", $String)), $String), $parseInt(parts[($parseInt(parts.length) - 2 >> 0)]) >> 0, $parseInt(parts[($parseInt(parts.length) - 1 >> 0)]) >> 0); + } + openIdx = $parseInt(info.lastIndexOf($externalize("(", $String))) >> 0; + if (openIdx === -1) { + parts$1 = info.split($externalize(":", $String)); + return new basicFrame.ptr("", $internalize(parts$1.slice(0, $parseInt(parts$1.length) - 2 >> 0).join($externalize(":", $String)).replace(new ($global.RegExp)($externalize("^\\s*at ", $String)), $externalize("", $String)), $String), $parseInt(parts$1[($parseInt(parts$1.length) - 2 >> 0)]) >> 0, $parseInt(parts$1[($parseInt(parts$1.length) - 1 >> 0)]) >> 0); + } + _tmp = ""; + _tmp$1 = ""; + file = _tmp; + funcName = _tmp$1; + _tmp$2 = 0; + _tmp$3 = 0; + line = _tmp$2; + col = _tmp$3; + pos = info.substring(openIdx + 1 >> 0, $parseInt(info.indexOf($externalize(")", $String))) >> 0); + parts$2 = pos.split($externalize(":", $String)); + if ($internalize(pos, $String) === "") { + file = ""; + } else { + file = $internalize(parts$2.slice(0, $parseInt(parts$2.length) - 2 >> 0).join($externalize(":", $String)), $String); + line = $parseInt(parts$2[($parseInt(parts$2.length) - 2 >> 0)]) >> 0; + col = $parseInt(parts$2[($parseInt(parts$2.length) - 1 >> 0)]) >> 0; + } + fn = info.substring(($parseInt(info.indexOf($externalize("at ", $String))) >> 0) + 3 >> 0, $parseInt(info.indexOf($externalize(" (", $String))) >> 0); + idx = $parseInt(fn.indexOf($externalize("[as ", $String))) >> 0; + if (idx > 0) { + fn = fn.substring(idx + 4 >> 0, fn.indexOf($externalize("]", $String))); + } + funcName = $internalize(fn, $String); + return new basicFrame.ptr(funcName, file, line, col); + }; + $pkg.ParseCallFrame = ParseCallFrame; + Caller = function(skip) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, file, frames, line, ok, pc, skip; + pc = 0; + file = ""; + line = 0; + ok = false; + skip = skip + 1 >> 0; + frames = callstack(skip, 1); + if (!((frames.$length === 1))) { + _tmp = 0; + _tmp$1 = ""; + _tmp$2 = 0; + _tmp$3 = false; + pc = _tmp; + file = _tmp$1; + line = _tmp$2; + ok = _tmp$3; + return [pc, file, line, ok]; + } + pc = registerPosition((0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).FuncName, (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).File, (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).Line, (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).Col); + _tmp$4 = pc; + _tmp$5 = (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).File; + _tmp$6 = (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).Line; + _tmp$7 = true; + pc = _tmp$4; + file = _tmp$5; + line = _tmp$6; + ok = _tmp$7; + return [pc, file, line, ok]; + }; + $pkg.Caller = Caller; + SetFinalizer = function(x, f) { + var f, x; + }; + $pkg.SetFinalizer = SetFinalizer; + Func.ptr.prototype.Entry = function() { + return 0; + }; + Func.prototype.Entry = function() { return this.$val.Entry(); }; + Func.ptr.prototype.FileLine = function(pc) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, f, file, line, pc; + file = ""; + line = 0; + f = this; + if (f === ptrType.nil) { + _tmp = ""; + _tmp$1 = 0; + file = _tmp; + line = _tmp$1; + return [file, line]; + } + _tmp$2 = f.file; + _tmp$3 = f.line; + file = _tmp$2; + line = _tmp$3; + return [file, line]; + }; + Func.prototype.FileLine = function(pc) { return this.$val.FileLine(pc); }; + Func.ptr.prototype.Name = function() { + var f; + f = this; + if (f === ptrType.nil || f.name === "") { + return ""; + } + return f.name; + }; + Func.prototype.Name = function() { return this.$val.Name(); }; + FuncForPC = function(pc) { + var ipc, pc; + ipc = ((pc >> 0)); + if (ipc >= positionCounters.$length) { + $panic(new $String("GopherJS: pc=" + itoa(ipc) + " is out of range of known position counters")); + } + return ((ipc < 0 || ipc >= positionCounters.$length) ? ($throwRuntimeError("index out of range"), undefined) : positionCounters.$array[positionCounters.$offset + ipc]); + }; + $pkg.FuncForPC = FuncForPC; + KeepAlive = function(param) { + var param; + }; + $pkg.KeepAlive = KeepAlive; errorString.prototype.RuntimeError = function() { var e; e = this.$val; @@ -2401,25 +2820,2390 @@ $packages["runtime"] = (function() { return "runtime error: " + (e); }; $ptrType(errorString).prototype.Error = function() { return new errorString(this.$get()).Error(); }; - ptrType.methods = [{prop: "string", name: "string", pkg: "runtime", typ: $funcType([], [$String], false)}, {prop: "pkgpath", name: "pkgpath", pkg: "runtime", typ: $funcType([], [$String], false)}]; - ptrType$4.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + throw$1 = function(s) { + var s; + $panic(new errorString((s))); + }; + nanotime = function() { + return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); + }; + $linknames["runtime.nanotime"] = nanotime; + fastrand = function() { + return (($parseFloat($global.Math.random()) * 4.294967295e+09 >> 0)); + }; + $linknames["runtime.fastrand"] = fastrand; + ptrType$1.methods = [{prop: "string", name: "string", pkg: "runtime", typ: $funcType([], [$String], false)}, {prop: "pkgpath", name: "pkgpath", pkg: "runtime", typ: $funcType([], [$String], false)}]; + ptrType$2.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType.methods = [{prop: "Entry", name: "Entry", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "FileLine", name: "FileLine", pkg: "", typ: $funcType([$Uintptr], [$String, $Int], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}]; errorString.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; _type.init("runtime", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); - TypeAssertionError.init("runtime", [{prop: "_interface", name: "_interface", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "concrete", name: "concrete", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "asserted", name: "asserted", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "missingMethod", name: "missingMethod", embedded: false, exported: false, typ: $String, tag: ""}]); + TypeAssertionError.init("runtime", [{prop: "_interface", name: "_interface", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "concrete", name: "concrete", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "asserted", name: "asserted", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "missingMethod", name: "missingMethod", embedded: false, exported: false, typ: $String, tag: ""}]); + basicFrame.init("", [{prop: "FuncName", name: "FuncName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "File", name: "File", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Line", name: "Line", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Col", name: "Col", embedded: false, exported: true, typ: $Int, tag: ""}]); + Func.init("runtime", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "file", name: "file", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "line", name: "line", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "opaque", name: "opaque", embedded: false, exported: false, typ: structType, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = bytealg.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sys.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + buildVersion = ""; + knownPositions = $makeMap($String.keyFor, []); + positionCounters = new sliceType([]); + hiddenFrames = $makeMap($String.keyFor, [{ k: "$callDeferred", v: true }]); + knownFrames = $makeMap($String.keyFor, [{ k: "$panic", v: "runtime.gopanic" }, { k: "$goroutine", v: "runtime.goexit" }]); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); +$packages["internal/goarch"] = (function() { + var $pkg = {}, $init; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/unsafeheader"] = (function() { + var $pkg = {}, $init, Slice; + Slice = $pkg.Slice = $newType(0, $kindStruct, "unsafeheader.Slice", true, "internal/unsafeheader", true, function(Data_, Len_, Cap_) { + this.$val = this; + if (arguments.length === 0) { + this.Data = 0; + this.Len = 0; + this.Cap = 0; + return; + } + this.Data = Data_; + this.Len = Len_; + this.Cap = Cap_; + }); + Slice.init("", [{prop: "Data", name: "Data", embedded: false, exported: true, typ: $UnsafePointer, tag: ""}, {prop: "Len", name: "Len", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Cap", name: "Cap", embedded: false, exported: true, typ: $Int, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/reflectlite"] = (function() { + var $pkg = {}, $init, js, goarch, unsafeheader, runtime, Value, flag, ValueError, Type, Kind, tflag, rtype, method, chanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, nameOff, typeOff, textOff, errorString, Method, uncommonType, funcType, name, nameData, mapIter, TypeEx, ptrType$1, sliceType$1, sliceType$2, sliceType$3, sliceType$4, ptrType$2, funcType$1, ptrType$4, sliceType$5, ptrType$5, sliceType$6, ptrType$6, ptrType$7, sliceType$7, sliceType$8, sliceType$9, sliceType$10, ptrType$8, structType$2, ptrType$9, arrayType$2, sliceType$13, ptrType$10, funcType$2, ptrType$11, funcType$3, ptrType$12, ptrType$13, kindNames, callHelper, initialized, uint8Type, idJsType, idReflectType, idKindType, idRtype, uncommonTypeMap, nameMap, nameOffList, typeOffList, jsObjectPtr, selectHelper, implements$1, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, unquote, init, jsType, reflectType, setKindType, newName, newNameOff, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, TypeOf, ValueOf, FuncOf, SliceOf, unsafe_New, typedmemmove, keyFor, mapaccess, mapiterinit, mapiterkey, mapiternext, maplen, methodReceiver, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, PtrTo, copyVal; + js = $packages["github.com/gopherjs/gopherjs/js"]; + goarch = $packages["internal/goarch"]; + unsafeheader = $packages["internal/unsafeheader"]; + runtime = $packages["runtime"]; + Value = $pkg.Value = $newType(0, $kindStruct, "reflectlite.Value", true, "internal/reflectlite", true, function(typ_, ptr_, flag_) { + this.$val = this; + if (arguments.length === 0) { + this.typ = ptrType$1.nil; + this.ptr = 0; + this.flag = 0; + return; + } + this.typ = typ_; + this.ptr = ptr_; + this.flag = flag_; + }); + flag = $pkg.flag = $newType(4, $kindUintptr, "reflectlite.flag", true, "internal/reflectlite", false, null); + ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflectlite.ValueError", true, "internal/reflectlite", true, function(Method_, Kind_) { + this.$val = this; + if (arguments.length === 0) { + this.Method = ""; + this.Kind = 0; + return; + } + this.Method = Method_; + this.Kind = Kind_; + }); + Type = $pkg.Type = $newType(8, $kindInterface, "reflectlite.Type", true, "internal/reflectlite", true, null); + Kind = $pkg.Kind = $newType(4, $kindUint, "reflectlite.Kind", true, "internal/reflectlite", true, null); + tflag = $pkg.tflag = $newType(1, $kindUint8, "reflectlite.tflag", true, "internal/reflectlite", false, null); + rtype = $pkg.rtype = $newType(0, $kindStruct, "reflectlite.rtype", true, "internal/reflectlite", false, function(size_, ptrdata_, hash_, tflag_, align_, fieldAlign_, kind_, equal_, gcdata_, str_, ptrToThis_) { + this.$val = this; + if (arguments.length === 0) { + this.size = 0; + this.ptrdata = 0; + this.hash = 0; + this.tflag = 0; + this.align = 0; + this.fieldAlign = 0; + this.kind = 0; + this.equal = $throwNilPointerError; + this.gcdata = ptrType$6.nil; + this.str = 0; + this.ptrToThis = 0; + return; + } + this.size = size_; + this.ptrdata = ptrdata_; + this.hash = hash_; + this.tflag = tflag_; + this.align = align_; + this.fieldAlign = fieldAlign_; + this.kind = kind_; + this.equal = equal_; + this.gcdata = gcdata_; + this.str = str_; + this.ptrToThis = ptrToThis_; + }); + method = $pkg.method = $newType(0, $kindStruct, "reflectlite.method", true, "internal/reflectlite", false, function(name_, mtyp_, ifn_, tfn_) { + this.$val = this; + if (arguments.length === 0) { + this.name = 0; + this.mtyp = 0; + this.ifn = 0; + this.tfn = 0; + return; + } + this.name = name_; + this.mtyp = mtyp_; + this.ifn = ifn_; + this.tfn = tfn_; + }); + chanDir = $pkg.chanDir = $newType(4, $kindInt, "reflectlite.chanDir", true, "internal/reflectlite", false, null); + arrayType = $pkg.arrayType = $newType(0, $kindStruct, "reflectlite.arrayType", true, "internal/reflectlite", false, function(rtype_, elem_, slice_, len_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.elem = ptrType$1.nil; + this.slice = ptrType$1.nil; + this.len = 0; + return; + } + this.rtype = rtype_; + this.elem = elem_; + this.slice = slice_; + this.len = len_; + }); + chanType = $pkg.chanType = $newType(0, $kindStruct, "reflectlite.chanType", true, "internal/reflectlite", false, function(rtype_, elem_, dir_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.elem = ptrType$1.nil; + this.dir = 0; + return; + } + this.rtype = rtype_; + this.elem = elem_; + this.dir = dir_; + }); + imethod = $pkg.imethod = $newType(0, $kindStruct, "reflectlite.imethod", true, "internal/reflectlite", false, function(name_, typ_) { + this.$val = this; + if (arguments.length === 0) { + this.name = 0; + this.typ = 0; + return; + } + this.name = name_; + this.typ = typ_; + }); + interfaceType = $pkg.interfaceType = $newType(0, $kindStruct, "reflectlite.interfaceType", true, "internal/reflectlite", false, function(rtype_, pkgPath_, methods_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.pkgPath = new name.ptr(ptrType$6.nil); + this.methods = sliceType$9.nil; + return; + } + this.rtype = rtype_; + this.pkgPath = pkgPath_; + this.methods = methods_; + }); + mapType = $pkg.mapType = $newType(0, $kindStruct, "reflectlite.mapType", true, "internal/reflectlite", false, function(rtype_, key_, elem_, bucket_, hasher_, keysize_, valuesize_, bucketsize_, flags_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.key = ptrType$1.nil; + this.elem = ptrType$1.nil; + this.bucket = ptrType$1.nil; + this.hasher = $throwNilPointerError; + this.keysize = 0; + this.valuesize = 0; + this.bucketsize = 0; + this.flags = 0; + return; + } + this.rtype = rtype_; + this.key = key_; + this.elem = elem_; + this.bucket = bucket_; + this.hasher = hasher_; + this.keysize = keysize_; + this.valuesize = valuesize_; + this.bucketsize = bucketsize_; + this.flags = flags_; + }); + ptrType = $pkg.ptrType = $newType(0, $kindStruct, "reflectlite.ptrType", true, "internal/reflectlite", false, function(rtype_, elem_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.elem = ptrType$1.nil; + return; + } + this.rtype = rtype_; + this.elem = elem_; + }); + sliceType = $pkg.sliceType = $newType(0, $kindStruct, "reflectlite.sliceType", true, "internal/reflectlite", false, function(rtype_, elem_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.elem = ptrType$1.nil; + return; + } + this.rtype = rtype_; + this.elem = elem_; + }); + structField = $pkg.structField = $newType(0, $kindStruct, "reflectlite.structField", true, "internal/reflectlite", false, function(name_, typ_, offsetEmbed_) { + this.$val = this; + if (arguments.length === 0) { + this.name = new name.ptr(ptrType$6.nil); + this.typ = ptrType$1.nil; + this.offsetEmbed = 0; + return; + } + this.name = name_; + this.typ = typ_; + this.offsetEmbed = offsetEmbed_; + }); + structType = $pkg.structType = $newType(0, $kindStruct, "reflectlite.structType", true, "internal/reflectlite", false, function(rtype_, pkgPath_, fields_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.pkgPath = new name.ptr(ptrType$6.nil); + this.fields = sliceType$10.nil; + return; + } + this.rtype = rtype_; + this.pkgPath = pkgPath_; + this.fields = fields_; + }); + nameOff = $pkg.nameOff = $newType(4, $kindInt32, "reflectlite.nameOff", true, "internal/reflectlite", false, null); + typeOff = $pkg.typeOff = $newType(4, $kindInt32, "reflectlite.typeOff", true, "internal/reflectlite", false, null); + textOff = $pkg.textOff = $newType(4, $kindInt32, "reflectlite.textOff", true, "internal/reflectlite", false, null); + errorString = $pkg.errorString = $newType(0, $kindStruct, "reflectlite.errorString", true, "internal/reflectlite", false, function(s_) { + this.$val = this; + if (arguments.length === 0) { + this.s = ""; + return; + } + this.s = s_; + }); + Method = $pkg.Method = $newType(0, $kindStruct, "reflectlite.Method", true, "internal/reflectlite", true, function(Name_, PkgPath_, Type_, Func_, Index_) { + this.$val = this; + if (arguments.length === 0) { + this.Name = ""; + this.PkgPath = ""; + this.Type = $ifaceNil; + this.Func = new Value.ptr(ptrType$1.nil, 0, 0); + this.Index = 0; + return; + } + this.Name = Name_; + this.PkgPath = PkgPath_; + this.Type = Type_; + this.Func = Func_; + this.Index = Index_; + }); + uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflectlite.uncommonType", true, "internal/reflectlite", false, function(pkgPath_, mcount_, xcount_, moff_, _methods_) { + this.$val = this; + if (arguments.length === 0) { + this.pkgPath = 0; + this.mcount = 0; + this.xcount = 0; + this.moff = 0; + this._methods = sliceType$5.nil; + return; + } + this.pkgPath = pkgPath_; + this.mcount = mcount_; + this.xcount = xcount_; + this.moff = moff_; + this._methods = _methods_; + }); + funcType = $pkg.funcType = $newType(0, $kindStruct, "reflectlite.funcType", true, "internal/reflectlite", false, function(rtype_, inCount_, outCount_, _in_, _out_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + this.inCount = 0; + this.outCount = 0; + this._in = sliceType$2.nil; + this._out = sliceType$2.nil; + return; + } + this.rtype = rtype_; + this.inCount = inCount_; + this.outCount = outCount_; + this._in = _in_; + this._out = _out_; + }); + name = $pkg.name = $newType(0, $kindStruct, "reflectlite.name", true, "internal/reflectlite", false, function(bytes_) { + this.$val = this; + if (arguments.length === 0) { + this.bytes = ptrType$6.nil; + return; + } + this.bytes = bytes_; + }); + nameData = $pkg.nameData = $newType(0, $kindStruct, "reflectlite.nameData", true, "internal/reflectlite", false, function(name_, tag_, exported_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.tag = ""; + this.exported = false; + return; + } + this.name = name_; + this.tag = tag_; + this.exported = exported_; + }); + mapIter = $pkg.mapIter = $newType(0, $kindStruct, "reflectlite.mapIter", true, "internal/reflectlite", false, function(t_, m_, keys_, i_, last_) { + this.$val = this; + if (arguments.length === 0) { + this.t = $ifaceNil; + this.m = null; + this.keys = null; + this.i = 0; + this.last = null; + return; + } + this.t = t_; + this.m = m_; + this.keys = keys_; + this.i = i_; + this.last = last_; + }); + TypeEx = $pkg.TypeEx = $newType(8, $kindInterface, "reflectlite.TypeEx", true, "internal/reflectlite", true, null); + ptrType$1 = $ptrType(rtype); + sliceType$1 = $sliceType(name); + sliceType$2 = $sliceType(ptrType$1); + sliceType$3 = $sliceType($String); + sliceType$4 = $sliceType($emptyInterface); + ptrType$2 = $ptrType(js.Object); + funcType$1 = $funcType([sliceType$4], [ptrType$2], true); + ptrType$4 = $ptrType(uncommonType); + sliceType$5 = $sliceType(method); + ptrType$5 = $ptrType(funcType); + sliceType$6 = $sliceType(Value); + ptrType$6 = $ptrType($Uint8); + ptrType$7 = $ptrType($UnsafePointer); + sliceType$7 = $sliceType(Type); + sliceType$8 = $sliceType(ptrType$2); + sliceType$9 = $sliceType(imethod); + sliceType$10 = $sliceType(structField); + ptrType$8 = $ptrType(nameData); + structType$2 = $structType("internal/reflectlite", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); + ptrType$9 = $ptrType(mapIter); + arrayType$2 = $arrayType($Uintptr, 2); + sliceType$13 = $sliceType($Uint8); + ptrType$10 = $ptrType(ValueError); + funcType$2 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); + ptrType$11 = $ptrType(interfaceType); + funcType$3 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); + ptrType$12 = $ptrType(structField); + ptrType$13 = $ptrType(errorString); + flag.prototype.kind = function() { + var f; + f = this.$val; + return ((((f & 31) >>> 0) >>> 0)); + }; + $ptrType(flag).prototype.kind = function() { return new flag(this.$get()).kind(); }; + flag.prototype.ro = function() { + var f; + f = this.$val; + if (!((((f & 96) >>> 0) === 0))) { + return 32; + } + return 0; + }; + $ptrType(flag).prototype.ro = function() { return new flag(this.$get()).ro(); }; + Value.ptr.prototype.pointer = function() { + var v; + v = this; + if (!((v.typ.size === 4)) || !v.typ.pointers()) { + $panic(new $String("can't call pointer on a non-pointer Value")); + } + if (!((((v.flag & 128) >>> 0) === 0))) { + return (v.ptr).$get(); + } + return v.ptr; + }; + Value.prototype.pointer = function() { return this.$val.pointer(); }; + ValueError.ptr.prototype.Error = function() { + var e; + e = this; + if (e.Kind === 0) { + return "reflect: call of " + e.Method + " on zero Value"; + } + return "reflect: call of " + e.Method + " on " + new Kind(e.Kind).String() + " Value"; + }; + ValueError.prototype.Error = function() { return this.$val.Error(); }; + flag.prototype.mustBeExported = function() { + var f; + f = this.$val; + if (f === 0) { + $panic(new ValueError.ptr(methodName(), 0)); + } + if (!((((f & 96) >>> 0) === 0))) { + $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); + } + }; + $ptrType(flag).prototype.mustBeExported = function() { return new flag(this.$get()).mustBeExported(); }; + flag.prototype.mustBeAssignable = function() { + var f; + f = this.$val; + if (f === 0) { + $panic(new ValueError.ptr(methodName(), 0)); + } + if (!((((f & 96) >>> 0) === 0))) { + $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); + } + if (((f & 256) >>> 0) === 0) { + $panic(new $String("reflect: " + methodName() + " using unaddressable value")); + } + }; + $ptrType(flag).prototype.mustBeAssignable = function() { return new flag(this.$get()).mustBeAssignable(); }; + Value.ptr.prototype.CanSet = function() { + var v; + v = this; + return ((v.flag & 352) >>> 0) === 256; + }; + Value.prototype.CanSet = function() { return this.$val.CanSet(); }; + Value.ptr.prototype.IsValid = function() { + var v; + v = this; + return !((v.flag === 0)); + }; + Value.prototype.IsValid = function() { return this.$val.IsValid(); }; + Value.ptr.prototype.Kind = function() { + var v; + v = this; + return new flag(v.flag).kind(); + }; + Value.prototype.Kind = function() { return this.$val.Kind(); }; + Value.ptr.prototype.Type = function() { + var f, v; + v = this; + f = v.flag; + if (f === 0) { + $panic(new ValueError.ptr("reflectlite.Value.Type", 0)); + } + return v.typ; + }; + Value.prototype.Type = function() { return this.$val.Type(); }; + structField.ptr.prototype.embedded = function() { + var f; + f = this; + return !((((f.offsetEmbed & 1) >>> 0) === 0)); + }; + structField.prototype.embedded = function() { return this.$val.embedded(); }; + Kind.prototype.String = function() { + var k; + k = this.$val; + if (((k >> 0)) < kindNames.$length) { + return ((k < 0 || k >= kindNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + k]); + } + return (0 >= kindNames.$length ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + 0]); + }; + $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; + rtype.ptr.prototype.String = function() { + var s, t; + t = this; + s = $clone(t.nameOff(t.str), name).name(); + if (!((((t.tflag & 2) >>> 0) === 0))) { + return $substring(s, 1); + } + return s; + }; + rtype.prototype.String = function() { return this.$val.String(); }; + rtype.ptr.prototype.Size = function() { + var t; + t = this; + return t.size; + }; + rtype.prototype.Size = function() { return this.$val.Size(); }; + rtype.ptr.prototype.Kind = function() { + var t; + t = this; + return ((((t.kind & 31) >>> 0) >>> 0)); + }; + rtype.prototype.Kind = function() { return this.$val.Kind(); }; + rtype.ptr.prototype.pointers = function() { + var t; + t = this; + return !((t.ptrdata === 0)); + }; + rtype.prototype.pointers = function() { return this.$val.pointers(); }; + rtype.ptr.prototype.common = function() { + var t; + t = this; + return t; + }; + rtype.prototype.common = function() { return this.$val.common(); }; + rtype.ptr.prototype.exportedMethods = function() { + var t, ut; + t = this; + ut = t.uncommon(); + if (ut === ptrType$4.nil) { + return sliceType$5.nil; + } + return ut.exportedMethods(); + }; + rtype.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; + rtype.ptr.prototype.NumMethod = function() { + var t, tt; + t = this; + if (t.Kind() === 20) { + tt = (t.kindType); + return tt.NumMethod(); + } + return t.exportedMethods().$length; + }; + rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + rtype.ptr.prototype.PkgPath = function() { + var t, ut; + t = this; + if (((t.tflag & 4) >>> 0) === 0) { + return ""; + } + ut = t.uncommon(); + if (ut === ptrType$4.nil) { + return ""; + } + return $clone(t.nameOff(ut.pkgPath), name).name(); + }; + rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; + rtype.ptr.prototype.hasName = function() { + var t; + t = this; + return !((((t.tflag & 4) >>> 0) === 0)); + }; + rtype.prototype.hasName = function() { return this.$val.hasName(); }; + rtype.ptr.prototype.Name = function() { + var i, s, t; + t = this; + if (!t.hasName()) { + return ""; + } + s = t.String(); + i = s.length - 1 >> 0; + while (true) { + if (!(i >= 0 && !((s.charCodeAt(i) === 46)))) { break; } + i = i - (1) >> 0; + } + return $substring(s, (i + 1 >> 0)); + }; + rtype.prototype.Name = function() { return this.$val.Name(); }; + rtype.ptr.prototype.chanDir = function() { + var t, tt; + t = this; + if (!((t.Kind() === 18))) { + $panic(new $String("reflect: chanDir of non-chan type")); + } + tt = (t.kindType); + return ((tt.dir >> 0)); + }; + rtype.prototype.chanDir = function() { return this.$val.chanDir(); }; + rtype.ptr.prototype.Elem = function() { + var _1, t, tt, tt$1, tt$2, tt$3, tt$4; + t = this; + _1 = t.Kind(); + if (_1 === (17)) { + tt = (t.kindType); + return toType(tt.elem); + } else if (_1 === (18)) { + tt$1 = (t.kindType); + return toType(tt$1.elem); + } else if (_1 === (21)) { + tt$2 = (t.kindType); + return toType(tt$2.elem); + } else if (_1 === (22)) { + tt$3 = (t.kindType); + return toType(tt$3.elem); + } else if (_1 === (23)) { + tt$4 = (t.kindType); + return toType(tt$4.elem); + } + $panic(new $String("reflect: Elem of invalid type")); + }; + rtype.prototype.Elem = function() { return this.$val.Elem(); }; + rtype.ptr.prototype.In = function(i) { + var i, t, tt, x; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: In of non-func type")); + } + tt = (t.kindType); + return toType((x = tt.in$(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); + }; + rtype.prototype.In = function(i) { return this.$val.In(i); }; + rtype.ptr.prototype.Len = function() { + var t, tt; + t = this; + if (!((t.Kind() === 17))) { + $panic(new $String("reflect: Len of non-array type")); + } + tt = (t.kindType); + return ((tt.len >> 0)); + }; + rtype.prototype.Len = function() { return this.$val.Len(); }; + rtype.ptr.prototype.NumIn = function() { + var t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: NumIn of non-func type")); + } + tt = (t.kindType); + return ((tt.inCount >> 0)); + }; + rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; + rtype.ptr.prototype.NumOut = function() { + var t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: NumOut of non-func type")); + } + tt = (t.kindType); + return tt.out().$length; + }; + rtype.prototype.NumOut = function() { return this.$val.NumOut(); }; + rtype.ptr.prototype.Out = function(i) { + var i, t, tt, x; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: Out of non-func type")); + } + tt = (t.kindType); + return toType((x = tt.out(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); + }; + rtype.prototype.Out = function(i) { return this.$val.Out(i); }; + interfaceType.ptr.prototype.NumMethod = function() { + var t; + t = this; + return t.methods.$length; + }; + interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + rtype.ptr.prototype.Implements = function(u) { + var {_r, t, u, $s, $r, $c} = $restore(this, {u}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.Implements")); + } + _r = u.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 20))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 20))) { */ case 1: + $panic(new $String("reflect: non-interface type passed to Type.Implements")); + /* } */ case 2: + $s = -1; return implements$1($assertType(u, ptrType$1), t); + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.Implements, $c: true, $r, _r, t, u, $s};return $f; + }; + rtype.prototype.Implements = function(u) { return this.$val.Implements(u); }; + rtype.ptr.prototype.AssignableTo = function(u) { + var {$24r, _r, t, u, uu, $s, $r, $c} = $restore(this, {u}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.AssignableTo")); + } + uu = $assertType(u, ptrType$1); + _r = directlyAssignable(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r || implements$1(uu, t); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.AssignableTo, $c: true, $r, $24r, _r, t, u, uu, $s};return $f; + }; + rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; + implements$1 = function(T, V) { + var T, V, i, i$1, j, j$1, t, tm, tm$1, tmName, tmName$1, tmPkgPath, tmPkgPath$1, v, v$1, vm, vm$1, vmName, vmName$1, vmPkgPath, vmPkgPath$1, vmethods, x, x$1, x$2; + if (!((T.Kind() === 20))) { + return false; + } + t = (T.kindType); + if (t.methods.$length === 0) { + return true; + } + if (V.Kind() === 20) { + v = (V.kindType); + i = 0; + j = 0; + while (true) { + if (!(j < v.methods.$length)) { break; } + tm = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + tmName = $clone(t.rtype.nameOff(tm.name), name); + vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])); + vmName = $clone(V.nameOff(vm.name), name); + if ($clone(vmName, name).name() === $clone(tmName, name).name() && V.typeOff(vm.typ) === t.rtype.typeOff(tm.typ)) { + if (!$clone(tmName, name).isExported()) { + tmPkgPath = $clone(tmName, name).pkgPath(); + if (tmPkgPath === "") { + tmPkgPath = $clone(t.pkgPath, name).name(); + } + vmPkgPath = $clone(vmName, name).pkgPath(); + if (vmPkgPath === "") { + vmPkgPath = $clone(v.pkgPath, name).name(); + } + if (!(tmPkgPath === vmPkgPath)) { + j = j + (1) >> 0; + continue; + } + } + i = i + (1) >> 0; + if (i >= t.methods.$length) { + return true; + } + } + j = j + (1) >> 0; + } + return false; + } + v$1 = V.uncommon(); + if (v$1 === ptrType$4.nil) { + return false; + } + i$1 = 0; + vmethods = v$1.methods(); + j$1 = 0; + while (true) { + if (!(j$1 < ((v$1.mcount >> 0)))) { break; } + tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); + tmName$1 = $clone(t.rtype.nameOff(tm$1.name), name); + vm$1 = $clone(((j$1 < 0 || j$1 >= vmethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : vmethods.$array[vmethods.$offset + j$1]), method); + vmName$1 = $clone(V.nameOff(vm$1.name), name); + if ($clone(vmName$1, name).name() === $clone(tmName$1, name).name() && V.typeOff(vm$1.mtyp) === t.rtype.typeOff(tm$1.typ)) { + if (!$clone(tmName$1, name).isExported()) { + tmPkgPath$1 = $clone(tmName$1, name).pkgPath(); + if (tmPkgPath$1 === "") { + tmPkgPath$1 = $clone(t.pkgPath, name).name(); + } + vmPkgPath$1 = $clone(vmName$1, name).pkgPath(); + if (vmPkgPath$1 === "") { + vmPkgPath$1 = $clone(V.nameOff(v$1.pkgPath), name).name(); + } + if (!(tmPkgPath$1 === vmPkgPath$1)) { + j$1 = j$1 + (1) >> 0; + continue; + } + } + i$1 = i$1 + (1) >> 0; + if (i$1 >= t.methods.$length) { + return true; + } + } + j$1 = j$1 + (1) >> 0; + } + return false; + }; + directlyAssignable = function(T, V) { + var {$24r, T, V, _r, $s, $r, $c} = $restore(this, {T, V}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (T === V) { + $s = -1; return true; + } + if (T.hasName() && V.hasName() || !((T.Kind() === V.Kind()))) { + $s = -1; return false; + } + _r = haveIdenticalUnderlyingType(T, V, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: directlyAssignable, $c: true, $r, $24r, T, V, _r, $s};return $f; + }; + haveIdenticalType = function(T, V, cmpTags) { + var {$24r, T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, cmpTags, $s, $r, $c} = $restore(this, {T, V, cmpTags}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (cmpTags) { + $s = -1; return $interfaceIsEqual(T, V); + } + _r = T.Name(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = V.Name(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + if (!(_r === _r$1)) { _v = true; $s = 3; continue s; } + _r$2 = T.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = V.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _v = !((_r$2 === _r$3)); case 3: + /* */ if (_v) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_v) { */ case 1: + $s = -1; return false; + /* } */ case 2: + _r$4 = T.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _arg = _r$4; + _r$5 = V.common(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$1 = _r$5; + _r$6 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + $24r = _r$6; + $s = 11; case 11: return $24r; + /* */ } return; } var $f = {$blk: haveIdenticalType, $c: true, $r, $24r, T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, cmpTags, $s};return $f; + }; + haveIdenticalUnderlyingType = function(T, V, cmpTags) { + var {$24r, $24r$1, $24r$2, $24r$3, T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _v, _v$1, _v$2, _v$3, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s, $r, $c} = $restore(this, {T, V, cmpTags}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (T === V) { + $s = -1; return true; + } + kind = T.Kind(); + if (!((kind === V.Kind()))) { + $s = -1; return false; + } + if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { + $s = -1; return true; + } + _1 = kind; + /* */ if (_1 === (17)) { $s = 2; continue; } + /* */ if (_1 === (18)) { $s = 3; continue; } + /* */ if (_1 === (19)) { $s = 4; continue; } + /* */ if (_1 === (20)) { $s = 5; continue; } + /* */ if (_1 === (21)) { $s = 6; continue; } + /* */ if ((_1 === (22)) || (_1 === (23))) { $s = 7; continue; } + /* */ if (_1 === (25)) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (_1 === (17)) { */ case 2: + if (!(T.Len() === V.Len())) { _v = false; $s = 10; continue s; } + _r = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 10: + $24r = _v; + $s = 12; case 12: return $24r; + /* } else if (_1 === (18)) { */ case 3: + if (!(V.chanDir() === 3)) { _v$1 = false; $s = 15; continue s; } + _r$1 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v$1 = _r$1; case 15: + /* */ if (_v$1) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (_v$1) { */ case 13: + $s = -1; return true; + /* } */ case 14: + if (!(V.chanDir() === T.chanDir())) { _v$2 = false; $s = 17; continue s; } + _r$2 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$2 = _r$2; case 17: + $24r$1 = _v$2; + $s = 19; case 19: return $24r$1; + /* } else if (_1 === (19)) { */ case 4: + t = (T.kindType); + v = (V.kindType); + if (!((t.outCount === v.outCount)) || !((t.inCount === v.inCount))) { + $s = -1; return false; + } + i = 0; + /* while (true) { */ case 20: + /* if (!(i < t.rtype.NumIn())) { break; } */ if(!(i < t.rtype.NumIn())) { $s = 21; continue; } + _r$3 = haveIdenticalType(t.rtype.In(i), v.rtype.In(i), cmpTags); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (!_r$3) { $s = 22; continue; } + /* */ $s = 23; continue; + /* if (!_r$3) { */ case 22: + $s = -1; return false; + /* } */ case 23: + i = i + (1) >> 0; + $s = 20; continue; + case 21: + i$1 = 0; + /* while (true) { */ case 25: + /* if (!(i$1 < t.rtype.NumOut())) { break; } */ if(!(i$1 < t.rtype.NumOut())) { $s = 26; continue; } + _r$4 = haveIdenticalType(t.rtype.Out(i$1), v.rtype.Out(i$1), cmpTags); /* */ $s = 29; case 29: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ if (!_r$4) { $s = 27; continue; } + /* */ $s = 28; continue; + /* if (!_r$4) { */ case 27: + $s = -1; return false; + /* } */ case 28: + i$1 = i$1 + (1) >> 0; + $s = 25; continue; + case 26: + $s = -1; return true; + /* } else if (_1 === (20)) { */ case 5: + t$1 = (T.kindType); + v$1 = (V.kindType); + if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { + $s = -1; return true; + } + $s = -1; return false; + /* } else if (_1 === (21)) { */ case 6: + _r$5 = haveIdenticalType(T.Key(), V.Key(), cmpTags); /* */ $s = 31; case 31: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + if (!(_r$5)) { _v$3 = false; $s = 30; continue s; } + _r$6 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 32; case 32: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _v$3 = _r$6; case 30: + $24r$2 = _v$3; + $s = 33; case 33: return $24r$2; + /* } else if ((_1 === (22)) || (_1 === (23))) { */ case 7: + _r$7 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 34; case 34: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + $24r$3 = _r$7; + $s = 35; case 35: return $24r$3; + /* } else if (_1 === (25)) { */ case 8: + t$2 = (T.kindType); + v$2 = (V.kindType); + if (!((t$2.fields.$length === v$2.fields.$length))) { + $s = -1; return false; + } + if (!($clone(t$2.pkgPath, name).name() === $clone(v$2.pkgPath, name).name())) { + $s = -1; return false; + } + _ref = t$2.fields; + _i = 0; + /* while (true) { */ case 36: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 37; continue; } + i$2 = _i; + tf = (x = t$2.fields, ((i$2 < 0 || i$2 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i$2])); + vf = (x$1 = v$2.fields, ((i$2 < 0 || i$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$2])); + if (!($clone(tf.name, name).name() === $clone(vf.name, name).name())) { + $s = -1; return false; + } + _r$8 = haveIdenticalType(tf.typ, vf.typ, cmpTags); /* */ $s = 40; case 40: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + /* */ if (!_r$8) { $s = 38; continue; } + /* */ $s = 39; continue; + /* if (!_r$8) { */ case 38: + $s = -1; return false; + /* } */ case 39: + if (cmpTags && !($clone(tf.name, name).tag() === $clone(vf.name, name).tag())) { + $s = -1; return false; + } + if (!((tf.offsetEmbed === vf.offsetEmbed))) { + $s = -1; return false; + } + _i++; + $s = 36; continue; + case 37: + $s = -1; return true; + /* } */ case 9: + case 1: + $s = -1; return false; + /* */ } return; } var $f = {$blk: haveIdenticalUnderlyingType, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _v, _v$1, _v$2, _v$3, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s};return $f; + }; + toType = function(t) { + var t; + if (t === ptrType$1.nil) { + return $ifaceNil; + } + return t; + }; + ifaceIndir = function(t) { + var t; + return ((t.kind & 32) >>> 0) === 0; + }; + Value.ptr.prototype.object = function() { + var _1, newVal, v, val; + v = this; + if ((v.typ.Kind() === 17) || (v.typ.Kind() === 25)) { + return v.ptr; + } + if (!((((v.flag & 128) >>> 0) === 0))) { + val = v.ptr.$get(); + if (!(val === $ifaceNil) && !(val.constructor === jsType(v.typ))) { + switch (0) { default: + _1 = v.typ.Kind(); + if ((_1 === (11)) || (_1 === (6))) { + val = new (jsType(v.typ))(val.$high, val.$low); + } else if ((_1 === (15)) || (_1 === (16))) { + val = new (jsType(v.typ))(val.$real, val.$imag); + } else if (_1 === (23)) { + if (val === val.constructor.nil) { + val = jsType(v.typ).nil; + break; + } + newVal = new (jsType(v.typ))(val.$array); + newVal.$offset = val.$offset; + newVal.$length = val.$length; + newVal.$capacity = val.$capacity; + val = newVal; + } + } + } + return val; + } + return v.ptr; + }; + Value.prototype.object = function() { return this.$val.object(); }; + Value.ptr.prototype.assignTo = function(context, dst, target) { + var {_r, _r$1, _r$2, context, dst, fl, target, v, x, $s, $r, $c} = $restore(this, {context, dst, target}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: + _r = makeMethodValue(context, $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + Value.copy(v, _r); + /* } */ case 2: + _r$1 = directlyAssignable(dst, v.typ); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 5; continue; } + /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (_r$1) { */ case 5: + fl = (((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0; + fl = (fl | (((dst.Kind() >>> 0)))) >>> 0; + $s = -1; return new Value.ptr(dst, v.ptr, fl); + /* } else if (implements$1(dst, v.typ)) { */ case 6: + if (target === 0) { + target = unsafe_New(dst); + } + _r$2 = valueInterface($clone(v, Value)); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + x = _r$2; + if (dst.NumMethod() === 0) { + (target).$set(x); + } else { + ifaceE2I(dst, x, target); + } + $s = -1; return new Value.ptr(dst, target, 148); + /* } */ case 7: + case 4: + $panic(new $String(context + ": value of type " + v.typ.String() + " is not assignable to type " + dst.String())); + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.assignTo, $c: true, $r, _r, _r$1, _r$2, context, dst, fl, target, v, x, $s};return $f; + }; + Value.prototype.assignTo = function(context, dst, target) { return this.$val.assignTo(context, dst, target); }; + Value.ptr.prototype.Cap = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if (_1 === (17)) { + return v.typ.Len(); + } else if ((_1 === (18)) || (_1 === (23))) { + return $parseInt($clone(v, Value).object().$capacity) >> 0; + } + $panic(new ValueError.ptr("reflect.Value.Cap", k)); + }; + Value.prototype.Cap = function() { return this.$val.Cap(); }; + Value.ptr.prototype.Index = function(i) { + var {$24r, $24r$1, _1, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + a = [a]; + a$1 = [a$1]; + c = [c]; + i = [i]; + typ = [typ]; + typ$1 = [typ$1]; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + /* */ if (_1 === (17)) { $s = 2; continue; } + /* */ if (_1 === (23)) { $s = 3; continue; } + /* */ if (_1 === (24)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_1 === (17)) { */ case 2: + tt = (v.typ.kindType); + if (i[0] < 0 || i[0] > ((tt.len >> 0))) { + $panic(new $String("reflect: array index out of range")); + } + typ[0] = tt.elem; + fl = (((((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; + a[0] = v.ptr; + /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 7: + $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { + return wrapJsObject(typ[0], a[0][i[0]]); + }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { + var x; + a[0][i[0]] = unwrapJsObject(typ[0], x); + }; })(a, a$1, c, i, typ, typ$1))), fl); + /* } */ case 8: + _r = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 10; case 10: return $24r; + /* } else if (_1 === (23)) { */ case 3: + s = $clone(v, Value).object(); + if (i[0] < 0 || i[0] >= ($parseInt(s.$length) >> 0)) { + $panic(new $String("reflect: slice index out of range")); + } + tt$1 = (v.typ.kindType); + typ$1[0] = tt$1.elem; + fl$1 = (((384 | new flag(v.flag).ro()) >>> 0) | ((typ$1[0].Kind() >>> 0))) >>> 0; + i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; + a$1[0] = s.$array; + /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 11; continue; } + /* */ $s = 12; continue; + /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 11: + $s = -1; return new Value.ptr(typ$1[0], (new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { + return wrapJsObject(typ$1[0], a$1[0][i[0]]); + }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { + var x; + a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); + }; })(a, a$1, c, i, typ, typ$1))), fl$1); + /* } */ case 12: + _r$1 = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[0][i[0]]), fl$1); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r$1 = _r$1; + $s = 14; case 14: return $24r$1; + /* } else if (_1 === (24)) { */ case 4: + str = (v.ptr).$get(); + if (i[0] < 0 || i[0] >= str.length) { + $panic(new $String("reflect: string index out of range")); + } + fl$2 = (((new flag(v.flag).ro() | 8) >>> 0) | 128) >>> 0; + c[0] = str.charCodeAt(i[0]); + $s = -1; return new Value.ptr(uint8Type, ((c.$ptr || (c.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))), fl$2); + /* } else { */ case 5: + $panic(new ValueError.ptr("reflect.Value.Index", k)); + /* } */ case 6: + case 1: + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Index, $c: true, $r, $24r, $24r$1, _1, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s};return $f; + }; + Value.prototype.Index = function(i) { return this.$val.Index(i); }; + Value.ptr.prototype.InterfaceData = function() { + var v; + v = this; + $panic(new $String("InterfaceData is not supported by GopherJS")); + }; + Value.prototype.InterfaceData = function() { return this.$val.InterfaceData(); }; + Value.ptr.prototype.IsNil = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if ((_1 === (22)) || (_1 === (23))) { + return $clone(v, Value).object() === jsType(v.typ).nil; + } else if (_1 === (18)) { + return $clone(v, Value).object() === $chanNil; + } else if (_1 === (19)) { + return $clone(v, Value).object() === $throwNilPointerError; + } else if (_1 === (21)) { + return $clone(v, Value).object() === false; + } else if (_1 === (20)) { + return $clone(v, Value).object() === $ifaceNil; + } else if (_1 === (26)) { + return $clone(v, Value).object() === 0; + } else { + $panic(new ValueError.ptr("reflect.Value.IsNil", k)); + } + }; + Value.prototype.IsNil = function() { return this.$val.IsNil(); }; + Value.ptr.prototype.Len = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if ((_1 === (17)) || (_1 === (24))) { + return $parseInt($clone(v, Value).object().length); + } else if (_1 === (23)) { + return $parseInt($clone(v, Value).object().$length) >> 0; + } else if (_1 === (18)) { + return $parseInt($clone(v, Value).object().$buffer.length) >> 0; + } else if (_1 === (21)) { + return $parseInt($clone(v, Value).object().size) >> 0; + } else { + $panic(new ValueError.ptr("reflect.Value.Len", k)); + } + }; + Value.prototype.Len = function() { return this.$val.Len(); }; + Value.ptr.prototype.Pointer = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if ((_1 === (18)) || (_1 === (21)) || (_1 === (22)) || (_1 === (26))) { + if ($clone(v, Value).IsNil()) { + return 0; + } + return $clone(v, Value).object(); + } else if (_1 === (19)) { + if ($clone(v, Value).IsNil()) { + return 0; + } + return 1; + } else if (_1 === (23)) { + if ($clone(v, Value).IsNil()) { + return 0; + } + return $clone(v, Value).object().$array; + } else { + $panic(new ValueError.ptr("reflect.Value.Pointer", k)); + } + }; + Value.prototype.Pointer = function() { return this.$val.Pointer(); }; + Value.ptr.prototype.Set = function(x) { + var {_1, _r, _r$1, v, x, $s, $r, $c} = $restore(this, {x}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(x.flag).mustBeExported(); + _r = $clone(x, Value).assignTo("reflect.Set", v.typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + Value.copy(x, _r); + /* */ if (!((((v.flag & 128) >>> 0) === 0))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((((v.flag & 128) >>> 0) === 0))) { */ case 2: + _1 = v.typ.Kind(); + /* */ if (_1 === (17)) { $s = 5; continue; } + /* */ if (_1 === (20)) { $s = 6; continue; } + /* */ if (_1 === (25)) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (_1 === (17)) { */ case 5: + jsType(v.typ).copy(v.ptr, x.ptr); + $s = 9; continue; + /* } else if (_1 === (20)) { */ case 6: + _r$1 = valueInterface($clone(x, Value)); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + v.ptr.$set(_r$1); + $s = 9; continue; + /* } else if (_1 === (25)) { */ case 7: + copyStruct(v.ptr, x.ptr, v.typ); + $s = 9; continue; + /* } else { */ case 8: + v.ptr.$set($clone(x, Value).object()); + /* } */ case 9: + case 4: + $s = -1; return; + /* } */ case 3: + v.ptr = x.ptr; + $s = -1; return; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Set, $c: true, $r, _1, _r, _r$1, v, x, $s};return $f; + }; + Value.prototype.Set = function(x) { return this.$val.Set(x); }; + Value.ptr.prototype.SetBytes = function(x) { + var {_r, _r$1, _v, slice, typedSlice, v, x, $s, $r, $c} = $restore(this, {x}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 8))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 8))) { */ case 1: + $panic(new $String("reflect.Value.SetBytes of non-byte slice")); + /* } */ case 2: + slice = x; + if (!(v.typ.Name() === "")) { _v = true; $s = 6; continue s; } + _r$1 = v.typ.Elem().Name(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = !(_r$1 === ""); case 6: + /* */ if (_v) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_v) { */ case 4: + typedSlice = new (jsType(v.typ))(slice.$array); + typedSlice.$offset = slice.$offset; + typedSlice.$length = slice.$length; + typedSlice.$capacity = slice.$capacity; + slice = typedSlice; + /* } */ case 5: + v.ptr.$set(slice); + $s = -1; return; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.SetBytes, $c: true, $r, _r, _r$1, _v, slice, typedSlice, v, x, $s};return $f; + }; + Value.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; + Value.ptr.prototype.SetCap = function(n) { + var n, newSlice, s, v; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + s = v.ptr.$get(); + if (n < ($parseInt(s.$length) >> 0) || n > ($parseInt(s.$capacity) >> 0)) { + $panic(new $String("reflect: slice capacity out of range in SetCap")); + } + newSlice = new (jsType(v.typ))(s.$array); + newSlice.$offset = s.$offset; + newSlice.$length = s.$length; + newSlice.$capacity = n; + v.ptr.$set(newSlice); + }; + Value.prototype.SetCap = function(n) { return this.$val.SetCap(n); }; + Value.ptr.prototype.SetLen = function(n) { + var n, newSlice, s, v; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + s = v.ptr.$get(); + if (n < 0 || n > ($parseInt(s.$capacity) >> 0)) { + $panic(new $String("reflect: slice length out of range in SetLen")); + } + newSlice = new (jsType(v.typ))(s.$array); + newSlice.$offset = s.$offset; + newSlice.$length = n; + newSlice.$capacity = s.$capacity; + v.ptr.$set(newSlice); + }; + Value.prototype.SetLen = function(n) { return this.$val.SetLen(n); }; + Value.ptr.prototype.Slice = function(i, j) { + var {$24r, $24r$1, _1, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s, $r, $c} = $restore(this, {i, j}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + cap = 0; + typ = $ifaceNil; + s = null; + kind = new flag(v.flag).kind(); + _1 = kind; + /* */ if (_1 === (17)) { $s = 2; continue; } + /* */ if (_1 === (23)) { $s = 3; continue; } + /* */ if (_1 === (24)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_1 === (17)) { */ case 2: + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); + } + tt = (v.typ.kindType); + cap = ((tt.len >> 0)); + typ = SliceOf(tt.elem); + s = new (jsType(typ))($clone(v, Value).object()); + $s = 6; continue; + /* } else if (_1 === (23)) { */ case 3: + typ = v.typ; + s = $clone(v, Value).object(); + cap = $parseInt(s.$capacity) >> 0; + $s = 6; continue; + /* } else if (_1 === (24)) { */ case 4: + str = (v.ptr).$get(); + if (i < 0 || j < i || j > str.length) { + $panic(new $String("reflect.Value.Slice: string slice index out of bounds")); + } + _r = ValueOf(new $String($substring(str, i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 8; case 8: return $24r; + /* } else { */ case 5: + $panic(new ValueError.ptr("reflect.Value.Slice", kind)); + /* } */ case 6: + case 1: + if (i < 0 || j < i || j > cap) { + $panic(new $String("reflect.Value.Slice: slice index out of bounds")); + } + _r$1 = makeValue(typ, $subslice(s, i, j), new flag(v.flag).ro()); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r$1 = _r$1; + $s = 10; case 10: return $24r$1; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Slice, $c: true, $r, $24r, $24r$1, _1, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s};return $f; + }; + Value.prototype.Slice = function(i, j) { return this.$val.Slice(i, j); }; + Value.ptr.prototype.Slice3 = function(i, j, k) { + var {$24r, _1, _r, cap, i, j, k, kind, s, tt, typ, v, $s, $r, $c} = $restore(this, {i, j, k}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + cap = 0; + typ = $ifaceNil; + s = null; + kind = new flag(v.flag).kind(); + _1 = kind; + if (_1 === (17)) { + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); + } + tt = (v.typ.kindType); + cap = ((tt.len >> 0)); + typ = SliceOf(tt.elem); + s = new (jsType(typ))($clone(v, Value).object()); + } else if (_1 === (23)) { + typ = v.typ; + s = $clone(v, Value).object(); + cap = $parseInt(s.$capacity) >> 0; + } else { + $panic(new ValueError.ptr("reflect.Value.Slice3", kind)); + } + if (i < 0 || j < i || k < j || k > cap) { + $panic(new $String("reflect.Value.Slice3: slice index out of bounds")); + } + _r = makeValue(typ, $subslice(s, i, j, k), new flag(v.flag).ro()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Slice3, $c: true, $r, $24r, _1, _r, cap, i, j, k, kind, s, tt, typ, v, $s};return $f; + }; + Value.prototype.Slice3 = function(i, j, k) { return this.$val.Slice3(i, j, k); }; + Value.ptr.prototype.Close = function() { + var v; + v = this; + new flag(v.flag).mustBe(18); + new flag(v.flag).mustBeExported(); + $close($clone(v, Value).object()); + }; + Value.prototype.Close = function() { return this.$val.Close(); }; + Value.ptr.prototype.Elem = function() { + var {$24r, _1, _r, fl, k, tt, typ, v, val, val$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + k = new flag(v.flag).kind(); + _1 = k; + /* */ if (_1 === (20)) { $s = 2; continue; } + /* */ if (_1 === (22)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (_1 === (20)) { */ case 2: + val = $clone(v, Value).object(); + if (val === $ifaceNil) { + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + } + typ = reflectType(val.constructor); + _r = makeValue(typ, val.$val, new flag(v.flag).ro()); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 7; case 7: return $24r; + /* } else if (_1 === (22)) { */ case 3: + if ($clone(v, Value).IsNil()) { + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + } + val$1 = $clone(v, Value).object(); + tt = (v.typ.kindType); + fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; + fl = (fl | (((tt.elem.Kind() >>> 0)))) >>> 0; + $s = -1; return new Value.ptr(tt.elem, (wrapJsObject(tt.elem, val$1)), fl); + /* } else { */ case 4: + $panic(new ValueError.ptr("reflect.Value.Elem", k)); + /* } */ case 5: + case 1: + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Elem, $c: true, $r, $24r, _1, _r, fl, k, tt, typ, v, val, val$1, $s};return $f; + }; + Value.prototype.Elem = function() { return this.$val.Elem(); }; + Value.ptr.prototype.NumField = function() { + var tt, v; + v = this; + new flag(v.flag).mustBe(25); + tt = (v.typ.kindType); + return tt.fields.$length; + }; + Value.prototype.NumField = function() { return this.$val.NumField(); }; + Value.ptr.prototype.MapKeys = function() { + var {_r, a, fl, i, it, key, keyType, m, mlen, tt, v, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(21); + tt = (v.typ.kindType); + keyType = tt.key; + fl = (new flag(v.flag).ro() | ((keyType.Kind() >>> 0))) >>> 0; + m = $clone(v, Value).pointer(); + mlen = 0; + if (!(m === 0)) { + mlen = maplen(m); + } + it = mapiterinit(v.typ, m); + a = $makeSlice(sliceType$6, mlen); + i = 0; + i = 0; + /* while (true) { */ case 1: + /* if (!(i < a.$length)) { break; } */ if(!(i < a.$length)) { $s = 2; continue; } + _r = mapiterkey(it); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + key = _r; + if (key === 0) { + /* break; */ $s = 2; continue; + } + Value.copy(((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i]), copyVal(keyType, fl, key)); + mapiternext(it); + i = i + (1) >> 0; + $s = 1; continue; + case 2: + $s = -1; return $subslice(a, 0, i); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.MapKeys, $c: true, $r, _r, a, fl, i, it, key, keyType, m, mlen, tt, v, $s};return $f; + }; + Value.prototype.MapKeys = function() { return this.$val.MapKeys(); }; + Value.ptr.prototype.MapIndex = function(key) { + var {_r, e, fl, k, key, tt, typ, v, $s, $r, $c} = $restore(this, {key}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(21); + tt = (v.typ.kindType); + _r = $clone(key, Value).assignTo("reflect.Value.MapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + Value.copy(key, _r); + k = 0; + if (!((((key.flag & 128) >>> 0) === 0))) { + k = key.ptr; + } else { + k = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); + } + e = mapaccess(v.typ, $clone(v, Value).pointer(), k); + if (e === 0) { + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + } + typ = tt.elem; + fl = new flag((((v.flag | key.flag) >>> 0))).ro(); + fl = (fl | (((typ.Kind() >>> 0)))) >>> 0; + $s = -1; return copyVal(typ, fl, e); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.MapIndex, $c: true, $r, _r, e, fl, k, key, tt, typ, v, $s};return $f; + }; + Value.prototype.MapIndex = function(key) { return this.$val.MapIndex(key); }; + Value.ptr.prototype.Field = function(i) { + var {$24r, _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + jsTag = [jsTag]; + prop = [prop]; + s = [s]; + typ = [typ]; + v = this; + if (!((new flag(v.flag).kind() === 25))) { + $panic(new ValueError.ptr("reflect.Value.Field", new flag(v.flag).kind())); + } + tt = (v.typ.kindType); + if (((i >>> 0)) >= ((tt.fields.$length >>> 0))) { + $panic(new $String("reflect: Field index out of range")); + } + prop[0] = $internalize(jsType(v.typ).fields[i].prop, $String); + field = (x = tt.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + typ[0] = field.typ; + fl = (((v.flag & 416) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; + if (!$clone(field.name, name).isExported()) { + if (field.embedded()) { + fl = (fl | (64)) >>> 0; + } else { + fl = (fl | (32)) >>> 0; + } + } + tag = $clone((x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).name, name).tag(); + /* */ if (!(tag === "") && !((i === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(tag === "") && !((i === 0))) { */ case 1: + jsTag[0] = getJsTag(tag); + /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!(jsTag[0] === "")) { */ case 3: + /* while (true) { */ case 5: + o = [o]; + _r = $clone(v, Value).Field(0); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + Value.copy(v, _r); + /* */ if (v.typ === jsObjectPtr) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (v.typ === jsObjectPtr) { */ case 8: + o[0] = $clone(v, Value).object().object; + $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { + return $internalize(o[0][$externalize(jsTag[0], $String)], jsType(typ[0])); + }; })(jsTag, o, prop, s, typ), (function(jsTag, o, prop, s, typ) { return function(x$2) { + var x$2; + o[0][$externalize(jsTag[0], $String)] = $externalize(x$2, jsType(typ[0])); + }; })(jsTag, o, prop, s, typ))), fl); + /* } */ case 9: + /* */ if (v.typ.Kind() === 22) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (v.typ.Kind() === 22) { */ case 10: + _r$1 = $clone(v, Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + Value.copy(v, _r$1); + /* } */ case 11: + $s = 5; continue; + case 6: + /* } */ case 4: + /* } */ case 2: + s[0] = v.ptr; + /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 13: + $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { + return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); + }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { + var x$2; + s[0][$externalize(prop[0], $String)] = unwrapJsObject(typ[0], x$2); + }; })(jsTag, prop, s, typ))), fl); + /* } */ case 14: + _r$2 = makeValue(typ[0], wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]), fl); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2; + $s = 16; case 16: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Field, $c: true, $r, $24r, _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s};return $f; + }; + Value.prototype.Field = function(i) { return this.$val.Field(i); }; + errorString.ptr.prototype.Error = function() { + var e; + e = this; + return e.s; + }; + errorString.prototype.Error = function() { return this.$val.Error(); }; + unquote = function(s) { + var s; + if (s.length < 2) { + return [s, $ifaceNil]; + } + if ((s.charCodeAt(0) === 39) || (s.charCodeAt(0) === 34)) { + if (s.charCodeAt((s.length - 1 >> 0)) === s.charCodeAt(0)) { + return [$substring(s, 1, (s.length - 1 >> 0)), $ifaceNil]; + } + return ["", $pkg.ErrSyntax]; + } + return [s, $ifaceNil]; + }; + flag.prototype.mustBe = function(expected) { + var expected, f; + f = this.$val; + if (!((((((f & 31) >>> 0) >>> 0)) === expected))) { + $panic(new ValueError.ptr(methodName(), new flag(f).kind())); + } + }; + $ptrType(flag).prototype.mustBe = function(expected) { return new flag(this.$get()).mustBe(expected); }; + rtype.ptr.prototype.Comparable = function() { + var {$24r, _1, _r, _r$1, ft, i, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + _1 = t.Kind(); + /* */ if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { $s = 2; continue; } + /* */ if (_1 === (17)) { $s = 3; continue; } + /* */ if (_1 === (25)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { */ case 2: + $s = -1; return false; + /* } else if (_1 === (17)) { */ case 3: + _r = t.Elem().Comparable(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 7; case 7: return $24r; + /* } else if (_1 === (25)) { */ case 4: + i = 0; + /* while (true) { */ case 8: + /* if (!(i < t.NumField())) { break; } */ if(!(i < t.NumField())) { $s = 9; continue; } + ft = $clone(t.Field(i), structField); + _r$1 = ft.typ.Comparable(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (!_r$1) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!_r$1) { */ case 10: + $s = -1; return false; + /* } */ case 11: + i = i + (1) >> 0; + $s = 8; continue; + case 9: + /* } */ case 5: + case 1: + $s = -1; return true; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.Comparable, $c: true, $r, $24r, _1, _r, _r$1, ft, i, t, $s};return $f; + }; + rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; + rtype.ptr.prototype.IsVariadic = function() { + var t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: IsVariadic of non-func type")); + } + tt = (t.kindType); + return !((((tt.outCount & 32768) >>> 0) === 0)); + }; + rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; + rtype.ptr.prototype.Field = function(i) { + var i, t, tt, x; + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: Field of non-struct type")); + } + tt = (t.kindType); + if (i < 0 || i >= tt.fields.$length) { + $panic(new $String("reflect: Field index out of bounds")); + } + return (x = tt.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + }; + rtype.prototype.Field = function(i) { return this.$val.Field(i); }; + rtype.ptr.prototype.Key = function() { + var t, tt; + t = this; + if (!((t.Kind() === 21))) { + $panic(new $String("reflect: Key of non-map type")); + } + tt = (t.kindType); + return toType(tt.key); + }; + rtype.prototype.Key = function() { return this.$val.Key(); }; + rtype.ptr.prototype.NumField = function() { + var t, tt; + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: NumField of non-struct type")); + } + tt = (t.kindType); + return tt.fields.$length; + }; + rtype.prototype.NumField = function() { return this.$val.NumField(); }; + rtype.ptr.prototype.Method = function(i) { + var {$24r, _i, _i$1, _r, _r$1, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + prop = [prop]; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + t = this; + /* */ if (t.Kind() === 20) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (t.Kind() === 20) { */ case 1: + tt = (t.kindType); + _r = tt.rtype.Method(i); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + Method.copy(m, _r); + $24r = m; + $s = 4; case 4: return $24r; + /* } */ case 2: + methods = t.exportedMethods(); + if (i < 0 || i >= methods.$length) { + $panic(new $String("reflect: Method index out of range")); + } + p = $clone(((i < 0 || i >= methods.$length) ? ($throwRuntimeError("index out of range"), undefined) : methods.$array[methods.$offset + i]), method); + pname = $clone(t.nameOff(p.name), name); + m.Name = $clone(pname, name).name(); + fl = 19; + mtyp = t.typeOff(p.mtyp); + ft = (mtyp.kindType); + in$1 = $makeSlice(sliceType$7, 0, (1 + ft.in$().$length >> 0)); + in$1 = $append(in$1, t); + _ref = ft.in$(); + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + in$1 = $append(in$1, arg); + _i++; + } + out = $makeSlice(sliceType$7, 0, ft.out().$length); + _ref$1 = ft.out(); + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + ret = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); + out = $append(out, ret); + _i$1++; + } + _r$1 = FuncOf(in$1, out, ft.rtype.IsVariadic()); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + mt = _r$1; + m.Type = mt; + prop[0] = $internalize($methodSet(t[$externalize(idJsType, $String)])[i].prop, $String); + fn = js.MakeFunc((function(prop) { return function(this$1, arguments$1) { + var arguments$1, rcvr, this$1; + rcvr = (0 >= arguments$1.$length ? ($throwRuntimeError("index out of range"), undefined) : arguments$1.$array[arguments$1.$offset + 0]); + return new $jsObjectPtr(rcvr[$externalize(prop[0], $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$8))); + }; })(prop)); + Value.copy(m.Func, new Value.ptr($assertType(mt, ptrType$1), (fn), fl)); + m.Index = i; + Method.copy(m, m); + $s = -1; return m; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.Method, $c: true, $r, $24r, _i, _i$1, _r, _r$1, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s};return $f; + }; + rtype.prototype.Method = function(i) { return this.$val.Method(i); }; + init = function() { + var {used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + used = (function(i) { + var i; + }); + $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$1 = new uncommonType.ptr(0, 0, 0, 0, sliceType$5.nil), new x$1.constructor.elem(x$1))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$2 = new method.ptr(0, 0, 0, 0), new x$2.constructor.elem(x$2))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$3 = new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, 0), new x$3.constructor.elem(x$3))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$4 = new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), ptrType$1.nil, 0), new x$4.constructor.elem(x$4))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$5 = new funcType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), 0, 0, sliceType$2.nil, sliceType$2.nil), new x$5.constructor.elem(x$5))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$6 = new interfaceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), new name.ptr(ptrType$6.nil), sliceType$9.nil), new x$6.constructor.elem(x$6))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$7 = new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0), new x$7.constructor.elem(x$7))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$8 = new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), ptrType$1.nil), new x$8.constructor.elem(x$8))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$9 = new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), ptrType$1.nil), new x$9.constructor.elem(x$9))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$10 = new structType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), new name.ptr(ptrType$6.nil), sliceType$10.nil), new x$10.constructor.elem(x$10))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$11 = new imethod.ptr(0, 0), new x$11.constructor.elem(x$11))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$12 = new structField.ptr(new name.ptr(ptrType$6.nil), ptrType$1.nil, 0), new x$12.constructor.elem(x$12))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + initialized = true; + uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); + $s = -1; return; + /* */ } return; } var $f = {$blk: init, $c: true, $r, used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s};return $f; + }; + jsType = function(typ) { + var typ; + return typ[$externalize(idJsType, $String)]; + }; + reflectType = function(typ) { + var _1, _i, _i$1, _i$2, _i$3, _key, _ref, _ref$1, _ref$2, _ref$3, dir, exported, exported$1, f, fields, i, i$1, i$2, i$3, i$4, i$5, imethods, in$1, m, m$1, m$2, methodSet, methods, offsetEmbed, out, outCount, params, reflectFields, reflectMethods, results, rt, typ, ut, xcount; + if (typ[$externalize(idReflectType, $String)] === undefined) { + rt = new rtype.ptr(((($parseInt(typ.size) >> 0) >>> 0)), 0, 0, 0, 0, 0, ((($parseInt(typ.kind) >> 0) << 24 >>> 24)), $throwNilPointerError, ptrType$6.nil, newNameOff($clone(newName(internalStr(typ.string), "", !!(typ.exported)), name)), 0); + rt[$externalize(idJsType, $String)] = typ; + typ[$externalize(idReflectType, $String)] = rt; + methodSet = $methodSet(typ); + if (!(($parseInt(methodSet.length) === 0)) || !!(typ.named)) { + rt.tflag = (rt.tflag | (1)) >>> 0; + if (!!(typ.named)) { + rt.tflag = (rt.tflag | (4)) >>> 0; + } + reflectMethods = sliceType$5.nil; + i = 0; + while (true) { + if (!(i < $parseInt(methodSet.length))) { break; } + m = methodSet[i]; + exported = internalStr(m.pkg) === ""; + if (!exported) { + i = i + (1) >> 0; + continue; + } + reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m.name), "", exported), name)), newTypeOff(reflectType(m.typ)), 0, 0)); + i = i + (1) >> 0; + } + xcount = ((reflectMethods.$length << 16 >>> 16)); + i$1 = 0; + while (true) { + if (!(i$1 < $parseInt(methodSet.length))) { break; } + m$1 = methodSet[i$1]; + exported$1 = internalStr(m$1.pkg) === ""; + if (exported$1) { + i$1 = i$1 + (1) >> 0; + continue; + } + reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m$1.name), "", exported$1), name)), newTypeOff(reflectType(m$1.typ)), 0, 0)); + i$1 = i$1 + (1) >> 0; + } + ut = new uncommonType.ptr(newNameOff($clone(newName(internalStr(typ.pkg), "", false), name)), (($parseInt(methodSet.length) << 16 >>> 16)), xcount, 0, reflectMethods); + _key = rt; (uncommonTypeMap || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$1.keyFor(_key), { k: _key, v: ut }); + ut[$externalize(idJsType, $String)] = typ; + } + _1 = rt.Kind(); + if (_1 === (17)) { + setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.elem), ptrType$1.nil, ((($parseInt(typ.len) >> 0) >>> 0)))); + } else if (_1 === (18)) { + dir = 3; + if (!!(typ.sendOnly)) { + dir = 2; + } + if (!!(typ.recvOnly)) { + dir = 1; + } + setKindType(rt, new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.elem), ((dir >>> 0)))); + } else if (_1 === (19)) { + params = typ.params; + in$1 = $makeSlice(sliceType$2, $parseInt(params.length)); + _ref = in$1; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i$2 = _i; + ((i$2 < 0 || i$2 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i$2] = reflectType(params[i$2])); + _i++; + } + results = typ.results; + out = $makeSlice(sliceType$2, $parseInt(results.length)); + _ref$1 = out; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$3 = _i$1; + ((i$3 < 0 || i$3 >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i$3] = reflectType(results[i$3])); + _i$1++; + } + outCount = (($parseInt(results.length) << 16 >>> 16)); + if (!!(typ.variadic)) { + outCount = (outCount | (32768)) >>> 0; + } + setKindType(rt, new funcType.ptr($clone(rt, rtype), (($parseInt(params.length) << 16 >>> 16)), outCount, in$1, out)); + } else if (_1 === (20)) { + methods = typ.methods; + imethods = $makeSlice(sliceType$9, $parseInt(methods.length)); + _ref$2 = imethods; + _i$2 = 0; + while (true) { + if (!(_i$2 < _ref$2.$length)) { break; } + i$4 = _i$2; + m$2 = methods[i$4]; + imethod.copy(((i$4 < 0 || i$4 >= imethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : imethods.$array[imethods.$offset + i$4]), new imethod.ptr(newNameOff($clone(newName(internalStr(m$2.name), "", internalStr(m$2.pkg) === ""), name)), newTypeOff(reflectType(m$2.typ)))); + _i$2++; + } + setKindType(rt, new interfaceType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkg), "", false), name), imethods)); + } else if (_1 === (21)) { + setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0)); + } else if (_1 === (22)) { + setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.elem))); + } else if (_1 === (23)) { + setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.elem))); + } else if (_1 === (25)) { + fields = typ.fields; + reflectFields = $makeSlice(sliceType$10, $parseInt(fields.length)); + _ref$3 = reflectFields; + _i$3 = 0; + while (true) { + if (!(_i$3 < _ref$3.$length)) { break; } + i$5 = _i$3; + f = fields[i$5]; + offsetEmbed = ((i$5 >>> 0)) << 1 >>> 0; + if (!!(f.embedded)) { + offsetEmbed = (offsetEmbed | (1)) >>> 0; + } + structField.copy(((i$5 < 0 || i$5 >= reflectFields.$length) ? ($throwRuntimeError("index out of range"), undefined) : reflectFields.$array[reflectFields.$offset + i$5]), new structField.ptr($clone(newName(internalStr(f.name), internalStr(f.tag), !!(f.exported)), name), reflectType(f.typ), offsetEmbed)); + _i$3++; + } + setKindType(rt, new structType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkgPath), "", false), name), reflectFields)); + } + } + return ((typ[$externalize(idReflectType, $String)])); + }; + setKindType = function(rt, kindType) { + var kindType, rt; + rt[$externalize(idKindType, $String)] = kindType; + kindType[$externalize(idRtype, $String)] = rt; + }; + uncommonType.ptr.prototype.methods = function() { + var t; + t = this; + return t._methods; + }; + uncommonType.prototype.methods = function() { return this.$val.methods(); }; + uncommonType.ptr.prototype.exportedMethods = function() { + var t; + t = this; + return $subslice(t._methods, 0, t.xcount, t.xcount); + }; + uncommonType.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; + rtype.ptr.prototype.uncommon = function() { + var _entry, t; + t = this; + return (_entry = $mapIndex(uncommonTypeMap,ptrType$1.keyFor(t)), _entry !== undefined ? _entry.v : ptrType$4.nil); + }; + rtype.prototype.uncommon = function() { return this.$val.uncommon(); }; + funcType.ptr.prototype.in$ = function() { + var t; + t = this; + return t._in; + }; + funcType.prototype.in$ = function() { return this.$val.in$(); }; + funcType.ptr.prototype.out = function() { + var t; + t = this; + return t._out; + }; + funcType.prototype.out = function() { return this.$val.out(); }; + name.ptr.prototype.name = function() { + var _entry, n, s; + s = ""; + n = this; + s = (_entry = $mapIndex(nameMap,ptrType$6.keyFor(n.bytes)), _entry !== undefined ? _entry.v : ptrType$8.nil).name; + return s; + }; + name.prototype.name = function() { return this.$val.name(); }; + name.ptr.prototype.tag = function() { + var _entry, n, s; + s = ""; + n = this; + s = (_entry = $mapIndex(nameMap,ptrType$6.keyFor(n.bytes)), _entry !== undefined ? _entry.v : ptrType$8.nil).tag; + return s; + }; + name.prototype.tag = function() { return this.$val.tag(); }; + name.ptr.prototype.pkgPath = function() { + var n; + n = this; + return ""; + }; + name.prototype.pkgPath = function() { return this.$val.pkgPath(); }; + name.ptr.prototype.isExported = function() { + var _entry, n; + n = this; + return (_entry = $mapIndex(nameMap,ptrType$6.keyFor(n.bytes)), _entry !== undefined ? _entry.v : ptrType$8.nil).exported; + }; + name.prototype.isExported = function() { return this.$val.isExported(); }; + newName = function(n, tag, exported) { + var _key, b, exported, n, tag; + b = $newDataPointer(0, ptrType$6); + _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$6.keyFor(_key), { k: _key, v: new nameData.ptr(n, tag, exported) }); + return new name.ptr(b); + }; + rtype.ptr.prototype.nameOff = function(off) { + var off, t, x; + t = this; + return (x = ((off >> 0)), ((x < 0 || x >= nameOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : nameOffList.$array[nameOffList.$offset + x])); + }; + rtype.prototype.nameOff = function(off) { return this.$val.nameOff(off); }; + newNameOff = function(n) { + var i, n; + i = nameOffList.$length; + nameOffList = $append(nameOffList, n); + return ((i >> 0)); + }; + rtype.ptr.prototype.typeOff = function(off) { + var off, t, x; + t = this; + return (x = ((off >> 0)), ((x < 0 || x >= typeOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : typeOffList.$array[typeOffList.$offset + x])); + }; + rtype.prototype.typeOff = function(off) { return this.$val.typeOff(off); }; + newTypeOff = function(t) { + var i, t; + i = typeOffList.$length; + typeOffList = $append(typeOffList, t); + return ((i >> 0)); + }; + internalStr = function(strObj) { + var c, strObj; + c = new structType$2.ptr(""); + c.str = strObj; + return c.str; + }; + isWrapped = function(typ) { + var typ; + return !!(jsType(typ).wrapped); + }; + copyStruct = function(dst, src, typ) { + var dst, fields, i, prop, src, typ; + fields = jsType(typ).fields; + i = 0; + while (true) { + if (!(i < $parseInt(fields.length))) { break; } + prop = $internalize(fields[i].prop, $String); + dst[$externalize(prop, $String)] = src[$externalize(prop, $String)]; + i = i + (1) >> 0; + } + }; + makeValue = function(t, v, fl) { + var {$24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s, $r, $c} = $restore(this, {t, v, fl}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + rt = _r; + _r$1 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + if (_r$1 === 17) { _v$1 = true; $s = 5; continue s; } + _r$2 = t.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$1 = _r$2 === 25; case 5: + if (_v$1) { _v = true; $s = 4; continue s; } + _r$3 = t.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _v = _r$3 === 22; case 4: + /* */ if (_v) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (_v) { */ case 2: + _r$4 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + $24r = new Value.ptr(rt, (v), (fl | ((_r$4 >>> 0))) >>> 0); + $s = 10; case 10: return $24r; + /* } */ case 3: + _r$5 = t.Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + $24r$1 = new Value.ptr(rt, ($newDataPointer(v, jsType(rt.ptrTo()))), (((fl | ((_r$5 >>> 0))) >>> 0) | 128) >>> 0); + $s = 12; case 12: return $24r$1; + /* */ } return; } var $f = {$blk: makeValue, $c: true, $r, $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s};return $f; + }; + TypeOf = function(i) { + var i; + if (!initialized) { + return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); + } + if ($interfaceIsEqual(i, $ifaceNil)) { + return $ifaceNil; + } + return reflectType(i.constructor); + }; + $pkg.TypeOf = TypeOf; + ValueOf = function(i) { + var {$24r, _r, i, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if ($interfaceIsEqual(i, $ifaceNil)) { + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + } + _r = makeValue(reflectType(i.constructor), i.$val, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: ValueOf, $c: true, $r, $24r, _r, i, $s};return $f; + }; + $pkg.ValueOf = ValueOf; + FuncOf = function(in$1, out, variadic) { + var {_i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s, $r, $c} = $restore(this, {in$1, out, variadic}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (!(variadic)) { _v = false; $s = 3; continue s; } + if (in$1.$length === 0) { _v$1 = true; $s = 4; continue s; } + _r = (x = in$1.$length - 1 >> 0, ((x < 0 || x >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x])).Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v$1 = !((_r === 23)); case 4: + _v = _v$1; case 3: + /* */ if (_v) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_v) { */ case 1: + $panic(new $String("reflect.FuncOf: last arg of variadic func must be slice")); + /* } */ case 2: + jsIn = $makeSlice(sliceType$8, in$1.$length); + _ref = in$1; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + ((i < 0 || i >= jsIn.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsIn.$array[jsIn.$offset + i] = jsType(v)); + _i++; + } + jsOut = $makeSlice(sliceType$8, out.$length); + _ref$1 = out; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + v$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); + ((i$1 < 0 || i$1 >= jsOut.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsOut.$array[jsOut.$offset + i$1] = jsType(v$1)); + _i$1++; + } + $s = -1; return reflectType($funcType($externalize(jsIn, sliceType$8), $externalize(jsOut, sliceType$8), $externalize(variadic, $Bool))); + /* */ } return; } var $f = {$blk: FuncOf, $c: true, $r, _i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s};return $f; + }; + $pkg.FuncOf = FuncOf; + rtype.ptr.prototype.ptrTo = function() { + var t; + t = this; + return reflectType($ptrType(jsType(t))); + }; + rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; + SliceOf = function(t) { + var t; + return reflectType($sliceType(jsType(t))); + }; + $pkg.SliceOf = SliceOf; + unsafe_New = function(typ) { + var _1, typ; + _1 = typ.Kind(); + if (_1 === (25)) { + return (new (jsType(typ).ptr)()); + } else if (_1 === (17)) { + return (jsType(typ).zero()); + } else { + return ($newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo()))); + } + }; + typedmemmove = function(t, dst, src) { + var dst, src, t; + dst.$set(src.$get()); + }; + keyFor = function(t, key) { + var k, key, kv, t; + kv = key; + if (!(kv.$get === undefined)) { + kv = kv.$get(); + } + k = $internalize(jsType(t.Key()).keyFor(kv), $String); + return [kv, k]; + }; + mapaccess = function(t, m, key) { + var _tuple, entry, k, key, m, t; + _tuple = keyFor(t, key); + k = _tuple[1]; + entry = m.get($externalize(k, $String)); + if (entry === undefined) { + return 0; + } + return ($newDataPointer(entry.v, jsType(PtrTo(t.Elem())))); + }; + mapIter.ptr.prototype.skipUntilValidKey = function() { + var iter, k; + iter = this; + while (true) { + if (!(iter.i < $parseInt(iter.keys.length))) { break; } + k = iter.keys[iter.i]; + if (!(iter.m.get(k) === undefined)) { + break; + } + iter.i = iter.i + (1) >> 0; + } + }; + mapIter.prototype.skipUntilValidKey = function() { return this.$val.skipUntilValidKey(); }; + mapiterinit = function(t, m) { + var m, t; + return (new mapIter.ptr(t, m, $global.Array.from(m.keys()), 0, null)); + }; + mapiterkey = function(it) { + var {$24r, _r, _r$1, _r$2, it, iter, k, kv, $s, $r, $c} = $restore(this, {it}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + iter = ($pointerOfStructConversion(it, ptrType$9)); + kv = null; + if (!(iter.last === null)) { + kv = iter.last; + } else { + iter.skipUntilValidKey(); + if (iter.i === $parseInt(iter.keys.length)) { + $s = -1; return 0; + } + k = iter.keys[iter.i]; + kv = iter.m.get(k); + iter.last = kv; + } + _r = $assertType(iter.t, TypeEx).Key(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = PtrTo(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = jsType(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = ($newDataPointer(kv.k, _r$2)); + $s = 4; case 4: return $24r; + /* */ } return; } var $f = {$blk: mapiterkey, $c: true, $r, $24r, _r, _r$1, _r$2, it, iter, k, kv, $s};return $f; + }; + mapiternext = function(it) { + var it, iter; + iter = ($pointerOfStructConversion(it, ptrType$9)); + iter.last = null; + iter.i = iter.i + (1) >> 0; + }; + maplen = function(m) { + var m; + return $parseInt(m.size) >> 0; + }; + methodReceiver = function(op, v, i) { + var _$12, fn, i, m, m$1, ms, op, prop, rcvr, t, tt, v, x; + _$12 = ptrType$1.nil; + t = ptrType$5.nil; + fn = 0; + prop = ""; + if (v.typ.Kind() === 20) { + tt = (v.typ.kindType); + if (i < 0 || i >= tt.methods.$length) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m = (x = tt.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + if (!$clone(tt.rtype.nameOff(m.name), name).isExported()) { + $panic(new $String("reflect: " + op + " of unexported method")); + } + t = (tt.rtype.typeOff(m.typ).kindType); + prop = $clone(tt.rtype.nameOff(m.name), name).name(); + } else { + ms = v.typ.exportedMethods(); + if (((i >>> 0)) >= ((ms.$length >>> 0))) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); + if (!$clone(v.typ.nameOff(m$1.name), name).isExported()) { + $panic(new $String("reflect: " + op + " of unexported method")); + } + t = (v.typ.typeOff(m$1.mtyp).kindType); + prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); + } + rcvr = $clone(v, Value).object(); + if (isWrapped(v.typ)) { + rcvr = new (jsType(v.typ))(rcvr); + } + fn = (rcvr[$externalize(prop, $String)]); + return [_$12, t, fn]; + }; + valueInterface = function(v) { + var {_r, cv, v, $s, $r, $c} = $restore(this, {v}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (v.flag === 0) { + $panic(new ValueError.ptr("reflect.Value.Interface", 0)); + } + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: + _r = makeMethodValue("Interface", $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + Value.copy(v, _r); + /* } */ case 2: + if (isWrapped(v.typ)) { + if (!((((v.flag & 128) >>> 0) === 0)) && ($clone(v, Value).Kind() === 25)) { + cv = jsType(v.typ).zero(); + copyStruct(cv, $clone(v, Value).object(), v.typ); + $s = -1; return ((new (jsType(v.typ))(cv))); + } + $s = -1; return ((new (jsType(v.typ))($clone(v, Value).object()))); + } + $s = -1; return (($clone(v, Value).object())); + /* */ } return; } var $f = {$blk: valueInterface, $c: true, $r, _r, cv, v, $s};return $f; + }; + ifaceE2I = function(t, src, dst) { + var dst, src, t; + dst.$set(src); + }; + methodName = function() { + return "?FIXME?"; + }; + makeMethodValue = function(op, v) { + var {$24r, _r, _tuple, fn, fv, op, rcvr, v, $s, $r, $c} = $restore(this, {op, v}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fn = [fn]; + rcvr = [rcvr]; + if (((v.flag & 512) >>> 0) === 0) { + $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); + } + _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); + fn[0] = _tuple[2]; + rcvr[0] = $clone(v, Value).object(); + if (isWrapped(v.typ)) { + rcvr[0] = new (jsType(v.typ))(rcvr[0]); + } + fv = js.MakeFunc((function(fn, rcvr) { return function(this$1, arguments$1) { + var arguments$1, this$1; + return new $jsObjectPtr(fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$8))); + }; })(fn, rcvr)); + _r = $clone(v, Value).Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = new Value.ptr(_r, (fv), (new flag(v.flag).ro() | 19) >>> 0); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: makeMethodValue, $c: true, $r, $24r, _r, _tuple, fn, fv, op, rcvr, v, $s};return $f; + }; + wrapJsObject = function(typ, val) { + var typ, val; + if ($interfaceIsEqual(typ, jsObjectPtr)) { + return new (jsType(jsObjectPtr))(val); + } + return val; + }; + unwrapJsObject = function(typ, val) { + var typ, val; + if ($interfaceIsEqual(typ, jsObjectPtr)) { + return val.object; + } + return val; + }; + getJsTag = function(tag) { + var _tuple, i, name$1, qvalue, tag, value; + while (true) { + if (!(!(tag === ""))) { break; } + i = 0; + while (true) { + if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } + i = i + (1) >> 0; + } + tag = $substring(tag, i); + if (tag === "") { + break; + } + i = 0; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 32)) && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)))) { break; } + i = i + (1) >> 0; + } + if ((i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { + break; + } + name$1 = ($substring(tag, 0, i)); + tag = $substring(tag, (i + 1 >> 0)); + i = 1; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } + if (tag.charCodeAt(i) === 92) { + i = i + (1) >> 0; + } + i = i + (1) >> 0; + } + if (i >= tag.length) { + break; + } + qvalue = ($substring(tag, 0, (i + 1 >> 0))); + tag = $substring(tag, (i + 1 >> 0)); + if (name$1 === "js") { + _tuple = unquote(qvalue); + value = _tuple[0]; + return value; + } + } + return ""; + }; + PtrTo = function(t) { + var t; + return $assertType(t, ptrType$1).ptrTo(); + }; + $pkg.PtrTo = PtrTo; + copyVal = function(typ, fl, ptr) { + var c, fl, ptr, typ; + if (ifaceIndir(typ)) { + c = unsafe_New(typ); + typedmemmove(typ, c, ptr); + return new Value.ptr(typ, c, (fl | 128) >>> 0); + } + return new Value.ptr(typ, (ptr).$get(), fl); + }; + Value.methods = [{prop: "pointer", name: "pointer", pkg: "internal/reflectlite", typ: $funcType([], [$UnsafePointer], false)}, {prop: "CanSet", name: "CanSet", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsValid", name: "IsValid", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "numMethod", name: "numMethod", pkg: "internal/reflectlite", typ: $funcType([], [$Int], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "object", name: "object", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$2], false)}, {prop: "assignTo", name: "assignTo", pkg: "internal/reflectlite", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "call", name: "call", pkg: "internal/reflectlite", typ: $funcType([$String, sliceType$6], [sliceType$6], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$2], false)}, {prop: "IsNil", name: "IsNil", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Pointer", name: "Pointer", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([Value], [], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType$13], [], false)}, {prop: "SetCap", name: "SetCap", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Slice", name: "Slice", pkg: "", typ: $funcType([$Int, $Int], [Value], false)}, {prop: "Slice3", name: "Slice3", pkg: "", typ: $funcType([$Int, $Int, $Int], [Value], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Value], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MapKeys", name: "MapKeys", pkg: "", typ: $funcType([], [sliceType$6], false)}, {prop: "MapIndex", name: "MapIndex", pkg: "", typ: $funcType([Value], [Value], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [Value], false)}]; + flag.methods = [{prop: "kind", name: "kind", pkg: "internal/reflectlite", typ: $funcType([], [Kind], false)}, {prop: "ro", name: "ro", pkg: "internal/reflectlite", typ: $funcType([], [flag], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "internal/reflectlite", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "internal/reflectlite", typ: $funcType([], [], false)}, {prop: "mustBe", name: "mustBe", pkg: "internal/reflectlite", typ: $funcType([Kind], [], false)}]; + ptrType$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + Kind.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$1.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "pointers", name: "pointers", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}, {prop: "common", name: "common", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$5], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "hasName", name: "hasName", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "chanDir", name: "chanDir", pkg: "internal/reflectlite", typ: $funcType([], [chanDir], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "kindType", name: "kindType", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [structField], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "uncommon", name: "uncommon", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$4], false)}, {prop: "nameOff", name: "nameOff", pkg: "internal/reflectlite", typ: $funcType([nameOff], [name], false)}, {prop: "typeOff", name: "typeOff", pkg: "internal/reflectlite", typ: $funcType([typeOff], [ptrType$1], false)}, {prop: "ptrTo", name: "ptrTo", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}]; + ptrType$11.methods = [{prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}]; + ptrType$12.methods = [{prop: "offset", name: "offset", pkg: "internal/reflectlite", typ: $funcType([], [$Uintptr], false)}, {prop: "embedded", name: "embedded", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}]; + ptrType$13.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$4.methods = [{prop: "methods", name: "methods", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$5], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$5], false)}]; + ptrType$5.methods = [{prop: "in$", name: "in", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$2], false)}, {prop: "out", name: "out", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$2], false)}]; + name.methods = [{prop: "data", name: "data", pkg: "internal/reflectlite", typ: $funcType([$Int, $String], [ptrType$6], false)}, {prop: "hasTag", name: "hasTag", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}, {prop: "readVarint", name: "readVarint", pkg: "internal/reflectlite", typ: $funcType([$Int], [$Int, $Int], false)}, {prop: "name", name: "name", pkg: "internal/reflectlite", typ: $funcType([], [$String], false)}, {prop: "tag", name: "tag", pkg: "internal/reflectlite", typ: $funcType([], [$String], false)}, {prop: "pkgPath", name: "pkgPath", pkg: "internal/reflectlite", typ: $funcType([], [$String], false)}, {prop: "isExported", name: "isExported", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}]; + ptrType$9.methods = [{prop: "skipUntilValidKey", name: "skipUntilValidKey", pkg: "internal/reflectlite", typ: $funcType([], [], false)}]; + Value.init("internal/reflectlite", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "flag", embedded: true, exported: false, typ: flag, tag: ""}]); + ValueError.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Kind", name: "Kind", embedded: false, exported: true, typ: Kind, tag: ""}]); + Type.init([{prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "common", name: "common", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$4], false)}]); + rtype.init("internal/reflectlite", [{prop: "size", name: "size", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "tflag", name: "tflag", embedded: false, exported: false, typ: tflag, tag: ""}, {prop: "align", name: "align", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "equal", name: "equal", embedded: false, exported: false, typ: funcType$2, tag: ""}, {prop: "gcdata", name: "gcdata", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "str", name: "str", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", embedded: false, exported: false, typ: typeOff, tag: ""}]); + method.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mtyp", name: "mtyp", embedded: false, exported: false, typ: typeOff, tag: ""}, {prop: "ifn", name: "ifn", embedded: false, exported: false, typ: textOff, tag: ""}, {prop: "tfn", name: "tfn", embedded: false, exported: false, typ: textOff, tag: ""}]); + arrayType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "slice", name: "slice", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); + chanType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "dir", name: "dir", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); + imethod.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: typeOff, tag: ""}]); + interfaceType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "methods", name: "methods", embedded: false, exported: false, typ: sliceType$9, tag: ""}]); + mapType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "hasher", name: "hasher", embedded: false, exported: false, typ: funcType$3, tag: ""}, {prop: "keysize", name: "keysize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "flags", name: "flags", embedded: false, exported: false, typ: $Uint32, tag: ""}]); + ptrType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); + sliceType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); + structField.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: name, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "offsetEmbed", name: "offsetEmbed", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); + structType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "fields", name: "fields", embedded: false, exported: false, typ: sliceType$10, tag: ""}]); + errorString.init("internal/reflectlite", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}]); + Method.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: Value, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int, tag: ""}]); + uncommonType.init("internal/reflectlite", [{prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mcount", name: "mcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "xcount", name: "xcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "moff", name: "moff", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "_methods", name: "_methods", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); + funcType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: "reflect:\"func\""}, {prop: "inCount", name: "inCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "outCount", name: "outCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "_in", name: "_in", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "_out", name: "_out", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); + name.init("internal/reflectlite", [{prop: "bytes", name: "bytes", embedded: false, exported: false, typ: ptrType$6, tag: ""}]); + nameData.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "exported", name: "exported", embedded: false, exported: false, typ: $Bool, tag: ""}]); + mapIter.init("internal/reflectlite", [{prop: "t", name: "t", embedded: false, exported: false, typ: Type, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "last", name: "last", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); + TypeEx.init([{prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "common", name: "common", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$4], false)}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = goarch.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unsafeheader.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + uint8Type = ptrType$1.nil; + nameOffList = sliceType$1.nil; + typeOffList = sliceType$2.nil; + kindNames = new sliceType$3(["invalid", "bool", "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", "float64", "complex64", "complex128", "array", "chan", "func", "interface", "map", "ptr", "slice", "string", "struct", "unsafe.Pointer"]); + callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); + $pkg.ErrSyntax = new errorString.ptr("invalid syntax"); + initialized = false; + idJsType = "_jsType"; + idReflectType = "_reflectType"; + idKindType = "kindType"; + idRtype = "_rtype"; + uncommonTypeMap = new $global.Map(); + nameMap = new $global.Map(); + jsObjectPtr = reflectType($jsObjectPtr); + selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); + $r = init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); $packages["errors"] = (function() { - var $pkg = {}, $init, errorString, ptrType, New; + var $pkg = {}, $init, reflectlite, errorString, ptrType, ptrType$1, errorType, _r, New; + reflectlite = $packages["internal/reflectlite"]; errorString = $pkg.errorString = $newType(0, $kindStruct, "errors.errorString", true, "errors", false, function(s_) { this.$val = this; if (arguments.length === 0) { @@ -2428,7 +5212,8 @@ $packages["errors"] = (function() { } this.s = s_; }); - ptrType = $ptrType(errorString); + ptrType = $ptrType($error); + ptrType$1 = $ptrType(errorString); New = function(text) { var text; return new errorString.ptr(text); @@ -2440,18 +5225,21 @@ $packages["errors"] = (function() { return e.s; }; errorString.prototype.Error = function() { return this.$val.Error(); }; - ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; errorString.init("errors", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = reflectlite.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r = reflectlite.TypeOf((ptrType.nil)).Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + errorType = _r; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/race"] = (function() { - var $pkg = {}, $init, Acquire, Release, ReleaseMerge, Disable, Enable, ReadRange, WriteRange; + var $pkg = {}, $init, Acquire, Release, ReleaseMerge, Disable, Enable; Acquire = function(addr) { var addr; }; @@ -2470,14 +5258,6 @@ $packages["internal/race"] = (function() { Enable = function() { }; $pkg.Enable = Enable; - ReadRange = function(addr, len) { - var addr, len; - }; - $pkg.ReadRange = ReadRange; - WriteRange = function(addr, len) { - var addr, len; - }; - $pkg.WriteRange = WriteRange; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: @@ -2487,7 +5267,7 @@ $packages["internal/race"] = (function() { return $pkg; })(); $packages["sync/atomic"] = (function() { - var $pkg = {}, $init, js, Value, ptrType, CompareAndSwapInt32, CompareAndSwapUint64, AddInt32, LoadInt32, LoadUint64, StoreInt32, StoreUint32; + var $pkg = {}, $init, js, Value, ptrType, CompareAndSwapInt32, CompareAndSwapUint64, AddInt32, LoadInt32, LoadUint64, StoreInt32, StoreUint32, sameType; js = $packages["github.com/gopherjs/gopherjs/js"]; Value = $pkg.Value = $newType(0, $kindStruct, "atomic.Value", true, "sync/atomic", true, function(v_) { this.$val = this; @@ -2551,19 +5331,59 @@ $packages["sync/atomic"] = (function() { return x; }; Value.prototype.Load = function() { return this.$val.Load(); }; - Value.ptr.prototype.Store = function(x) { - var v, x; + Value.ptr.prototype.Store = function(new$1) { + var new$1, v; v = this; - if ($interfaceIsEqual(x, $ifaceNil)) { - $panic(new $String("sync/atomic: store of nil value into Value")); - } - if (!($interfaceIsEqual(v.v, $ifaceNil)) && !(x.constructor === v.v.constructor)) { - $panic(new $String("sync/atomic: store of inconsistently typed value into Value")); - } - v.v = x; + v.checkNew("store", new$1); + v.v = new$1; }; - Value.prototype.Store = function(x) { return this.$val.Store(x); }; - ptrType.methods = [{prop: "Load", name: "Load", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Store", name: "Store", pkg: "", typ: $funcType([$emptyInterface], [], false)}]; + Value.prototype.Store = function(new$1) { return this.$val.Store(new$1); }; + Value.ptr.prototype.Swap = function(new$1) { + var _tmp, _tmp$1, new$1, old, v; + old = $ifaceNil; + v = this; + v.checkNew("swap", new$1); + _tmp = v.v; + _tmp$1 = new$1; + old = _tmp; + v.v = _tmp$1; + old = old; + return old; + }; + Value.prototype.Swap = function(new$1) { return this.$val.Swap(new$1); }; + Value.ptr.prototype.CompareAndSwap = function(old, new$1) { + var new$1, old, swapped, v; + swapped = false; + v = this; + v.checkNew("compare and swap", new$1); + if (!($interfaceIsEqual(v.v, $ifaceNil) && $interfaceIsEqual(old, $ifaceNil)) && !sameType(old, new$1)) { + $panic(new $String("sync/atomic: compare and swap of inconsistently typed values into Value")); + } + if (!($interfaceIsEqual(v.v, old))) { + swapped = false; + return swapped; + } + v.v = new$1; + swapped = true; + return swapped; + }; + Value.prototype.CompareAndSwap = function(old, new$1) { return this.$val.CompareAndSwap(old, new$1); }; + Value.ptr.prototype.checkNew = function(op, new$1) { + var new$1, op, v; + v = this; + if ($interfaceIsEqual(new$1, $ifaceNil)) { + $panic(new $String("sync/atomic: " + op + " of nil value into Value")); + } + if (!($interfaceIsEqual(v.v, $ifaceNil)) && !sameType(new$1, v.v)) { + $panic(new $String("sync/atomic: " + op + " of inconsistently typed value into Value")); + } + }; + Value.prototype.checkNew = function(op, new$1) { return this.$val.checkNew(op, new$1); }; + sameType = function(x, y) { + var x, y; + return x.constructor === y.constructor; + }; + ptrType.methods = [{prop: "Load", name: "Load", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Store", name: "Store", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "CompareAndSwap", name: "CompareAndSwap", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [$Bool], false)}, {prop: "checkNew", name: "checkNew", pkg: "sync/atomic", typ: $funcType([$String, $emptyInterface], [], false)}]; Value.init("sync/atomic", [{prop: "v", name: "v", embedded: false, exported: false, typ: $emptyInterface, tag: ""}]); $init = function() { $pkg.$init = function() {}; @@ -2575,74 +5395,10 @@ $packages["sync/atomic"] = (function() { return $pkg; })(); $packages["sync"] = (function() { - var $pkg = {}, $init, js, race, runtime, atomic, Pool, Mutex, Locker, poolLocalInternal, poolLocal, notifyList, RWMutex, rlocker, ptrType, sliceType, ptrType$1, chanType, sliceType$1, ptrType$6, ptrType$7, sliceType$4, ptrType$8, ptrType$9, funcType, ptrType$16, arrayType$2, semWaiters, semAwoken, expunged, allPools, runtime_registerPoolCleanup, runtime_SemacquireMutex, runtime_Semrelease, runtime_notifyListCheck, runtime_canSpin, runtime_nanotime, throw$1, poolCleanup, init, indexLocal, init$1, runtime_doSpin; + var $pkg = {}, $init, js, race, atomic, RWMutex, rlocker, notifyList, Mutex, Locker, Pool, ptrType$1, ptrType$2, ptrType$3, ptrType$4, chanType, sliceType$2, ptrType$15, sliceType$3, ptrType$18, funcType$2, expunged, semWaiters, semAwoken, init, runtime_doSpin, runtime_Semacquire, runtime_SemacquireMutex, runtime_Semrelease, runtime_notifyListCheck, runtime_canSpin, runtime_nanotime, throw$1; js = $packages["github.com/gopherjs/gopherjs/js"]; race = $packages["internal/race"]; - runtime = $packages["runtime"]; atomic = $packages["sync/atomic"]; - Pool = $pkg.Pool = $newType(0, $kindStruct, "sync.Pool", true, "sync", true, function(local_, localSize_, store_, New_) { - this.$val = this; - if (arguments.length === 0) { - this.local = 0; - this.localSize = 0; - this.store = sliceType$4.nil; - this.New = $throwNilPointerError; - return; - } - this.local = local_; - this.localSize = localSize_; - this.store = store_; - this.New = New_; - }); - Mutex = $pkg.Mutex = $newType(0, $kindStruct, "sync.Mutex", true, "sync", true, function(state_, sema_) { - this.$val = this; - if (arguments.length === 0) { - this.state = 0; - this.sema = 0; - return; - } - this.state = state_; - this.sema = sema_; - }); - Locker = $pkg.Locker = $newType(8, $kindInterface, "sync.Locker", true, "sync", true, null); - poolLocalInternal = $pkg.poolLocalInternal = $newType(0, $kindStruct, "sync.poolLocalInternal", true, "sync", false, function(private$0_, shared_, Mutex_) { - this.$val = this; - if (arguments.length === 0) { - this.private$0 = $ifaceNil; - this.shared = sliceType$4.nil; - this.Mutex = new Mutex.ptr(0, 0); - return; - } - this.private$0 = private$0_; - this.shared = shared_; - this.Mutex = Mutex_; - }); - poolLocal = $pkg.poolLocal = $newType(0, $kindStruct, "sync.poolLocal", true, "sync", false, function(poolLocalInternal_, pad_) { - this.$val = this; - if (arguments.length === 0) { - this.poolLocalInternal = new poolLocalInternal.ptr($ifaceNil, sliceType$4.nil, new Mutex.ptr(0, 0)); - this.pad = arrayType$2.zero(); - return; - } - this.poolLocalInternal = poolLocalInternal_; - this.pad = pad_; - }); - notifyList = $pkg.notifyList = $newType(0, $kindStruct, "sync.notifyList", true, "sync", false, function(wait_, notify_, lock_, head_, tail_) { - this.$val = this; - if (arguments.length === 0) { - this.wait = 0; - this.notify = 0; - this.lock = 0; - this.head = 0; - this.tail = 0; - return; - } - this.wait = wait_; - this.notify = notify_; - this.lock = lock_; - this.head = head_; - this.tail = tail_; - }); RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "sync.RWMutex", true, "sync", true, function(w_, writerSem_, readerSem_, readerCount_, readerWait_) { this.$val = this; if (arguments.length === 0) { @@ -2675,118 +5431,290 @@ $packages["sync"] = (function() { this.readerCount = readerCount_; this.readerWait = readerWait_; }); - ptrType = $ptrType(Pool); - sliceType = $sliceType(ptrType); - ptrType$1 = $ptrType($Uint32); - chanType = $chanType($Bool, false, false); - sliceType$1 = $sliceType(chanType); - ptrType$6 = $ptrType($Int32); - ptrType$7 = $ptrType(poolLocal); - sliceType$4 = $sliceType($emptyInterface); - ptrType$8 = $ptrType(rlocker); - ptrType$9 = $ptrType(RWMutex); - funcType = $funcType([], [$emptyInterface], false); - ptrType$16 = $ptrType(Mutex); - arrayType$2 = $arrayType($Uint8, 100); - Pool.ptr.prototype.Get = function() { - var _r, p, x, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - /* */ if (p.store.$length === 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (p.store.$length === 0) { */ case 1: - /* */ if (!(p.New === $throwNilPointerError)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!(p.New === $throwNilPointerError)) { */ case 3: - _r = p.New(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } */ case 4: - $s = -1; return $ifaceNil; - /* } */ case 2: - x$2 = (x = p.store, x$1 = p.store.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); - p.store = $subslice(p.store, 0, (p.store.$length - 1 >> 0)); - $s = -1; return x$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: Pool.ptr.prototype.Get }; } $f._r = _r; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; - }; - Pool.prototype.Get = function() { return this.$val.Get(); }; - Pool.ptr.prototype.Put = function(x) { - var p, x; - p = this; - if ($interfaceIsEqual(x, $ifaceNil)) { + notifyList = $pkg.notifyList = $newType(0, $kindStruct, "sync.notifyList", true, "sync", false, function(wait_, notify_, lock_, head_, tail_) { + this.$val = this; + if (arguments.length === 0) { + this.wait = 0; + this.notify = 0; + this.lock = 0; + this.head = 0; + this.tail = 0; return; } - p.store = $append(p.store, x); - }; - Pool.prototype.Put = function(x) { return this.$val.Put(x); }; - runtime_registerPoolCleanup = function(cleanup) { - var cleanup; - }; - runtime_SemacquireMutex = function(s, lifo) { - var _entry, _entry$1, _entry$2, _entry$3, _entry$4, _key, _key$1, _key$2, _r, ch, lifo, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _entry$4 = $f._entry$4; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _r = $f._r; ch = $f.ch; lifo = $f.lifo; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ if (((s.$get() - (_entry = semAwoken[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { $s = 1; continue; } + this.wait = wait_; + this.notify = notify_; + this.lock = lock_; + this.head = head_; + this.tail = tail_; + }); + Mutex = $pkg.Mutex = $newType(0, $kindStruct, "sync.Mutex", true, "sync", true, function(state_, sema_) { + this.$val = this; + if (arguments.length === 0) { + this.state = 0; + this.sema = 0; + return; + } + this.state = state_; + this.sema = sema_; + }); + Locker = $pkg.Locker = $newType(8, $kindInterface, "sync.Locker", true, "sync", true, null); + Pool = $pkg.Pool = $newType(0, $kindStruct, "sync.Pool", true, "sync", true, function(store_, New_) { + this.$val = this; + if (arguments.length === 0) { + this.store = sliceType$3.nil; + this.New = $throwNilPointerError; + return; + } + this.store = store_; + this.New = New_; + }); + ptrType$1 = $ptrType($Uint32); + ptrType$2 = $ptrType($Int32); + ptrType$3 = $ptrType(rlocker); + ptrType$4 = $ptrType(RWMutex); + chanType = $chanType($Bool, false, false); + sliceType$2 = $sliceType(chanType); + ptrType$15 = $ptrType(Mutex); + sliceType$3 = $sliceType($emptyInterface); + ptrType$18 = $ptrType(Pool); + funcType$2 = $funcType([], [$emptyInterface], false); + RWMutex.ptr.prototype.RLock = function() { + var {rw, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + $unused(rw.w.state); + race.Disable(); + } + /* */ if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { $s = 1; continue; } /* */ $s = 2; continue; - /* if (((s.$get() - (_entry = semAwoken[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { */ case 1: - ch = new $Chan($Bool, 0); - if (lifo) { - _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: $appendSlice(new sliceType$1([ch]), (_entry$1 = semWaiters[ptrType$1.keyFor(s)], _entry$1 !== undefined ? _entry$1.v : sliceType$1.nil)) }; - } else { - _key$1 = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$2 = semWaiters[ptrType$1.keyFor(s)], _entry$2 !== undefined ? _entry$2.v : sliceType$1.nil), ch) }; - } - _r = $recv(ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r[0]; - _key$2 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$2)] = { k: _key$2, v: (_entry$3 = semAwoken[ptrType$1.keyFor(s)], _entry$3 !== undefined ? _entry$3.v : 0) - (1) >>> 0 }; - if ((_entry$4 = semAwoken[ptrType$1.keyFor(s)], _entry$4 !== undefined ? _entry$4.v : 0) === 0) { - delete semAwoken[ptrType$1.keyFor(s)]; - } + /* if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { */ case 1: + $r = runtime_SemacquireMutex((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false, 0); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: - s.$set(s.$get() - (1) >>> 0); - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_SemacquireMutex }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._entry$4 = _entry$4; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._r = _r; $f.ch = ch; $f.lifo = lifo; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - runtime_Semrelease = function(s, handoff) { - var _entry, _entry$1, _key, _key$1, ch, handoff, s, w, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$1; ch = $f.ch; handoff = $f.handoff; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s.$set(s.$get() + (1) >>> 0); - w = (_entry = semWaiters[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$1.nil); - if (w.$length === 0) { - $s = -1; return; + if (false) { + race.Enable(); + race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); } - ch = (0 >= w.$length ? ($throwRuntimeError("index out of range"), undefined) : w.$array[w.$offset + 0]); - w = $subslice(w, 1); - _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: w }; - if (w.$length === 0) { - delete semWaiters[ptrType$1.keyFor(s)]; - } - _key$1 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$1)] = { k: _key$1, v: (_entry$1 = semAwoken[ptrType$1.keyFor(s)], _entry$1 !== undefined ? _entry$1.v : 0) + (1) >>> 0 }; - $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$1; $f.ch = ch; $f.handoff = handoff; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: RWMutex.ptr.prototype.RLock, $c: true, $r, rw, $s};return $f; }; - runtime_notifyListCheck = function(size) { - var size; + RWMutex.prototype.RLock = function() { return this.$val.RLock(); }; + RWMutex.ptr.prototype.TryRLock = function() { + var c, rw; + rw = this; + if (false) { + $unused(rw.w.state); + race.Disable(); + } + while (true) { + c = atomic.LoadInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw)))); + if (c < 0) { + if (false) { + race.Enable(); + } + return false; + } + if (atomic.CompareAndSwapInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), c, c + 1 >> 0)) { + if (false) { + race.Enable(); + race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); + } + return true; + } + } }; - runtime_canSpin = function(i) { - var i; - return false; + RWMutex.prototype.TryRLock = function() { return this.$val.TryRLock(); }; + RWMutex.ptr.prototype.RUnlock = function() { + var {r, rw, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + $unused(rw.w.state); + race.ReleaseMerge(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))))); + race.Disable(); + } + r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1); + /* */ if (r < 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (r < 0) { */ case 1: + $r = rw.rUnlockSlow(r); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + if (false) { + race.Enable(); + } + $s = -1; return; + /* */ } return; } var $f = {$blk: RWMutex.ptr.prototype.RUnlock, $c: true, $r, r, rw, $s};return $f; }; - runtime_nanotime = function() { - return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); + RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); }; + RWMutex.ptr.prototype.rUnlockSlow = function(r) { + var {r, rw, $s, $r, $c} = $restore(this, {r}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + rw = this; + if (((r + 1 >> 0) === 0) || ((r + 1 >> 0) === -1073741824)) { + race.Enable(); + throw$1("sync: RUnlock of unlocked RWMutex"); + } + /* */ if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$2(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$2(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { */ case 1: + $r = runtime_Semrelease((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false, 1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: RWMutex.ptr.prototype.rUnlockSlow, $c: true, $r, r, rw, $s};return $f; }; - throw$1 = function(s) { - var s; - $throwRuntimeError($externalize(s, $String)); + RWMutex.prototype.rUnlockSlow = function(r) { return this.$val.rUnlockSlow(r); }; + RWMutex.ptr.prototype.Lock = function() { + var {r, rw, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + $unused(rw.w.state); + race.Disable(); + } + $r = rw.w.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1073741824) + 1073741824 >> 0; + /* */ if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$2(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$2(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { */ case 2: + $r = runtime_SemacquireMutex((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false, 0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 3: + if (false) { + race.Enable(); + race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); + race.Acquire(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))))); + } + $s = -1; return; + /* */ } return; } var $f = {$blk: RWMutex.ptr.prototype.Lock, $c: true, $r, r, rw, $s};return $f; + }; + RWMutex.prototype.Lock = function() { return this.$val.Lock(); }; + RWMutex.ptr.prototype.TryLock = function() { + var {rw, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + $unused(rw.w.state); + race.Disable(); + } + if (!rw.w.TryLock()) { + if (false) { + race.Enable(); + } + $s = -1; return false; + } + /* */ if (!atomic.CompareAndSwapInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 0, -1073741824)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!atomic.CompareAndSwapInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 0, -1073741824)) { */ case 1: + $r = rw.w.Unlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (false) { + race.Enable(); + } + $s = -1; return false; + /* } */ case 2: + if (false) { + race.Enable(); + race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); + race.Acquire(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))))); + } + $s = -1; return true; + /* */ } return; } var $f = {$blk: RWMutex.ptr.prototype.TryLock, $c: true, $r, rw, $s};return $f; + }; + RWMutex.prototype.TryLock = function() { return this.$val.TryLock(); }; + RWMutex.ptr.prototype.Unlock = function() { + var {i, r, rw, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + $unused(rw.w.state); + race.Release(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); + race.Disable(); + } + r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1073741824); + if (r >= 1073741824) { + race.Enable(); + throw$1("sync: Unlock of unlocked RWMutex"); + } + i = 0; + /* while (true) { */ case 1: + /* if (!(i < ((r >> 0)))) { break; } */ if(!(i < ((r >> 0)))) { $s = 2; continue; } + $r = runtime_Semrelease((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false, 0); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i = i + (1) >> 0; + $s = 1; continue; + case 2: + $r = rw.w.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (false) { + race.Enable(); + } + $s = -1; return; + /* */ } return; } var $f = {$blk: RWMutex.ptr.prototype.Unlock, $c: true, $r, i, r, rw, $s};return $f; + }; + RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); }; + RWMutex.ptr.prototype.RLocker = function() { + var rw; + rw = this; + return ($pointerOfStructConversion(rw, ptrType$3)); + }; + RWMutex.prototype.RLocker = function() { return this.$val.RLocker(); }; + rlocker.ptr.prototype.Lock = function() { + var {r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + r = this; + $r = ($pointerOfStructConversion(r, ptrType$4)).RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: rlocker.ptr.prototype.Lock, $c: true, $r, r, $s};return $f; + }; + rlocker.prototype.Lock = function() { return this.$val.Lock(); }; + rlocker.ptr.prototype.Unlock = function() { + var {r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + r = this; + $r = ($pointerOfStructConversion(r, ptrType$4)).RUnlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: rlocker.ptr.prototype.Unlock, $c: true, $r, r, $s};return $f; + }; + rlocker.prototype.Unlock = function() { return this.$val.Unlock(); }; + init = function() { + var n; + n = new notifyList.ptr(0, 0, 0, 0, 0); + runtime_notifyListCheck(20); + }; + runtime_doSpin = function() { + $throwRuntimeError("native function not implemented: sync.runtime_doSpin"); }; Mutex.ptr.prototype.Lock = function() { - var awoke, delta, iter, m, new$1, old, queueLifo, starving, waitStartTime, x, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; awoke = $f.awoke; delta = $f.delta; iter = $f.iter; m = $f.m; new$1 = $f.new$1; old = $f.old; queueLifo = $f.queueLifo; starving = $f.starving; waitStartTime = $f.waitStartTime; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {m, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: m = this; - if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), 0, 1)) { + if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), 0, 1)) { if (false) { race.Acquire((m)); } $s = -1; return; } + $r = m.lockSlow(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: Mutex.ptr.prototype.Lock, $c: true, $r, m, $s};return $f; + }; + Mutex.prototype.Lock = function() { return this.$val.Lock(); }; + Mutex.ptr.prototype.TryLock = function() { + var m, old; + m = this; + old = m.state; + if (!(((old & 5) === 0))) { + return false; + } + if (!atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, old | 1)) { + return false; + } + if (false) { + race.Acquire((m)); + } + return true; + }; + Mutex.prototype.TryLock = function() { return this.$val.TryLock(); }; + Mutex.ptr.prototype.lockSlow = function() { + var {awoke, delta, iter, m, new$1, old, queueLifo, starving, waitStartTime, x, x$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + m = this; waitStartTime = new $Int64(0, 0); starving = false; awoke = false; @@ -2796,10 +5724,10 @@ $packages["sync"] = (function() { /* */ if (((old & 5) === 1) && runtime_canSpin(iter)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (((old & 5) === 1) && runtime_canSpin(iter)) { */ case 3: - if (!awoke && ((old & 2) === 0) && !(((old >> 3 >> 0) === 0)) && atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, old | 2)) { + if (!awoke && ((old & 2) === 0) && !(((old >> 3 >> 0) === 0)) && atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, old | 2)) { awoke = true; } - runtime_doSpin(); + $r = runtime_doSpin(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } iter = iter + (1) >> 0; old = m.state; /* continue; */ $s = 1; continue; @@ -2820,9 +5748,9 @@ $packages["sync"] = (function() { } new$1 = (new$1 & ~(2)) >> 0; } - /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 5: + /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 6: if ((old & 5) === 0) { /* break; */ $s = 2; continue; } @@ -2830,7 +5758,7 @@ $packages["sync"] = (function() { if ((waitStartTime.$high === 0 && waitStartTime.$low === 0)) { waitStartTime = runtime_nanotime(); } - $r = runtime_SemacquireMutex((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), queueLifo); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime_SemacquireMutex((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), queueLifo, 1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } starving = starving || (x = (x$1 = runtime_nanotime(), new $Int64(x$1.$high - waitStartTime.$high, x$1.$low - waitStartTime.$low)), (x.$high > 0 || (x.$high === 0 && x.$low > 1000000))); old = m.state; if (!(((old & 4) === 0))) { @@ -2841,32 +5769,46 @@ $packages["sync"] = (function() { if (!starving || ((old >> 3 >> 0) === 1)) { delta = delta - (4) >> 0; } - atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), delta); + atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), delta); /* break; */ $s = 2; continue; } awoke = true; iter = 0; - $s = 7; continue; - /* } else { */ case 6: + $s = 8; continue; + /* } else { */ case 7: old = m.state; - /* } */ case 7: - /* } */ $s = 1; continue; case 2: + /* } */ case 8: + $s = 1; continue; + case 2: if (false) { race.Acquire((m)); } $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Lock }; } $f.awoke = awoke; $f.delta = delta; $f.iter = iter; $f.m = m; $f.new$1 = new$1; $f.old = old; $f.queueLifo = queueLifo; $f.starving = starving; $f.waitStartTime = waitStartTime; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Mutex.ptr.prototype.lockSlow, $c: true, $r, awoke, delta, iter, m, new$1, old, queueLifo, starving, waitStartTime, x, x$1, $s};return $f; }; - Mutex.prototype.Lock = function() { return this.$val.Lock(); }; + Mutex.prototype.lockSlow = function() { return this.$val.lockSlow(); }; Mutex.ptr.prototype.Unlock = function() { - var m, new$1, old, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; m = $f.m; new$1 = $f.new$1; old = $f.old; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {m, new$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: m = this; if (false) { $unused(m.state); race.Release((m)); } - new$1 = atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), -1); + new$1 = atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), -1); + /* */ if (!((new$1 === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((new$1 === 0))) { */ case 1: + $r = m.unlockSlow(new$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: Mutex.ptr.prototype.Unlock, $c: true, $r, m, new$1, $s};return $f; + }; + Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; + Mutex.ptr.prototype.unlockSlow = function(new$1) { + var {m, new$1, old, $s, $r, $c} = $restore(this, {new$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + m = this; if ((((new$1 + 1 >> 0)) & 1) === 0) { throw$1("sync: unlock of unlocked mutex"); } @@ -2879,284 +5821,712 @@ $packages["sync"] = (function() { $s = -1; return; } new$1 = ((old - 8 >> 0)) | 2; - /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 6; continue; } + /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 6; continue; } /* */ $s = 7; continue; - /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 6: - $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), false); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 6: + $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), false, 1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 7: old = m.state; - /* } */ $s = 4; continue; case 5: + $s = 4; continue; + case 5: $s = 3; continue; /* } else { */ case 2: - $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), true); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), true, 1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Unlock }; } $f.m = m; $f.new$1 = new$1; $f.old = old; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Mutex.ptr.prototype.unlockSlow, $c: true, $r, m, new$1, old, $s};return $f; }; - Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; - poolCleanup = function() { - var _i, _i$1, _ref, _ref$1, i, i$1, j, l, p, x; - _ref = allPools; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - ((i < 0 || i >= allPools.$length) ? ($throwRuntimeError("index out of range"), undefined) : allPools.$array[allPools.$offset + i] = ptrType.nil); - i$1 = 0; - while (true) { - if (!(i$1 < ((p.localSize >> 0)))) { break; } - l = indexLocal(p.local, i$1); - l.poolLocalInternal.private$0 = $ifaceNil; - _ref$1 = l.poolLocalInternal.shared; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - j = _i$1; - (x = l.poolLocalInternal.shared, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j] = $ifaceNil)); - _i$1++; - } - l.poolLocalInternal.shared = sliceType$4.nil; - i$1 = i$1 + (1) >> 0; - } - p.local = 0; - p.localSize = 0; - _i++; - } - allPools = new sliceType([]); - }; - init = function() { - runtime_registerPoolCleanup(poolCleanup); - }; - indexLocal = function(l, i) { - var i, l, lp; - lp = (((l) + ($imul(((i >>> 0)), 128) >>> 0) >>> 0)); - return ($pointerOfStructConversion(lp, ptrType$7)); - }; - init$1 = function() { - var n; - n = new notifyList.ptr(0, 0, 0, 0, 0); - runtime_notifyListCheck(20); - }; - runtime_doSpin = function() { - $throwRuntimeError("native function not implemented: sync.runtime_doSpin"); - }; - RWMutex.ptr.prototype.RLock = function() { - var rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - $unused(rw.w.state); - race.Disable(); - } - /* */ if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { */ case 1: - $r = runtime_SemacquireMutex((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - if (false) { - race.Enable(); - race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); - } + Mutex.prototype.unlockSlow = function(new$1) { return this.$val.unlockSlow(new$1); }; + runtime_Semacquire = function(s) { + var {s, $s, $r, $c} = $restore(this, {s}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = runtime_SemacquireMutex(s, false, 1); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RLock }; } $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: runtime_Semacquire, $c: true, $r, s, $s};return $f; }; - RWMutex.prototype.RLock = function() { return this.$val.RLock(); }; - RWMutex.ptr.prototype.RUnlock = function() { - var r, rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - $unused(rw.w.state); - race.ReleaseMerge(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))))); - race.Disable(); - } - r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1); - /* */ if (r < 0) { $s = 1; continue; } + $linknames["sync.runtime_Semacquire"] = runtime_Semacquire; + runtime_SemacquireMutex = function(s, lifo, skipframes) { + var {_entry, _entry$1, _entry$2, _entry$3, _entry$4, _key, _key$1, _key$2, _r, ch, lifo, s, skipframes, $s, $r, $c} = $restore(this, {s, lifo, skipframes}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* */ if (((s.$get() - (_entry = $mapIndex(semAwoken,ptrType$1.keyFor(s)), _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { $s = 1; continue; } /* */ $s = 2; continue; - /* if (r < 0) { */ case 1: - if (((r + 1 >> 0) === 0) || ((r + 1 >> 0) === -1073741824)) { - race.Enable(); - throw$1("sync: RUnlock of unlocked RWMutex"); + /* if (((s.$get() - (_entry = $mapIndex(semAwoken,ptrType$1.keyFor(s)), _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { */ case 1: + ch = new $Chan($Bool, 0); + if (lifo) { + _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$1.keyFor(_key), { k: _key, v: $appendSlice(new sliceType$2([ch]), (_entry$1 = $mapIndex(semWaiters,ptrType$1.keyFor(s)), _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil)) }); + } else { + _key$1 = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$1.keyFor(_key$1), { k: _key$1, v: $append((_entry$2 = $mapIndex(semWaiters,ptrType$1.keyFor(s)), _entry$2 !== undefined ? _entry$2.v : sliceType$2.nil), ch) }); } - /* */ if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { $s = 3; continue; } + _r = $recv(ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r[0]; + _key$2 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$1.keyFor(_key$2), { k: _key$2, v: (_entry$3 = $mapIndex(semAwoken,ptrType$1.keyFor(s)), _entry$3 !== undefined ? _entry$3.v : 0) - (1) >>> 0 }); + if ((_entry$4 = $mapIndex(semAwoken,ptrType$1.keyFor(s)), _entry$4 !== undefined ? _entry$4.v : 0) === 0) { + $mapDelete(semAwoken, ptrType$1.keyFor(s)); + } + /* } */ case 2: + s.$set(s.$get() - (1) >>> 0); + $s = -1; return; + /* */ } return; } var $f = {$blk: runtime_SemacquireMutex, $c: true, $r, _entry, _entry$1, _entry$2, _entry$3, _entry$4, _key, _key$1, _key$2, _r, ch, lifo, s, skipframes, $s};return $f; + }; + runtime_Semrelease = function(s, handoff, skipframes) { + var {_entry, _entry$1, _key, _key$1, ch, handoff, s, skipframes, w, $s, $r, $c} = $restore(this, {s, handoff, skipframes}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + s.$set(s.$get() + (1) >>> 0); + w = (_entry = $mapIndex(semWaiters,ptrType$1.keyFor(s)), _entry !== undefined ? _entry.v : sliceType$2.nil); + if (w.$length === 0) { + $s = -1; return; + } + ch = (0 >= w.$length ? ($throwRuntimeError("index out of range"), undefined) : w.$array[w.$offset + 0]); + w = $subslice(w, 1); + _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$1.keyFor(_key), { k: _key, v: w }); + if (w.$length === 0) { + $mapDelete(semWaiters, ptrType$1.keyFor(s)); + } + _key$1 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$1.keyFor(_key$1), { k: _key$1, v: (_entry$1 = $mapIndex(semAwoken,ptrType$1.keyFor(s)), _entry$1 !== undefined ? _entry$1.v : 0) + (1) >>> 0 }); + $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: runtime_Semrelease, $c: true, $r, _entry, _entry$1, _key, _key$1, ch, handoff, s, skipframes, w, $s};return $f; + }; + $linknames["sync.runtime_Semrelease"] = runtime_Semrelease; + runtime_notifyListCheck = function(size) { + var size; + }; + runtime_canSpin = function(i) { + var i; + return false; + }; + runtime_nanotime = function() { + return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); + }; + throw$1 = function(s) { + var s; + $throwRuntimeError($externalize(s, $String)); + }; + Pool.ptr.prototype.Get = function() { + var {$24r, _r, p, x, x$1, x$2, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + p = this; + /* */ if (p.store.$length === 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (p.store.$length === 0) { */ case 1: + /* */ if (!(p.New === $throwNilPointerError)) { $s = 3; continue; } /* */ $s = 4; continue; - /* if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { */ case 3: - $r = runtime_Semrelease((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* if (!(p.New === $throwNilPointerError)) { */ case 3: + _r = p.New(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 6; case 6: return $24r; /* } */ case 4: + $s = -1; return $ifaceNil; /* } */ case 2: - if (false) { - race.Enable(); - } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RUnlock }; } $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; + x$2 = (x = p.store, x$1 = p.store.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); + p.store = $subslice(p.store, 0, (p.store.$length - 1 >> 0)); + $s = -1; return x$2; + /* */ } return; } var $f = {$blk: Pool.ptr.prototype.Get, $c: true, $r, $24r, _r, p, x, x$1, x$2, $s};return $f; }; - RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); }; - RWMutex.ptr.prototype.Lock = function() { - var r, rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - $unused(rw.w.state); - race.Disable(); + Pool.prototype.Get = function() { return this.$val.Get(); }; + Pool.ptr.prototype.Put = function(x) { + var p, x; + p = this; + if ($interfaceIsEqual(x, $ifaceNil)) { + return; } - $r = rw.w.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1073741824) + 1073741824 >> 0; - /* */ if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { */ case 2: - $r = runtime_SemacquireMutex((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 3: - if (false) { - race.Enable(); - race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); - race.Acquire(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))))); - } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Lock }; } $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; + p.store = $append(p.store, x); }; - RWMutex.prototype.Lock = function() { return this.$val.Lock(); }; - RWMutex.ptr.prototype.Unlock = function() { - var i, r, rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; i = $f.i; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - $unused(rw.w.state); - race.Release(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); - race.Disable(); - } - r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1073741824); - if (r >= 1073741824) { - race.Enable(); - throw$1("sync: Unlock of unlocked RWMutex"); - } - i = 0; - /* while (true) { */ case 1: - /* if (!(i < ((r >> 0)))) { break; } */ if(!(i < ((r >> 0)))) { $s = 2; continue; } - $r = runtime_Semrelease((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - $r = rw.w.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - if (false) { - race.Enable(); - } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Unlock }; } $f.i = i; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; - }; - RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); }; - RWMutex.ptr.prototype.RLocker = function() { - var rw; - rw = this; - return ($pointerOfStructConversion(rw, ptrType$8)); - }; - RWMutex.prototype.RLocker = function() { return this.$val.RLocker(); }; - rlocker.ptr.prototype.Lock = function() { - var r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - $r = ($pointerOfStructConversion(r, ptrType$9)).RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Lock }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - rlocker.prototype.Lock = function() { return this.$val.Lock(); }; - rlocker.ptr.prototype.Unlock = function() { - var r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - $r = ($pointerOfStructConversion(r, ptrType$9)).RUnlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Unlock }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - rlocker.prototype.Unlock = function() { return this.$val.Unlock(); }; - ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "getSlow", name: "getSlow", pkg: "sync", typ: $funcType([], [$emptyInterface], false)}, {prop: "pin", name: "pin", pkg: "sync", typ: $funcType([], [ptrType$7], false)}, {prop: "pinSlow", name: "pinSlow", pkg: "sync", typ: $funcType([], [ptrType$7], false)}]; - ptrType$16.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; - ptrType$9.methods = [{prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}, {prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLocker", name: "RLocker", pkg: "", typ: $funcType([], [Locker], false)}]; - ptrType$8.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; - Pool.init("sync", [{prop: "local", name: "local", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "localSize", name: "localSize", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "store", name: "store", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: funcType, tag: ""}]); - Mutex.init("sync", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "sema", name: "sema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); - Locker.init([{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]); - poolLocalInternal.init("sync", [{prop: "private$0", name: "private", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "shared", name: "shared", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: Mutex, tag: ""}]); - poolLocal.init("sync", [{prop: "poolLocalInternal", name: "poolLocalInternal", embedded: true, exported: false, typ: poolLocalInternal, tag: ""}, {prop: "pad", name: "pad", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); - notifyList.init("sync", [{prop: "wait", name: "wait", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "notify", name: "notify", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "lock", name: "lock", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "head", name: "head", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "tail", name: "tail", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}]); + Pool.prototype.Put = function(x) { return this.$val.Put(x); }; + ptrType$4.methods = [{prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "TryRLock", name: "TryRLock", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}, {prop: "rUnlockSlow", name: "rUnlockSlow", pkg: "sync", typ: $funcType([$Int32], [], false)}, {prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "TryLock", name: "TryLock", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLocker", name: "RLocker", pkg: "", typ: $funcType([], [Locker], false)}]; + ptrType$3.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; + ptrType$15.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "TryLock", name: "TryLock", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "lockSlow", name: "lockSlow", pkg: "sync", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "unlockSlow", name: "unlockSlow", pkg: "sync", typ: $funcType([$Int32], [], false)}]; + ptrType$18.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}]; RWMutex.init("sync", [{prop: "w", name: "w", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", embedded: false, exported: false, typ: $Int32, tag: ""}]); rlocker.init("sync", [{prop: "w", name: "w", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", embedded: false, exported: false, typ: $Int32, tag: ""}]); + notifyList.init("sync", [{prop: "wait", name: "wait", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "notify", name: "notify", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "lock", name: "lock", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "head", name: "head", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "tail", name: "tail", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}]); + Mutex.init("sync", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "sema", name: "sema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); + Locker.init([{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]); + Pool.init("sync", [{prop: "store", name: "store", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: funcType$2, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = race.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - allPools = sliceType.nil; - semWaiters = {}; - semAwoken = {}; + $r = atomic.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } expunged = (new Uint8Array(8)); + semWaiters = new $global.Map(); + semAwoken = new $global.Map(); init(); - init$1(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); -$packages["io"] = (function() { - var $pkg = {}, $init, errors, sync, atomic, RuneScanner, errWhence, errOffset; +$packages["github.com/gopherjs/gopherjs/nosync"] = (function() { + var $pkg = {}, $init, Once, funcType$1, ptrType$1; + Once = $pkg.Once = $newType(0, $kindStruct, "nosync.Once", true, "github.com/gopherjs/gopherjs/nosync", true, function(doing_, done_) { + this.$val = this; + if (arguments.length === 0) { + this.doing = false; + this.done = false; + return; + } + this.doing = doing_; + this.done = done_; + }); + funcType$1 = $funcType([], [], false); + ptrType$1 = $ptrType(Once); + Once.ptr.prototype.Do = function(f) { + var {f, o, $s, $deferred, $r, $c} = $restore(this, {f}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + o = [o]; + o[0] = this; + /* */ if (o[0].done) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (o[0].done) { */ case 1: + $s = 3; case 3: return; + /* } */ case 2: + if (o[0].doing) { + $panic(new $String("nosync: Do called within f")); + } + o[0].doing = true; + $deferred.push([(function(o) { return function() { + o[0].doing = false; + o[0].done = true; + }; })(o), []]); + $r = f(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: Once.ptr.prototype.Do, $c: true, $r, f, o, $s, $deferred};return $f; } } + }; + Once.prototype.Do = function(f) { return this.$val.Do(f); }; + ptrType$1.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$1], [], false)}]; + Once.init("github.com/gopherjs/gopherjs/nosync", [{prop: "doing", name: "doing", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: $Bool, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/itoa"] = (function() { + var $pkg = {}, $init, arrayType, sliceType, Itoa, Uitoa; + arrayType = $arrayType($Uint8, 20); + sliceType = $sliceType($Uint8); + Itoa = function(val) { + var val; + if (val < 0) { + return "-" + Uitoa(((-val >>> 0))); + } + return Uitoa(((val >>> 0))); + }; + $pkg.Itoa = Itoa; + Uitoa = function(val) { + var _q, buf, i, q, val; + if (val === 0) { + return "0"; + } + buf = arrayType.zero(); + i = 19; + while (true) { + if (!(val >= 10)) { break; } + q = (_q = val / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((((48 + val >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24))); + i = i - (1) >> 0; + val = q; + } + ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((48 + val >>> 0) << 24 >>> 24))); + return ($bytesToString($subslice(new sliceType(buf), i))); + }; + $pkg.Uitoa = Uitoa; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/oserror"] = (function() { + var $pkg = {}, $init, errors; errors = $packages["errors"]; - sync = $packages["sync"]; - atomic = $packages["sync/atomic"]; - RuneScanner = $pkg.RuneScanner = $newType(8, $kindInterface, "io.RuneScanner", true, "io", true, null); - RuneScanner.init([{prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = atomic.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.ErrShortWrite = errors.New("short write"); - $pkg.ErrShortBuffer = errors.New("short buffer"); - $pkg.EOF = errors.New("EOF"); - $pkg.ErrUnexpectedEOF = errors.New("unexpected EOF"); - $pkg.ErrNoProgress = errors.New("multiple Read calls return no data or error"); - errWhence = errors.New("Seek: invalid whence"); - errOffset = errors.New("Seek: invalid offset"); - $pkg.ErrClosedPipe = errors.New("io: read/write on closed pipe"); + $pkg.ErrInvalid = errors.New("invalid argument"); + $pkg.ErrPermission = errors.New("permission denied"); + $pkg.ErrExist = errors.New("file already exists"); + $pkg.ErrNotExist = errors.New("file does not exist"); + $pkg.ErrClosed = errors.New("file already closed"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); -$packages["math"] = (function() { - var $pkg = {}, $init, js, arrayType, arrayType$1, arrayType$2, structType, math, buf, init, Float32bits, Float64bits; +$packages["syscall/js"] = (function() { + var $pkg = {}, $init, js, Type, Func, Error, Value, ValueError, sliceType, funcType, arrayType, sliceType$1, mapType, sliceType$2, ptrType, sliceType$3, ptrType$1, ptrType$2, typeNames, id, instanceOf, typeOf, Global, Null, Undefined, FuncOf, objectToValue, init, getValueType, ValueOf, convertArgs, convertJSError, CopyBytesToGo, CopyBytesToJS; js = $packages["github.com/gopherjs/gopherjs/js"]; - arrayType = $arrayType($Uint32, 2); - arrayType$1 = $arrayType($Float32, 2); - arrayType$2 = $arrayType($Float64, 1); - structType = $structType("math", [{prop: "uint32array", name: "uint32array", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "float32array", name: "float32array", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "float64array", name: "float64array", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); - init = function() { - var ab; - ab = new ($global.ArrayBuffer)(8); - buf.uint32array = new ($global.Uint32Array)(ab); - buf.float32array = new ($global.Float32Array)(ab); - buf.float64array = new ($global.Float64Array)(ab); + Type = $pkg.Type = $newType(4, $kindInt, "js.Type", true, "syscall/js", true, null); + Func = $pkg.Func = $newType(0, $kindStruct, "js.Func", true, "syscall/js", true, function(Value_) { + this.$val = this; + if (arguments.length === 0) { + this.Value = new Value.ptr(null, false, arrayType.zero()); + return; + } + this.Value = Value_; + }); + Error = $pkg.Error = $newType(0, $kindStruct, "js.Error", true, "syscall/js", true, function(Value_) { + this.$val = this; + if (arguments.length === 0) { + this.Value = new Value.ptr(null, false, arrayType.zero()); + return; + } + this.Value = Value_; + }); + Value = $pkg.Value = $newType(0, $kindStruct, "js.Value", true, "syscall/js", true, function(v_, inited_, _$2_) { + this.$val = this; + if (arguments.length === 0) { + this.v = null; + this.inited = false; + this._$2 = arrayType.zero(); + return; + } + this.v = v_; + this.inited = inited_; + this._$2 = _$2_; + }); + ValueError = $pkg.ValueError = $newType(0, $kindStruct, "js.ValueError", true, "syscall/js", true, function(Method_, Type_) { + this.$val = this; + if (arguments.length === 0) { + this.Method = ""; + this.Type = 0; + return; + } + this.Method = Method_; + this.Type = Type_; + }); + sliceType = $sliceType($String); + funcType = $funcType([], [], false); + arrayType = $arrayType(funcType, 0); + sliceType$1 = $sliceType(Value); + mapType = $mapType($String, $emptyInterface); + sliceType$2 = $sliceType($emptyInterface); + ptrType = $ptrType(js.Error); + sliceType$3 = $sliceType($Uint8); + ptrType$1 = $ptrType(js.Object); + ptrType$2 = $ptrType(ValueError); + Type.prototype.String = function() { + var t; + t = this.$val; + if (((t >> 0)) < 0 || typeNames.$length <= ((t >> 0))) { + $panic(new $String("bad type")); + } + return ((t < 0 || t >= typeNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : typeNames.$array[typeNames.$offset + t]); }; - Float32bits = function(f) { + $ptrType(Type).prototype.String = function() { return new Type(this.$get()).String(); }; + Type.prototype.isObject = function() { + var t; + t = this.$val; + return (t === 6) || (t === 7); + }; + $ptrType(Type).prototype.isObject = function() { return new Type(this.$get()).isObject(); }; + Global = function() { + return objectToValue($global); + }; + $pkg.Global = Global; + Null = function() { + return objectToValue(null); + }; + $pkg.Null = Null; + Undefined = function() { + return objectToValue(undefined); + }; + $pkg.Undefined = Undefined; + Func.ptr.prototype.Release = function() { var f; - buf.float32array[0] = f; - return buf.uint32array[0]; + f = this; + $exportedFunctions = ($parseInt($exportedFunctions) >> 0) - 1 >> 0; + Value.copy(f.Value, Null()); }; - $pkg.Float32bits = Float32bits; - Float64bits = function(f) { - var f, x, x$1; - buf.float64array[0] = f; - return (x = $shiftLeft64((new $Uint64(0, buf.uint32array[1])), 32), x$1 = (new $Uint64(0, buf.uint32array[0])), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); + Func.prototype.Release = function() { return this.$val.Release(); }; + FuncOf = function(fn) { + var fn; + $exportedFunctions = ($parseInt($exportedFunctions) >> 0) + 1 >> 0; + return new Func.ptr($clone(objectToValue(js.MakeFunc((function $b(this$1, args) { + var {$24r, _i, _r, _ref, a, args, i, this$1, vargs, $s, $r, $c} = $restore(this, {this$1, args}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + vargs = $makeSlice(sliceType$1, args.$length); + _ref = args; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + a = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + Value.copy(((i < 0 || i >= vargs.$length) ? ($throwRuntimeError("index out of range"), undefined) : vargs.$array[vargs.$offset + i]), objectToValue(a)); + _i++; + } + _r = fn($clone(objectToValue(this$1), Value), vargs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r, _i, _r, _ref, a, args, i, this$1, vargs, $s};return $f; + }))), Value)); }; - $pkg.Float64bits = Float64bits; + $pkg.FuncOf = FuncOf; + Error.ptr.prototype.Error = function() { + var e; + e = this; + return "JavaScript error: " + $clone($clone(e.Value, Value).Get("message"), Value).String(); + }; + Error.prototype.Error = function() { return this.$val.Error(); }; + objectToValue = function(obj) { + var obj; + if (obj === undefined) { + return new Value.ptr(null, false, arrayType.zero()); + } + return new Value.ptr(obj, true, arrayType.zero()); + }; + init = function() { + if (!($global === null)) { + id = $id; + instanceOf = $instanceOf; + typeOf = $typeOf; + } + }; + getValueType = function(obj) { + var _i, _ref, name, name2, obj, type2; + if (obj === null) { + return 1; + } + name = $internalize(typeOf(obj), $String); + _ref = typeNames; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + type2 = _i; + name2 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + if (name === name2) { + return ((type2 >> 0)); + } + _i++; + } + return 6; + }; + ValueOf = function(x) { + var _ref, x, x$1, x$2, x$3, x$4, x$5; + _ref = x; + if ($assertType(_ref, Value, true)[1]) { + x$1 = $clone(_ref.$val, Value); + return x$1; + } else if ($assertType(_ref, Func, true)[1]) { + x$2 = $clone(_ref.$val, Func); + return x$2.Value; + } else if (_ref === $ifaceNil) { + x$3 = _ref; + return Null(); + } else if ($assertType(_ref, $Bool, true)[1] || $assertType(_ref, $Int, true)[1] || $assertType(_ref, $Int8, true)[1] || $assertType(_ref, $Int16, true)[1] || $assertType(_ref, $Int32, true)[1] || $assertType(_ref, $Int64, true)[1] || $assertType(_ref, $Uint, true)[1] || $assertType(_ref, $Uint8, true)[1] || $assertType(_ref, $Uint16, true)[1] || $assertType(_ref, $Uint32, true)[1] || $assertType(_ref, $Uint64, true)[1] || $assertType(_ref, $Float32, true)[1] || $assertType(_ref, $Float64, true)[1] || $assertType(_ref, $UnsafePointer, true)[1] || $assertType(_ref, $String, true)[1] || $assertType(_ref, mapType, true)[1] || $assertType(_ref, sliceType$2, true)[1]) { + x$4 = _ref; + return objectToValue(id($externalize(x$4, $emptyInterface))); + } else { + x$5 = _ref; + $panic(new $String("ValueOf: invalid value")); + } + }; + $pkg.ValueOf = ValueOf; + Value.ptr.prototype.internal = function() { + var v; + v = this; + if (!v.inited) { + return undefined; + } + return v.v; + }; + Value.prototype.internal = function() { return this.$val.internal(); }; + Value.ptr.prototype.Bool = function() { + var v, vType; + v = this; + vType = $clone(v, Value).Type(); + if (!((vType === 2))) { + $panic(new ValueError.ptr("Value.Bool", vType)); + } + return !!($clone(v, Value).internal()); + }; + Value.prototype.Bool = function() { return this.$val.Bool(); }; + convertArgs = function(args) { + var _i, _ref, arg, args, newArgs, v; + newArgs = new sliceType$2([]); + _ref = args; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + v = $clone(ValueOf(arg), Value); + newArgs = $append(newArgs, new $jsObjectPtr($clone(v, Value).internal())); + _i++; + } + return newArgs; + }; + convertJSError = function() { + var _tuple, err, jsErr, ok, x; + err = $recover(); + if ($interfaceIsEqual(err, $ifaceNil)) { + return; + } + _tuple = $assertType(err, ptrType, true); + jsErr = _tuple[0]; + ok = _tuple[1]; + if (ok) { + $panic((x = new Error.ptr($clone(objectToValue(jsErr.Object), Value)), new x.constructor.elem(x))); + } + $panic(err); + }; + Value.ptr.prototype.Call = function(m, args) { + var {$24r, args, m, obj, propType, v, vType, $s, $deferred, $r, $c} = $restore(this, {m, args}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + v = this; + vType = $clone(v, Value).Type(); + if (!((vType === 6)) && !((vType === 7))) { + $panic(new ValueError.ptr("Value.Call", vType)); + } + propType = $clone($clone(v, Value).Get(m), Value).Type(); + if (!((propType === 7))) { + $panic(new $String("js: Value.Call: property " + m + " is not a function, got " + new Type(propType).String())); + } + $deferred.push([convertJSError, []]); + $24r = objectToValue((obj = $clone(v, Value).internal(), obj[$externalize(m, $String)].apply(obj, $externalize(convertArgs(args), sliceType$2)))); + $s = 1; case 1: return $24r; + /* */ } return; } } catch(err) { $err = err; $s = -1; return new Value.ptr(null, false, arrayType.zero()); } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: Value.ptr.prototype.Call, $c: true, $r, $24r, args, m, obj, propType, v, vType, $s, $deferred};return $f; } } + }; + Value.prototype.Call = function(m, args) { return this.$val.Call(m, args); }; + Value.ptr.prototype.Float = function() { + var v, vType; + v = this; + vType = $clone(v, Value).Type(); + if (!((vType === 3))) { + $panic(new ValueError.ptr("Value.Float", vType)); + } + return $parseFloat($clone(v, Value).internal()); + }; + Value.prototype.Float = function() { return this.$val.Float(); }; + Value.ptr.prototype.Get = function(p) { + var p, v, vType; + v = this; + vType = $clone(v, Value).Type(); + if (!new Type(vType).isObject()) { + $panic(new ValueError.ptr("Value.Get", vType)); + } + return objectToValue($clone(v, Value).internal()[$externalize(p, $String)]); + }; + Value.prototype.Get = function(p) { return this.$val.Get(p); }; + Value.ptr.prototype.Index = function(i) { + var i, v, vType; + v = this; + vType = $clone(v, Value).Type(); + if (!new Type(vType).isObject()) { + $panic(new ValueError.ptr("Value.Index", vType)); + } + return objectToValue($clone(v, Value).internal()[i]); + }; + Value.prototype.Index = function(i) { return this.$val.Index(i); }; + Value.ptr.prototype.Int = function() { + var v, vType; + v = this; + vType = $clone(v, Value).Type(); + if (!((vType === 3))) { + $panic(new ValueError.ptr("Value.Int", vType)); + } + return $parseInt($clone(v, Value).internal()) >> 0; + }; + Value.prototype.Int = function() { return this.$val.Int(); }; + Value.ptr.prototype.InstanceOf = function(t) { + var t, v; + v = this; + return !!(instanceOf($clone(v, Value).internal(), $clone(t, Value).internal())); + }; + Value.prototype.InstanceOf = function(t) { return this.$val.InstanceOf(t); }; + Value.ptr.prototype.Invoke = function(args) { + var args, v, vType; + v = this; + vType = $clone(v, Value).Type(); + if (!((vType === 7))) { + $panic(new ValueError.ptr("Value.Invoke", vType)); + } + return objectToValue($clone(v, Value).internal().apply(undefined, $externalize(convertArgs(args), sliceType$2))); + }; + Value.prototype.Invoke = function(args) { return this.$val.Invoke(args); }; + Value.ptr.prototype.JSValue = function() { + var v; + v = this; + return v; + }; + Value.prototype.JSValue = function() { return this.$val.JSValue(); }; + Value.ptr.prototype.Length = function() { + var v; + v = this; + return $parseInt($clone(v, Value).internal().length); + }; + Value.prototype.Length = function() { return this.$val.Length(); }; + Value.ptr.prototype.New = function(args) { + var {$24r, args, v, $s, $deferred, $r, $c} = $restore(this, {args}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + v = [v]; + v[0] = this; + $deferred.push([(function(v) { return function() { + var _tuple, err, jsErr, ok, vType, x; + err = $recover(); + if ($interfaceIsEqual(err, $ifaceNil)) { + return; + } + vType = $clone(v[0], Value).Type(); + if (!((vType === 7))) { + $panic(new ValueError.ptr("Value.New", vType)); + } + _tuple = $assertType(err, ptrType, true); + jsErr = _tuple[0]; + ok = _tuple[1]; + if (ok) { + $panic((x = new Error.ptr($clone(objectToValue(jsErr.Object), Value)), new x.constructor.elem(x))); + } + $panic(err); + }; })(v), []]); + $24r = objectToValue(new ($global.Function.prototype.bind.apply($clone(v[0], Value).internal(), [undefined].concat($externalize(convertArgs(args), sliceType$2))))); + $s = 1; case 1: return $24r; + /* */ } return; } } catch(err) { $err = err; $s = -1; return new Value.ptr(null, false, arrayType.zero()); } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: Value.ptr.prototype.New, $c: true, $r, $24r, args, v, $s, $deferred};return $f; } } + }; + Value.prototype.New = function(args) { return this.$val.New(args); }; + Value.ptr.prototype.Set = function(p, x) { + var p, v, vType, x, x$1; + v = this; + vType = $clone(v, Value).Type(); + if (!new Type(vType).isObject()) { + $panic(new ValueError.ptr("Value.Set", vType)); + } + $clone(v, Value).internal()[$externalize(p, $String)] = $externalize((x$1 = convertArgs(new sliceType$2([x])), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])), $emptyInterface); + }; + Value.prototype.Set = function(p, x) { return this.$val.Set(p, x); }; + Value.ptr.prototype.SetIndex = function(i, x) { + var i, v, vType, x, x$1; + v = this; + vType = $clone(v, Value).Type(); + if (!new Type(vType).isObject()) { + $panic(new ValueError.ptr("Value.SetIndex", vType)); + } + $clone(v, Value).internal()[i] = $externalize((x$1 = convertArgs(new sliceType$2([x])), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])), $emptyInterface); + }; + Value.prototype.SetIndex = function(i, x) { return this.$val.SetIndex(i, x); }; + Value.ptr.prototype.String = function() { + var _1, v; + v = this; + _1 = $clone(v, Value).Type(); + if (_1 === (4)) { + return $internalize($clone(v, Value).internal(), $String); + } else if (_1 === (0)) { + return ""; + } else if (_1 === (1)) { + return ""; + } else if (_1 === (2)) { + return ""; + } else if (_1 === (3)) { + return ""; + } else if (_1 === (5)) { + return ""; + } else if (_1 === (6)) { + return ""; + } else if (_1 === (7)) { + return ""; + } else { + $panic(new $String("bad type")); + } + }; + Value.prototype.String = function() { return this.$val.String(); }; + Value.ptr.prototype.Truthy = function() { + var v; + v = this; + return !!($clone(v, Value).internal()); + }; + Value.prototype.Truthy = function() { return this.$val.Truthy(); }; + Value.ptr.prototype.Type = function() { + var v; + v = this; + return (getValueType($clone(v, Value).internal())); + }; + Value.prototype.Type = function() { return this.$val.Type(); }; + Value.ptr.prototype.IsNull = function() { + var v; + v = this; + return $clone(v, Value).Type() === 1; + }; + Value.prototype.IsNull = function() { return this.$val.IsNull(); }; + Value.ptr.prototype.IsUndefined = function() { + var v; + v = this; + return !v.inited; + }; + Value.prototype.IsUndefined = function() { return this.$val.IsUndefined(); }; + Value.ptr.prototype.IsNaN = function() { + var v; + v = this; + return !!($global.isNaN($clone(v, Value).internal())); + }; + Value.prototype.IsNaN = function() { return this.$val.IsNaN(); }; + Value.ptr.prototype.Delete = function(p) { + var p, v, vType; + v = this; + vType = $clone(v, Value).Type(); + if (!new Type(vType).isObject()) { + $panic(new ValueError.ptr("Value.Delete", vType)); + } + delete $clone(v, Value).internal()[$externalize(p, $String)]; + }; + Value.prototype.Delete = function(p) { return this.$val.Delete(p); }; + Value.ptr.prototype.Equal = function(w) { + var v, w; + v = this; + return $clone(v, Value).internal() === $clone(w, Value).internal(); + }; + Value.prototype.Equal = function(w) { return this.$val.Equal(w); }; + ValueError.ptr.prototype.Error = function() { + var e; + e = this; + return "syscall/js: call of " + e.Method + " on " + new Type(e.Type).String(); + }; + ValueError.prototype.Error = function() { return this.$val.Error(); }; + CopyBytesToGo = function(dst, src) { + var dlen, dst, src, vlen; + vlen = $parseInt(src.v.length); + dlen = dst.$length; + if (dlen < vlen) { + vlen = dlen; + } + $copySlice(dst, $assertType($internalize(src.v, $emptyInterface), sliceType$3)); + return vlen; + }; + $pkg.CopyBytesToGo = CopyBytesToGo; + CopyBytesToJS = function(dst, src) { + var _tuple, dst, dt, ok, src; + _tuple = $assertType($internalize(dst.v, $emptyInterface), sliceType$3, true); + dt = _tuple[0]; + ok = _tuple[1]; + if (!ok) { + $panic(new $String("syscall/js: CopyBytesToJS: expected dst to be an Uint8Array")); + } + return $copySlice(dt, src); + }; + $pkg.CopyBytesToJS = CopyBytesToJS; + Type.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "isObject", name: "isObject", pkg: "syscall/js", typ: $funcType([], [$Bool], false)}]; + Func.methods = [{prop: "Release", name: "Release", pkg: "", typ: $funcType([], [], false)}]; + Error.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + Value.methods = [{prop: "internal", name: "internal", pkg: "syscall/js", typ: $funcType([], [ptrType$1], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([$String, sliceType$2], [Value], true)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "InstanceOf", name: "InstanceOf", pkg: "", typ: $funcType([Value], [$Bool], false)}, {prop: "Invoke", name: "Invoke", pkg: "", typ: $funcType([sliceType$2], [Value], true)}, {prop: "JSValue", name: "JSValue", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Length", name: "Length", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "New", name: "New", pkg: "", typ: $funcType([sliceType$2], [Value], true)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $emptyInterface], [], false)}, {prop: "SetIndex", name: "SetIndex", pkg: "", typ: $funcType([$Int, $emptyInterface], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Truthy", name: "Truthy", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "IsNull", name: "IsNull", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsUndefined", name: "IsUndefined", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsNaN", name: "IsNaN", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Delete", name: "Delete", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([Value], [$Bool], false)}]; + ptrType$2.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + Func.init("", [{prop: "Value", name: "Value", embedded: true, exported: true, typ: Value, tag: ""}]); + Error.init("", [{prop: "Value", name: "Value", embedded: true, exported: true, typ: Value, tag: ""}]); + Value.init("syscall/js", [{prop: "v", name: "v", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "inited", name: "inited", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "_$2", name: "_", embedded: false, exported: false, typ: arrayType, tag: ""}]); + ValueError.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - buf = new structType.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$2.zero()); - math = $global.Math; + id = null; + instanceOf = null; + typeOf = null; + typeNames = new sliceType(["undefined", "null", "boolean", "number", "string", "symbol", "object", "function"]); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; @@ -3164,1220 +6534,122 @@ $packages["math"] = (function() { return $pkg; })(); $packages["syscall"] = (function() { - var $pkg = {}, $init, js, race, runtime, sync, SockaddrLinklayer, SockaddrNetlink, mmapper, Errno, Sockaddr, SockaddrInet4, SockaddrInet6, SockaddrUnix, Timespec, Stat_t, RawSockaddrInet4, RawSockaddrInet6, RawSockaddrUnix, RawSockaddrLinklayer, RawSockaddrNetlink, RawSockaddr, RawSockaddrAny, _Socklen, Linger, Iovec, IPMreq, IPMreqn, IPv6Mreq, Msghdr, sliceType, sliceType$1, ptrType$2, ptrType$4, arrayType$1, ptrType$8, arrayType$2, ptrType$11, arrayType$4, arrayType$5, arrayType$8, arrayType$9, arrayType$10, arrayType$11, ptrType$18, ptrType$19, structType, ptrType$22, ptrType$24, ptrType$25, mapType, funcType$2, funcType$3, ptrType$26, ptrType$27, ptrType$28, ptrType$29, ptrType$31, warningPrinted, lineBuffer, syscallModule, alreadyTriedToLoad, minusOne, envs, mapper, errEAGAIN, errEINVAL, errENOENT, ioSync, ioSync$24ptr, errors, init, printWarning, printToConsole, indexByte, runtime_envs, syscall, Syscall, Syscall6, BytePtrFromString, readInt, readIntBE, readIntLE, ParseDirent, CloseOnExec, SetNonblock, msanRead, msanWrite, itoa, uitoa, anyToSockaddr, Accept, Accept4, SetsockoptIPMreqn, Recvmsg, SendmsgN, ReadDirent, direntIno, direntReclen, direntNamlen, errnoErr, Read, Write, GetsockoptInt, Recvfrom, Sendto, SetsockoptByte, SetsockoptInt, SetsockoptInet4Addr, SetsockoptIPMreq, SetsockoptIPv6Mreq, SetsockoptLinger, Close, Dup, Fchdir, Fchmod, fcntl, Fsync, Getdents, read, write, munmap, Fchown, Fstat, Ftruncate, Lstat, Pread, Pwrite, Seek, Shutdown, accept, accept4, getsockopt, setsockopt, recvfrom, sendto, recvmsg, sendmsg, mmap; - js = $packages["github.com/gopherjs/gopherjs/js"]; - race = $packages["internal/race"]; + var $pkg = {}, $init, errors, itoa, oserror, runtime, sync, js, Errno, Stat_t, Iovec, Sockaddr, SockaddrInet4, SockaddrInet6, RawConn, jsFile, callResult, sliceType, sliceType$2, ptrType, funcType, arrayType$2, ptrType$2, arrayType$3, arrayType$4, funcType$1, funcType$2, errorstr, errEAGAIN, errEINVAL, errENOENT, errnoByCode, jsProcess, jsFS, constants, uint8Array, nodeWRONLY, nodeRDWR, nodeCREATE, nodeTRUNC, nodeAPPEND, nodeEXCL, filesMu, files, envs, _r, faketimeWrite, errnoErr, StopIO, Accept, Recvfrom, Sendto, Recvmsg, SendmsgN, SetReadDeadline, SetWriteDeadline, Shutdown, SetNonblock, runtime_envs, setStat, fsCall, fdToFile, Close, CloseOnExec, ReadDirent, Lstat, Fstat, Fchmod, Fchown, Ftruncate, Chdir, Fchdir, Fsync, Read, Write, Pread, Pwrite, Seek, Dup, checkPath, recoverErr, mapJSError; + errors = $packages["errors"]; + itoa = $packages["internal/itoa"]; + oserror = $packages["internal/oserror"]; runtime = $packages["runtime"]; sync = $packages["sync"]; - SockaddrLinklayer = $pkg.SockaddrLinklayer = $newType(0, $kindStruct, "syscall.SockaddrLinklayer", true, "syscall", true, function(Protocol_, Ifindex_, Hatype_, Pkttype_, Halen_, Addr_, raw_) { - this.$val = this; - if (arguments.length === 0) { - this.Protocol = 0; - this.Ifindex = 0; - this.Hatype = 0; - this.Pkttype = 0; - this.Halen = 0; - this.Addr = arrayType$1.zero(); - this.raw = new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$1.zero()); - return; - } - this.Protocol = Protocol_; - this.Ifindex = Ifindex_; - this.Hatype = Hatype_; - this.Pkttype = Pkttype_; - this.Halen = Halen_; - this.Addr = Addr_; - this.raw = raw_; - }); - SockaddrNetlink = $pkg.SockaddrNetlink = $newType(0, $kindStruct, "syscall.SockaddrNetlink", true, "syscall", true, function(Family_, Pad_, Pid_, Groups_, raw_) { - this.$val = this; - if (arguments.length === 0) { - this.Family = 0; - this.Pad = 0; - this.Pid = 0; - this.Groups = 0; - this.raw = new RawSockaddrNetlink.ptr(0, 0, 0, 0); - return; - } - this.Family = Family_; - this.Pad = Pad_; - this.Pid = Pid_; - this.Groups = Groups_; - this.raw = raw_; - }); - mmapper = $pkg.mmapper = $newType(0, $kindStruct, "syscall.mmapper", true, "syscall", false, function(Mutex_, active_, mmap_, munmap_) { - this.$val = this; - if (arguments.length === 0) { - this.Mutex = new sync.Mutex.ptr(0, 0); - this.active = false; - this.mmap = $throwNilPointerError; - this.munmap = $throwNilPointerError; - return; - } - this.Mutex = Mutex_; - this.active = active_; - this.mmap = mmap_; - this.munmap = munmap_; - }); + js = $packages["syscall/js"]; Errno = $pkg.Errno = $newType(4, $kindUintptr, "syscall.Errno", true, "syscall", true, null); + Stat_t = $pkg.Stat_t = $newType(0, $kindStruct, "syscall.Stat_t", true, "syscall", true, function(Dev_, Ino_, Mode_, Nlink_, Uid_, Gid_, Rdev_, Size_, Blksize_, Blocks_, Atime_, AtimeNsec_, Mtime_, MtimeNsec_, Ctime_, CtimeNsec_) { + this.$val = this; + if (arguments.length === 0) { + this.Dev = new $Int64(0, 0); + this.Ino = new $Uint64(0, 0); + this.Mode = 0; + this.Nlink = 0; + this.Uid = 0; + this.Gid = 0; + this.Rdev = new $Int64(0, 0); + this.Size = new $Int64(0, 0); + this.Blksize = 0; + this.Blocks = 0; + this.Atime = new $Int64(0, 0); + this.AtimeNsec = new $Int64(0, 0); + this.Mtime = new $Int64(0, 0); + this.MtimeNsec = new $Int64(0, 0); + this.Ctime = new $Int64(0, 0); + this.CtimeNsec = new $Int64(0, 0); + return; + } + this.Dev = Dev_; + this.Ino = Ino_; + this.Mode = Mode_; + this.Nlink = Nlink_; + this.Uid = Uid_; + this.Gid = Gid_; + this.Rdev = Rdev_; + this.Size = Size_; + this.Blksize = Blksize_; + this.Blocks = Blocks_; + this.Atime = Atime_; + this.AtimeNsec = AtimeNsec_; + this.Mtime = Mtime_; + this.MtimeNsec = MtimeNsec_; + this.Ctime = Ctime_; + this.CtimeNsec = CtimeNsec_; + }); + Iovec = $pkg.Iovec = $newType(0, $kindStruct, "syscall.Iovec", true, "syscall", true, function() { + this.$val = this; + if (arguments.length === 0) { + return; + } + }); Sockaddr = $pkg.Sockaddr = $newType(8, $kindInterface, "syscall.Sockaddr", true, "syscall", true, null); - SockaddrInet4 = $pkg.SockaddrInet4 = $newType(0, $kindStruct, "syscall.SockaddrInet4", true, "syscall", true, function(Port_, Addr_, raw_) { + SockaddrInet4 = $pkg.SockaddrInet4 = $newType(0, $kindStruct, "syscall.SockaddrInet4", true, "syscall", true, function(Port_, Addr_) { this.$val = this; if (arguments.length === 0) { this.Port = 0; - this.Addr = arrayType$9.zero(); - this.raw = new RawSockaddrInet4.ptr(0, 0, arrayType$9.zero(), arrayType$1.zero()); + this.Addr = arrayType$3.zero(); return; } this.Port = Port_; this.Addr = Addr_; - this.raw = raw_; }); - SockaddrInet6 = $pkg.SockaddrInet6 = $newType(0, $kindStruct, "syscall.SockaddrInet6", true, "syscall", true, function(Port_, ZoneId_, Addr_, raw_) { + SockaddrInet6 = $pkg.SockaddrInet6 = $newType(0, $kindStruct, "syscall.SockaddrInet6", true, "syscall", true, function(Port_, ZoneId_, Addr_) { this.$val = this; if (arguments.length === 0) { this.Port = 0; this.ZoneId = 0; - this.Addr = arrayType$2.zero(); - this.raw = new RawSockaddrInet6.ptr(0, 0, 0, arrayType$2.zero(), 0); + this.Addr = arrayType$4.zero(); return; } this.Port = Port_; this.ZoneId = ZoneId_; this.Addr = Addr_; - this.raw = raw_; }); - SockaddrUnix = $pkg.SockaddrUnix = $newType(0, $kindStruct, "syscall.SockaddrUnix", true, "syscall", true, function(Name_, raw_) { + RawConn = $pkg.RawConn = $newType(8, $kindInterface, "syscall.RawConn", true, "syscall", true, null); + jsFile = $pkg.jsFile = $newType(0, $kindStruct, "syscall.jsFile", true, "syscall", false, function(path_, entries_, dirIdx_, pos_, seeked_) { this.$val = this; if (arguments.length === 0) { - this.Name = ""; - this.raw = new RawSockaddrUnix.ptr(0, arrayType$8.zero()); + this.path = ""; + this.entries = sliceType.nil; + this.dirIdx = 0; + this.pos = new $Int64(0, 0); + this.seeked = false; return; } - this.Name = Name_; - this.raw = raw_; + this.path = path_; + this.entries = entries_; + this.dirIdx = dirIdx_; + this.pos = pos_; + this.seeked = seeked_; }); - Timespec = $pkg.Timespec = $newType(0, $kindStruct, "syscall.Timespec", true, "syscall", true, function(Sec_, Nsec_) { + callResult = $newType(0, $kindStruct, "syscall.callResult", true, "syscall", false, function(val_, err_) { this.$val = this; if (arguments.length === 0) { - this.Sec = new $Int64(0, 0); - this.Nsec = new $Int64(0, 0); + this.val = new js.Value.ptr(null, false, arrayType$2.zero()); + this.err = $ifaceNil; return; } - this.Sec = Sec_; - this.Nsec = Nsec_; + this.val = val_; + this.err = err_; }); - Stat_t = $pkg.Stat_t = $newType(0, $kindStruct, "syscall.Stat_t", true, "syscall", true, function(Dev_, Ino_, Nlink_, Mode_, Uid_, Gid_, X__pad0_, Rdev_, Size_, Blksize_, Blocks_, Atim_, Mtim_, Ctim_, X__unused_) { - this.$val = this; - if (arguments.length === 0) { - this.Dev = new $Uint64(0, 0); - this.Ino = new $Uint64(0, 0); - this.Nlink = new $Uint64(0, 0); - this.Mode = 0; - this.Uid = 0; - this.Gid = 0; - this.X__pad0 = 0; - this.Rdev = new $Uint64(0, 0); - this.Size = new $Int64(0, 0); - this.Blksize = new $Int64(0, 0); - this.Blocks = new $Int64(0, 0); - this.Atim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); - this.Mtim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); - this.Ctim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); - this.X__unused = arrayType$5.zero(); - return; - } - this.Dev = Dev_; - this.Ino = Ino_; - this.Nlink = Nlink_; - this.Mode = Mode_; - this.Uid = Uid_; - this.Gid = Gid_; - this.X__pad0 = X__pad0_; - this.Rdev = Rdev_; - this.Size = Size_; - this.Blksize = Blksize_; - this.Blocks = Blocks_; - this.Atim = Atim_; - this.Mtim = Mtim_; - this.Ctim = Ctim_; - this.X__unused = X__unused_; - }); - RawSockaddrInet4 = $pkg.RawSockaddrInet4 = $newType(0, $kindStruct, "syscall.RawSockaddrInet4", true, "syscall", true, function(Family_, Port_, Addr_, Zero_) { - this.$val = this; - if (arguments.length === 0) { - this.Family = 0; - this.Port = 0; - this.Addr = arrayType$9.zero(); - this.Zero = arrayType$1.zero(); - return; - } - this.Family = Family_; - this.Port = Port_; - this.Addr = Addr_; - this.Zero = Zero_; - }); - RawSockaddrInet6 = $pkg.RawSockaddrInet6 = $newType(0, $kindStruct, "syscall.RawSockaddrInet6", true, "syscall", true, function(Family_, Port_, Flowinfo_, Addr_, Scope_id_) { - this.$val = this; - if (arguments.length === 0) { - this.Family = 0; - this.Port = 0; - this.Flowinfo = 0; - this.Addr = arrayType$2.zero(); - this.Scope_id = 0; - return; - } - this.Family = Family_; - this.Port = Port_; - this.Flowinfo = Flowinfo_; - this.Addr = Addr_; - this.Scope_id = Scope_id_; - }); - RawSockaddrUnix = $pkg.RawSockaddrUnix = $newType(0, $kindStruct, "syscall.RawSockaddrUnix", true, "syscall", true, function(Family_, Path_) { - this.$val = this; - if (arguments.length === 0) { - this.Family = 0; - this.Path = arrayType$8.zero(); - return; - } - this.Family = Family_; - this.Path = Path_; - }); - RawSockaddrLinklayer = $pkg.RawSockaddrLinklayer = $newType(0, $kindStruct, "syscall.RawSockaddrLinklayer", true, "syscall", true, function(Family_, Protocol_, Ifindex_, Hatype_, Pkttype_, Halen_, Addr_) { - this.$val = this; - if (arguments.length === 0) { - this.Family = 0; - this.Protocol = 0; - this.Ifindex = 0; - this.Hatype = 0; - this.Pkttype = 0; - this.Halen = 0; - this.Addr = arrayType$1.zero(); - return; - } - this.Family = Family_; - this.Protocol = Protocol_; - this.Ifindex = Ifindex_; - this.Hatype = Hatype_; - this.Pkttype = Pkttype_; - this.Halen = Halen_; - this.Addr = Addr_; - }); - RawSockaddrNetlink = $pkg.RawSockaddrNetlink = $newType(0, $kindStruct, "syscall.RawSockaddrNetlink", true, "syscall", true, function(Family_, Pad_, Pid_, Groups_) { - this.$val = this; - if (arguments.length === 0) { - this.Family = 0; - this.Pad = 0; - this.Pid = 0; - this.Groups = 0; - return; - } - this.Family = Family_; - this.Pad = Pad_; - this.Pid = Pid_; - this.Groups = Groups_; - }); - RawSockaddr = $pkg.RawSockaddr = $newType(0, $kindStruct, "syscall.RawSockaddr", true, "syscall", true, function(Family_, Data_) { - this.$val = this; - if (arguments.length === 0) { - this.Family = 0; - this.Data = arrayType$10.zero(); - return; - } - this.Family = Family_; - this.Data = Data_; - }); - RawSockaddrAny = $pkg.RawSockaddrAny = $newType(0, $kindStruct, "syscall.RawSockaddrAny", true, "syscall", true, function(Addr_, Pad_) { - this.$val = this; - if (arguments.length === 0) { - this.Addr = new RawSockaddr.ptr(0, arrayType$10.zero()); - this.Pad = arrayType$11.zero(); - return; - } - this.Addr = Addr_; - this.Pad = Pad_; - }); - _Socklen = $pkg._Socklen = $newType(4, $kindUint32, "syscall._Socklen", true, "syscall", false, null); - Linger = $pkg.Linger = $newType(0, $kindStruct, "syscall.Linger", true, "syscall", true, function(Onoff_, Linger_) { - this.$val = this; - if (arguments.length === 0) { - this.Onoff = 0; - this.Linger = 0; - return; - } - this.Onoff = Onoff_; - this.Linger = Linger_; - }); - Iovec = $pkg.Iovec = $newType(0, $kindStruct, "syscall.Iovec", true, "syscall", true, function(Base_, Len_) { - this.$val = this; - if (arguments.length === 0) { - this.Base = ptrType$2.nil; - this.Len = new $Uint64(0, 0); - return; - } - this.Base = Base_; - this.Len = Len_; - }); - IPMreq = $pkg.IPMreq = $newType(0, $kindStruct, "syscall.IPMreq", true, "syscall", true, function(Multiaddr_, Interface_) { - this.$val = this; - if (arguments.length === 0) { - this.Multiaddr = arrayType$9.zero(); - this.Interface = arrayType$9.zero(); - return; - } - this.Multiaddr = Multiaddr_; - this.Interface = Interface_; - }); - IPMreqn = $pkg.IPMreqn = $newType(0, $kindStruct, "syscall.IPMreqn", true, "syscall", true, function(Multiaddr_, Address_, Ifindex_) { - this.$val = this; - if (arguments.length === 0) { - this.Multiaddr = arrayType$9.zero(); - this.Address = arrayType$9.zero(); - this.Ifindex = 0; - return; - } - this.Multiaddr = Multiaddr_; - this.Address = Address_; - this.Ifindex = Ifindex_; - }); - IPv6Mreq = $pkg.IPv6Mreq = $newType(0, $kindStruct, "syscall.IPv6Mreq", true, "syscall", true, function(Multiaddr_, Interface_) { - this.$val = this; - if (arguments.length === 0) { - this.Multiaddr = arrayType$2.zero(); - this.Interface = 0; - return; - } - this.Multiaddr = Multiaddr_; - this.Interface = Interface_; - }); - Msghdr = $pkg.Msghdr = $newType(0, $kindStruct, "syscall.Msghdr", true, "syscall", true, function(Name_, Namelen_, Pad_cgo_0_, Iov_, Iovlen_, Control_, Controllen_, Flags_, Pad_cgo_1_) { - this.$val = this; - if (arguments.length === 0) { - this.Name = ptrType$2.nil; - this.Namelen = 0; - this.Pad_cgo_0 = arrayType$9.zero(); - this.Iov = ptrType$19.nil; - this.Iovlen = new $Uint64(0, 0); - this.Control = ptrType$2.nil; - this.Controllen = new $Uint64(0, 0); - this.Flags = 0; - this.Pad_cgo_1 = arrayType$9.zero(); - return; - } - this.Name = Name_; - this.Namelen = Namelen_; - this.Pad_cgo_0 = Pad_cgo_0_; - this.Iov = Iov_; - this.Iovlen = Iovlen_; - this.Control = Control_; - this.Controllen = Controllen_; - this.Flags = Flags_; - this.Pad_cgo_1 = Pad_cgo_1_; - }); - sliceType = $sliceType($Uint8); - sliceType$1 = $sliceType($String); - ptrType$2 = $ptrType($Uint8); - ptrType$4 = $ptrType($Int32); - arrayType$1 = $arrayType($Uint8, 8); - ptrType$8 = $ptrType($Uint16); - arrayType$2 = $arrayType($Uint8, 16); - ptrType$11 = $ptrType(SockaddrNetlink); - arrayType$4 = $arrayType($Uint8, 32); - arrayType$5 = $arrayType($Int64, 3); - arrayType$8 = $arrayType($Int8, 108); - arrayType$9 = $arrayType($Uint8, 4); - arrayType$10 = $arrayType($Int8, 14); - arrayType$11 = $arrayType($Int8, 96); - ptrType$18 = $ptrType(_Socklen); - ptrType$19 = $ptrType(Iovec); - structType = $structType("syscall", [{prop: "addr", name: "addr", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "cap", name: "cap", embedded: false, exported: false, typ: $Int, tag: ""}]); - ptrType$22 = $ptrType($Int64); - ptrType$24 = $ptrType(SockaddrLinklayer); - ptrType$25 = $ptrType(mmapper); - mapType = $mapType(ptrType$2, sliceType); - funcType$2 = $funcType([$Uintptr, $Uintptr, $Int, $Int, $Int, $Int64], [$Uintptr, $error], false); - funcType$3 = $funcType([$Uintptr, $Uintptr], [$error], false); - ptrType$26 = $ptrType(SockaddrInet4); - ptrType$27 = $ptrType(SockaddrInet6); - ptrType$28 = $ptrType(SockaddrUnix); - ptrType$29 = $ptrType(Timespec); - ptrType$31 = $ptrType(Msghdr); - init = function() { - $flushConsole = (function() { - if (!((lineBuffer.$length === 0))) { - $global.console.log($externalize(($bytesToString(lineBuffer)), $String)); - lineBuffer = sliceType.nil; - } - }); + sliceType = $sliceType($String); + sliceType$2 = $sliceType($emptyInterface); + ptrType = $ptrType($error); + funcType = $funcType([], [], false); + arrayType$2 = $arrayType(funcType, 0); + ptrType$2 = $ptrType(jsFile); + arrayType$3 = $arrayType($Uint8, 4); + arrayType$4 = $arrayType($Uint8, 16); + funcType$1 = $funcType([$Uintptr], [], false); + funcType$2 = $funcType([$Uintptr], [$Bool], false); + faketimeWrite = function(fd, p) { + var fd, p; + $panic(new $String("not implemented")); }; - printWarning = function() { - if (!warningPrinted) { - $global.console.error($externalize("warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md", $String)); - } - warningPrinted = true; - }; - printToConsole = function(b) { - var b, goPrintToConsole, i; - goPrintToConsole = $global.goPrintToConsole; - if (!(goPrintToConsole === undefined)) { - goPrintToConsole(b); - return; - } - lineBuffer = $appendSlice(lineBuffer, b); - while (true) { - i = indexByte(lineBuffer, 10); - if (i === -1) { - break; - } - $global.console.log($externalize(($bytesToString($subslice(lineBuffer, 0, i))), $String)); - lineBuffer = $subslice(lineBuffer, (i + 1 >> 0)); - } - }; - indexByte = function(s, c) { - var _i, _ref, b, c, i, s; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - if (b === c) { - return i; - } - _i++; - } - return -1; - }; - runtime_envs = function() { - var envkeys, envs$1, i, jsEnv, key, process; - process = $global.process; - if (process === undefined) { - return sliceType$1.nil; - } - jsEnv = process.env; - envkeys = $global.Object.keys(jsEnv); - envs$1 = $makeSlice(sliceType$1, $parseInt(envkeys.length)); - i = 0; - while (true) { - if (!(i < $parseInt(envkeys.length))) { break; } - key = $internalize(envkeys[i], $String); - ((i < 0 || i >= envs$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : envs$1.$array[envs$1.$offset + i] = key + "=" + $internalize(jsEnv[$externalize(key, $String)], $String)); - i = i + (1) >> 0; - } - return envs$1; - }; - syscall = function(name) { - var name, require, $deferred; - /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - $deferred.push([(function() { - $recover(); - }), []]); - if (syscallModule === null) { - if (alreadyTriedToLoad) { - return null; - } - alreadyTriedToLoad = true; - require = $global.require; - if (require === undefined) { - $panic(new $String("")); - } - syscallModule = require($externalize("syscall", $String)); - } - return syscallModule[$externalize(name, $String)]; - /* */ } catch(err) { $err = err; return null; } finally { $callDeferred($deferred, $err); } - }; - Syscall = function(trap, a1, a2, a3) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, a1, a2, a3, array, err, f, r, r1, r2, slice, trap; - r1 = 0; - r2 = 0; - err = 0; - f = syscall("Syscall"); - if (!(f === null)) { - r = f(trap, a1, a2, a3); - _tmp = ((($parseInt(r[0]) >> 0) >>> 0)); - _tmp$1 = ((($parseInt(r[1]) >> 0) >>> 0)); - _tmp$2 = ((($parseInt(r[2]) >> 0) >>> 0)); - r1 = _tmp; - r2 = _tmp$1; - err = _tmp$2; - return [r1, r2, err]; - } - if ((trap === 1) && ((a1 === 1) || (a1 === 2))) { - array = a2; - slice = $makeSlice(sliceType, $parseInt(array.length)); - slice.$array = array; - printToConsole(slice); - _tmp$3 = (($parseInt(array.length) >>> 0)); - _tmp$4 = 0; - _tmp$5 = 0; - r1 = _tmp$3; - r2 = _tmp$4; - err = _tmp$5; - return [r1, r2, err]; - } - if (trap === 231) { - runtime.Goexit(); - } - printWarning(); - _tmp$6 = ((minusOne >>> 0)); - _tmp$7 = 0; - _tmp$8 = 13; - r1 = _tmp$6; - r2 = _tmp$7; - err = _tmp$8; - return [r1, r2, err]; - }; - $pkg.Syscall = Syscall; - Syscall6 = function(trap, a1, a2, a3, a4, a5, a6) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, a4, a5, a6, err, f, r, r1, r2, trap; - r1 = 0; - r2 = 0; - err = 0; - f = syscall("Syscall6"); - if (!(f === null)) { - r = f(trap, a1, a2, a3, a4, a5, a6); - _tmp = ((($parseInt(r[0]) >> 0) >>> 0)); - _tmp$1 = ((($parseInt(r[1]) >> 0) >>> 0)); - _tmp$2 = ((($parseInt(r[2]) >> 0) >>> 0)); - r1 = _tmp; - r2 = _tmp$1; - err = _tmp$2; - return [r1, r2, err]; - } - if (!((trap === 202))) { - printWarning(); - } - _tmp$3 = ((minusOne >>> 0)); - _tmp$4 = 0; - _tmp$5 = 13; - r1 = _tmp$3; - r2 = _tmp$4; - err = _tmp$5; - return [r1, r2, err]; - }; - $pkg.Syscall6 = Syscall6; - BytePtrFromString = function(s) { - var _i, _ref, array, b, i, s; - array = new ($global.Uint8Array)(s.length + 1 >> 0); - _ref = (new sliceType($stringToBytes(s))); - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - if (b === 0) { - return [ptrType$2.nil, new Errno(22)]; - } - array[i] = b; - _i++; - } - array[s.length] = 0; - return [((array)), $ifaceNil]; - }; - $pkg.BytePtrFromString = BytePtrFromString; - readInt = function(b, off, size) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, off, ok, size, u; - u = new $Uint64(0, 0); - ok = false; - if (b.$length < (((off + size >>> 0) >> 0))) { - _tmp = new $Uint64(0, 0); - _tmp$1 = false; - u = _tmp; - ok = _tmp$1; - return [u, ok]; - } - if (false) { - _tmp$2 = readIntBE($subslice(b, off), size); - _tmp$3 = true; - u = _tmp$2; - ok = _tmp$3; - return [u, ok]; - } - _tmp$4 = readIntLE($subslice(b, off), size); - _tmp$5 = true; - u = _tmp$4; - ok = _tmp$5; - return [u, ok]; - }; - readIntBE = function(b, size) { - var _1, b, size, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - _1 = size; - if (_1 === (1)) { - return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); - } else if (_1 === (2)) { - $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); - return (x = (new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), x$1 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); - } else if (_1 === (4)) { - $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); - return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), x$5 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); - } else if (_1 === (8)) { - $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); - return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$15 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); - } else { - $panic(new $String("syscall: readInt with unsupported size")); - } - }; - readIntLE = function(b, size) { - var _1, b, size, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - _1 = size; - if (_1 === (1)) { - return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); - } else if (_1 === (2)) { - $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); - return (x = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$1 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); - } else if (_1 === (4)) { - $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); - return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$5 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); - } else if (_1 === (8)) { - $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); - return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$15 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); - } else { - $panic(new $String("syscall: readInt with unsupported size")); - } - }; - ParseDirent = function(buf, max, names) { - var _i, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, buf, c, consumed, count, i, ino, max, name, names, namlen, newnames, ok, origlen, rec, reclen, x, x$1, x$2; - consumed = 0; - count = 0; - newnames = sliceType$1.nil; - origlen = buf.$length; - count = 0; - while (true) { - if (!(!((max === 0)) && buf.$length > 0)) { break; } - _tuple = direntReclen(buf); - reclen = _tuple[0]; - ok = _tuple[1]; - if (!ok || (x = (new $Uint64(0, buf.$length)), (reclen.$high > x.$high || (reclen.$high === x.$high && reclen.$low > x.$low)))) { - _tmp = origlen; - _tmp$1 = count; - _tmp$2 = names; - consumed = _tmp; - count = _tmp$1; - newnames = _tmp$2; - return [consumed, count, newnames]; - } - rec = $subslice(buf, 0, $flatten64(reclen)); - buf = $subslice(buf, $flatten64(reclen)); - _tuple$1 = direntIno(rec); - ino = _tuple$1[0]; - ok = _tuple$1[1]; - if (!ok) { - break; - } - if ((ino.$high === 0 && ino.$low === 0)) { - continue; - } - _tuple$2 = direntNamlen(rec); - namlen = _tuple$2[0]; - ok = _tuple$2[1]; - if (!ok || (x$1 = new $Uint64(0 + namlen.$high, 19 + namlen.$low), x$2 = (new $Uint64(0, rec.$length)), (x$1.$high > x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { - break; - } - name = $subslice(rec, 19, $flatten64(new $Uint64(0 + namlen.$high, 19 + namlen.$low))); - _ref = name; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - if (c === 0) { - name = $subslice(name, 0, i); - break; - } - _i++; - } - if (($bytesToString(name)) === "." || ($bytesToString(name)) === "..") { - continue; - } - max = max - (1) >> 0; - count = count + (1) >> 0; - names = $append(names, ($bytesToString(name))); - } - _tmp$3 = origlen - buf.$length >> 0; - _tmp$4 = count; - _tmp$5 = names; - consumed = _tmp$3; - count = _tmp$4; - newnames = _tmp$5; - return [consumed, count, newnames]; - }; - $pkg.ParseDirent = ParseDirent; - CloseOnExec = function(fd) { - var fd; - fcntl(fd, 2, 1); - }; - $pkg.CloseOnExec = CloseOnExec; - SetNonblock = function(fd, nonblocking) { - var _tuple, _tuple$1, err, fd, flag, nonblocking; - err = $ifaceNil; - _tuple = fcntl(fd, 3, 0); - flag = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - err = err; - return err; - } - if (nonblocking) { - flag = flag | (2048); - } else { - flag = (flag & ~(2048)) >> 0; - } - _tuple$1 = fcntl(fd, 4, flag); - err = _tuple$1[1]; - err = err; - return err; - }; - $pkg.SetNonblock = SetNonblock; - msanRead = function(addr, len) { - var addr, len; - }; - msanWrite = function(addr, len) { - var addr, len; - }; - itoa = function(val) { - var val; - if (val < 0) { - return "-" + uitoa(((-val >>> 0))); - } - return uitoa(((val >>> 0))); - }; - uitoa = function(val) { - var _q, _r, buf, i, val; - buf = arrayType$4.zero(); - i = 31; - while (true) { - if (!(val >= 10)) { break; } - ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((((_r = val % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24))); - i = i - (1) >> 0; - val = (_q = val / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - } - ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((val + 48 >>> 0) << 24 >>> 24))); - return ($bytesToString($subslice(new sliceType(buf), i))); - }; - Timespec.ptr.prototype.Unix = function() { - var _tmp, _tmp$1, nsec, sec, ts; - sec = new $Int64(0, 0); - nsec = new $Int64(0, 0); - ts = this; - _tmp = (ts.Sec); - _tmp$1 = (ts.Nsec); - sec = _tmp; - nsec = _tmp$1; - return [sec, nsec]; - }; - Timespec.prototype.Unix = function() { return this.$val.Unix(); }; - Timespec.ptr.prototype.Nano = function() { - var ts, x, x$1; - ts = this; - return (x = $mul64((ts.Sec), new $Int64(0, 1000000000)), x$1 = (ts.Nsec), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); - }; - Timespec.prototype.Nano = function() { return this.$val.Nano(); }; - SockaddrInet4.ptr.prototype.sockaddr = function() { - var _array, _struct, _view, i, p, sa, x, x$1, x$2; - sa = this; - if (sa.Port < 0 || sa.Port > 65535) { - return [0, 0, new Errno(22)]; - } - sa.raw.Family = 2; - p = (((x = sa.raw, (x.$ptr_Port || (x.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, x)))))); - p.nilCheck, p[0] = (((sa.Port >> 8 >> 0) << 24 >>> 24)); - p.nilCheck, p[1] = ((sa.Port << 24 >>> 24)); - i = 0; - while (true) { - if (!(i < 4)) { break; } - (x$2 = sa.raw.Addr, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = (x$1 = sa.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])))); - i = i + (1) >> 0; - } - _array = new Uint8Array(16); - return [(_array), 16, $ifaceNil]; - }; - SockaddrInet4.prototype.sockaddr = function() { return this.$val.sockaddr(); }; - SockaddrInet6.ptr.prototype.sockaddr = function() { - var _array, _struct, _view, i, p, sa, x, x$1, x$2; - sa = this; - if (sa.Port < 0 || sa.Port > 65535) { - return [0, 0, new Errno(22)]; - } - sa.raw.Family = 10; - p = (((x = sa.raw, (x.$ptr_Port || (x.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, x)))))); - p.nilCheck, p[0] = (((sa.Port >> 8 >> 0) << 24 >>> 24)); - p.nilCheck, p[1] = ((sa.Port << 24 >>> 24)); - sa.raw.Scope_id = sa.ZoneId; - i = 0; - while (true) { - if (!(i < 16)) { break; } - (x$2 = sa.raw.Addr, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = (x$1 = sa.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])))); - i = i + (1) >> 0; - } - _array = new Uint8Array(28); - return [(_array), 28, $ifaceNil]; - }; - SockaddrInet6.prototype.sockaddr = function() { return this.$val.sockaddr(); }; - SockaddrUnix.ptr.prototype.sockaddr = function() { - var _array, _struct, _view, i, n, name, sa, sl, x; - sa = this; - name = sa.Name; - n = name.length; - if (n > 108) { - return [0, 0, new Errno(22)]; - } - if ((n === 108) && !((name.charCodeAt(0) === 64))) { - return [0, 0, new Errno(22)]; - } - sa.raw.Family = 1; - i = 0; - while (true) { - if (!(i < n)) { break; } - (x = sa.raw.Path, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = ((name.charCodeAt(i) << 24 >> 24)))); - i = i + (1) >> 0; - } - sl = 2; - if (n > 0) { - sl = sl + ((((n >>> 0)) + 1 >>> 0)) >>> 0; - } - if (sa.raw.Path[0] === 64) { - sa.raw.Path[0] = 0; - sl = sl - (1) >>> 0; - } - _array = new Uint8Array(110); - return [(_array), sl, $ifaceNil]; - }; - SockaddrUnix.prototype.sockaddr = function() { return this.$val.sockaddr(); }; - SockaddrLinklayer.ptr.prototype.sockaddr = function() { - var _array, _struct, _view, i, sa, x, x$1; - sa = this; - if (sa.Ifindex < 0 || sa.Ifindex > 2147483647) { - return [0, 0, new Errno(22)]; - } - sa.raw.Family = 17; - sa.raw.Protocol = sa.Protocol; - sa.raw.Ifindex = ((sa.Ifindex >> 0)); - sa.raw.Hatype = sa.Hatype; - sa.raw.Pkttype = sa.Pkttype; - sa.raw.Halen = sa.Halen; - i = 0; - while (true) { - if (!(i < 8)) { break; } - (x$1 = sa.raw.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = (x = sa.Addr, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])))); - i = i + (1) >> 0; - } - _array = new Uint8Array(20); - return [(_array), 20, $ifaceNil]; - }; - SockaddrLinklayer.prototype.sockaddr = function() { return this.$val.sockaddr(); }; - SockaddrNetlink.ptr.prototype.sockaddr = function() { - var _array, _struct, _view, sa; - sa = this; - sa.raw.Family = 16; - sa.raw.Pad = sa.Pad; - sa.raw.Pid = sa.Pid; - sa.raw.Groups = sa.Groups; - _array = new Uint8Array(12); - return [(_array), 12, $ifaceNil]; - }; - SockaddrNetlink.prototype.sockaddr = function() { return this.$val.sockaddr(); }; - anyToSockaddr = function(rsa) { - var _1, _array, _array$1, _array$2, _array$3, _array$4, _array$5, _array$6, _array$7, _array$8, _array$9, _struct, _struct$1, _struct$2, _struct$3, _struct$4, _struct$5, _struct$6, _struct$7, _struct$8, _struct$9, _view, _view$1, _view$2, _view$3, _view$4, _view$5, _view$6, _view$7, _view$8, _view$9, bytes, i, i$1, i$2, n, p, p$1, pp, pp$1, pp$2, pp$3, pp$4, rsa, sa, sa$1, sa$2, sa$3, sa$4, x, x$1, x$2, x$3, x$4, x$5, x$6; - _1 = rsa.Addr.Family; - if (_1 === (16)) { - _array$1 = new Uint8Array(112); - pp = ((_array = (_array$1), _struct = new RawSockaddrNetlink.ptr(0, 0, 0, 0), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Family = _view.getUint16(0, true), _struct.Pad = _view.getUint16(2, true), _struct.Pid = _view.getUint32(4, true), _struct.Groups = _view.getUint32(8, true), _struct)); - _struct$1 = rsa, _view$1 = new DataView(_array$1.buffer, _array$1.byteOffset), _struct$1.Addr.Family = _view$1.getUint16(0, true), _struct$1.Addr.Data = new ($nativeArray($kindInt8))(_array$1.buffer, $min(_array$1.byteOffset + 2, _array$1.buffer.byteLength)), _struct$1.Pad = new ($nativeArray($kindInt8))(_array$1.buffer, $min(_array$1.byteOffset + 16, _array$1.buffer.byteLength)); - sa = new SockaddrNetlink.ptr(0, 0, 0, 0, new RawSockaddrNetlink.ptr(0, 0, 0, 0)); - sa.Family = pp.Family; - sa.Pad = pp.Pad; - sa.Pid = pp.Pid; - sa.Groups = pp.Groups; - return [sa, $ifaceNil]; - } else if (_1 === (17)) { - _array$3 = new Uint8Array(112); - pp$1 = ((_array$2 = (_array$3), _struct$2 = new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$1.zero()), _view$2 = new DataView(_array$2.buffer, _array$2.byteOffset), _struct$2.Family = _view$2.getUint16(0, true), _struct$2.Protocol = _view$2.getUint16(2, true), _struct$2.Ifindex = _view$2.getInt32(4, true), _struct$2.Hatype = _view$2.getUint16(8, true), _struct$2.Pkttype = _view$2.getUint8(10, true), _struct$2.Halen = _view$2.getUint8(11, true), _struct$2.Addr = new ($nativeArray($kindUint8))(_array$2.buffer, $min(_array$2.byteOffset + 12, _array$2.buffer.byteLength)), _struct$2)); - _struct$3 = rsa, _view$3 = new DataView(_array$3.buffer, _array$3.byteOffset), _struct$3.Addr.Family = _view$3.getUint16(0, true), _struct$3.Addr.Data = new ($nativeArray($kindInt8))(_array$3.buffer, $min(_array$3.byteOffset + 2, _array$3.buffer.byteLength)), _struct$3.Pad = new ($nativeArray($kindInt8))(_array$3.buffer, $min(_array$3.byteOffset + 16, _array$3.buffer.byteLength)); - sa$1 = new SockaddrLinklayer.ptr(0, 0, 0, 0, 0, arrayType$1.zero(), new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$1.zero())); - sa$1.Protocol = pp$1.Protocol; - sa$1.Ifindex = ((pp$1.Ifindex >> 0)); - sa$1.Hatype = pp$1.Hatype; - sa$1.Pkttype = pp$1.Pkttype; - sa$1.Halen = pp$1.Halen; - i = 0; - while (true) { - if (!(i < 8)) { break; } - (x$1 = sa$1.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = (x = pp$1.Addr, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])))); - i = i + (1) >> 0; - } - return [sa$1, $ifaceNil]; - } else if (_1 === (1)) { - _array$5 = new Uint8Array(112); - pp$2 = ((_array$4 = (_array$5), _struct$4 = new RawSockaddrUnix.ptr(0, arrayType$8.zero()), _view$4 = new DataView(_array$4.buffer, _array$4.byteOffset), _struct$4.Family = _view$4.getUint16(0, true), _struct$4.Path = new ($nativeArray($kindInt8))(_array$4.buffer, $min(_array$4.byteOffset + 2, _array$4.buffer.byteLength)), _struct$4)); - _struct$5 = rsa, _view$5 = new DataView(_array$5.buffer, _array$5.byteOffset), _struct$5.Addr.Family = _view$5.getUint16(0, true), _struct$5.Addr.Data = new ($nativeArray($kindInt8))(_array$5.buffer, $min(_array$5.byteOffset + 2, _array$5.buffer.byteLength)), _struct$5.Pad = new ($nativeArray($kindInt8))(_array$5.buffer, $min(_array$5.byteOffset + 16, _array$5.buffer.byteLength)); - sa$2 = new SockaddrUnix.ptr("", new RawSockaddrUnix.ptr(0, arrayType$8.zero())); - if (pp$2.Path[0] === 0) { - pp$2.Path[0] = 64; - } - n = 0; - while (true) { - if (!(n < 108 && !(((x$2 = pp$2.Path, ((n < 0 || n >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[n])) === 0)))) { break; } - n = n + (1) >> 0; - } - bytes = $subslice(new sliceType((($sliceToArray(new sliceType(pp$2.Path))))), 0, n); - sa$2.Name = ($bytesToString(bytes)); - return [sa$2, $ifaceNil]; - } else if (_1 === (2)) { - _array$7 = new Uint8Array(112); - pp$3 = ((_array$6 = (_array$7), _struct$6 = new RawSockaddrInet4.ptr(0, 0, arrayType$9.zero(), arrayType$1.zero()), _view$6 = new DataView(_array$6.buffer, _array$6.byteOffset), _struct$6.Family = _view$6.getUint16(0, true), _struct$6.Port = _view$6.getUint16(2, true), _struct$6.Addr = new ($nativeArray($kindUint8))(_array$6.buffer, $min(_array$6.byteOffset + 4, _array$6.buffer.byteLength)), _struct$6.Zero = new ($nativeArray($kindUint8))(_array$6.buffer, $min(_array$6.byteOffset + 8, _array$6.buffer.byteLength)), _struct$6)); - _struct$7 = rsa, _view$7 = new DataView(_array$7.buffer, _array$7.byteOffset), _struct$7.Addr.Family = _view$7.getUint16(0, true), _struct$7.Addr.Data = new ($nativeArray($kindInt8))(_array$7.buffer, $min(_array$7.byteOffset + 2, _array$7.buffer.byteLength)), _struct$7.Pad = new ($nativeArray($kindInt8))(_array$7.buffer, $min(_array$7.byteOffset + 16, _array$7.buffer.byteLength)); - sa$3 = new SockaddrInet4.ptr(0, arrayType$9.zero(), new RawSockaddrInet4.ptr(0, 0, arrayType$9.zero(), arrayType$1.zero())); - p = (((pp$3.$ptr_Port || (pp$3.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, pp$3))))); - sa$3.Port = ((((p.nilCheck, p[0]) >> 0)) << 8 >> 0) + (((p.nilCheck, p[1]) >> 0)) >> 0; - i$1 = 0; - while (true) { - if (!(i$1 < 4)) { break; } - (x$4 = sa$3.Addr, ((i$1 < 0 || i$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i$1] = (x$3 = pp$3.Addr, ((i$1 < 0 || i$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i$1])))); - i$1 = i$1 + (1) >> 0; - } - return [sa$3, $ifaceNil]; - } else if (_1 === (10)) { - _array$9 = new Uint8Array(112); - pp$4 = ((_array$8 = (_array$9), _struct$8 = new RawSockaddrInet6.ptr(0, 0, 0, arrayType$2.zero(), 0), _view$8 = new DataView(_array$8.buffer, _array$8.byteOffset), _struct$8.Family = _view$8.getUint16(0, true), _struct$8.Port = _view$8.getUint16(2, true), _struct$8.Flowinfo = _view$8.getUint32(4, true), _struct$8.Addr = new ($nativeArray($kindUint8))(_array$8.buffer, $min(_array$8.byteOffset + 8, _array$8.buffer.byteLength)), _struct$8.Scope_id = _view$8.getUint32(24, true), _struct$8)); - _struct$9 = rsa, _view$9 = new DataView(_array$9.buffer, _array$9.byteOffset), _struct$9.Addr.Family = _view$9.getUint16(0, true), _struct$9.Addr.Data = new ($nativeArray($kindInt8))(_array$9.buffer, $min(_array$9.byteOffset + 2, _array$9.buffer.byteLength)), _struct$9.Pad = new ($nativeArray($kindInt8))(_array$9.buffer, $min(_array$9.byteOffset + 16, _array$9.buffer.byteLength)); - sa$4 = new SockaddrInet6.ptr(0, 0, arrayType$2.zero(), new RawSockaddrInet6.ptr(0, 0, 0, arrayType$2.zero(), 0)); - p$1 = (((pp$4.$ptr_Port || (pp$4.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, pp$4))))); - sa$4.Port = ((((p$1.nilCheck, p$1[0]) >> 0)) << 8 >> 0) + (((p$1.nilCheck, p$1[1]) >> 0)) >> 0; - sa$4.ZoneId = pp$4.Scope_id; - i$2 = 0; - while (true) { - if (!(i$2 < 16)) { break; } - (x$6 = sa$4.Addr, ((i$2 < 0 || i$2 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i$2] = (x$5 = pp$4.Addr, ((i$2 < 0 || i$2 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i$2])))); - i$2 = i$2 + (1) >> 0; - } - return [sa$4, $ifaceNil]; - } - return [$ifaceNil, new Errno(97)]; - }; - Accept = function(fd) { - var _tuple, _tuple$1, err, fd, len, len$24ptr, nfd, rsa, sa; - nfd = 0; - sa = $ifaceNil; - err = $ifaceNil; - rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); - len = 112; - _tuple = accept(fd, rsa, (len$24ptr || (len$24ptr = new ptrType$18(function() { return len; }, function($v) { len = $v; })))); - nfd = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [nfd, sa, err]; - } - _tuple$1 = anyToSockaddr(rsa); - sa = _tuple$1[0]; - err = _tuple$1[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - Close(nfd); - nfd = 0; - } - return [nfd, sa, err]; - }; - $pkg.Accept = Accept; - Accept4 = function(fd, flags) { - var _tuple, _tuple$1, err, fd, flags, len, len$24ptr, nfd, rsa, sa; - nfd = 0; - sa = $ifaceNil; - err = $ifaceNil; - rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); - len = 112; - _tuple = accept4(fd, rsa, (len$24ptr || (len$24ptr = new ptrType$18(function() { return len; }, function($v) { len = $v; }))), flags); - nfd = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [nfd, sa, err]; - } - if (len > 112) { - $panic(new $String("RawSockaddrAny too small")); - } - _tuple$1 = anyToSockaddr(rsa); - sa = _tuple$1[0]; - err = _tuple$1[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - Close(nfd); - nfd = 0; - } - return [nfd, sa, err]; - }; - $pkg.Accept4 = Accept4; - SetsockoptIPMreqn = function(fd, level, opt, mreq) { - var _array, _struct, _view, err, fd, level, mreq, opt; - err = $ifaceNil; - _array = new Uint8Array(12); - err = setsockopt(fd, level, opt, (_array), 12); - _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Address = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 4, _array.buffer.byteLength)), _struct.Ifindex = _view.getInt32(8, true); - return err; - }; - $pkg.SetsockoptIPMreqn = SetsockoptIPMreqn; - Recvmsg = function(fd, p, oob, flags) { - var _array, _struct, _tuple, _tuple$1, _tuple$2, _view, dummy, dummy$24ptr, err, fd, flags, from, iov, msg, n, oob, oobn, p, recvflags, rsa, sockType; - n = 0; - oobn = 0; - recvflags = 0; - from = $ifaceNil; - err = $ifaceNil; - msg = new Msghdr.ptr(ptrType$2.nil, 0, arrayType$9.zero(), ptrType$19.nil, new $Uint64(0, 0), ptrType$2.nil, new $Uint64(0, 0), 0, arrayType$9.zero()); - rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); - _array = new Uint8Array(112); - msg.Name = ((_array)); - _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); - msg.Namelen = 112; - iov = new Iovec.ptr(ptrType$2.nil, new $Uint64(0, 0)); - if (p.$length > 0) { - iov.Base = $indexPtr(p.$array, p.$offset + 0, ptrType$2); - iov.SetLen(p.$length); - } - dummy = 0; - if (oob.$length > 0) { - if (p.$length === 0) { - sockType = 0; - _tuple = GetsockoptInt(fd, 1, 3); - sockType = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [n, oobn, recvflags, from, err]; - } - if (!((sockType === 2))) { - iov.Base = (dummy$24ptr || (dummy$24ptr = new ptrType$2(function() { return dummy; }, function($v) { dummy = $v; }))); - iov.SetLen(1); - } - } - msg.Control = $indexPtr(oob.$array, oob.$offset + 0, ptrType$2); - msg.SetControllen(oob.$length); - } - msg.Iov = iov; - msg.Iovlen = new $Uint64(0, 1); - _tuple$1 = recvmsg(fd, msg, flags); - n = _tuple$1[0]; - err = _tuple$1[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [n, oobn, recvflags, from, err]; - } - oobn = ((msg.Controllen.$low >> 0)); - recvflags = ((msg.Flags >> 0)); - if (!((rsa.Addr.Family === 0))) { - _tuple$2 = anyToSockaddr(rsa); - from = _tuple$2[0]; - err = _tuple$2[1]; - } - return [n, oobn, recvflags, from, err]; - }; - $pkg.Recvmsg = Recvmsg; - SendmsgN = function(fd, p, oob, to, flags) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, dummy, err, err$1, fd, flags, iov, msg, n, oob, p, ptr, salen, sockType, to, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; dummy = $f.dummy; err = $f.err; err$1 = $f.err$1; fd = $f.fd; flags = $f.flags; iov = $f.iov; msg = $f.msg; n = $f.n; oob = $f.oob; p = $f.p; ptr = $f.ptr; salen = $f.salen; sockType = $f.sockType; to = $f.to; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - dummy = [dummy]; - iov = [iov]; - msg = [msg]; - n = 0; - err = $ifaceNil; - ptr = 0; - salen = 0; - /* */ if (!($interfaceIsEqual(to, $ifaceNil))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!($interfaceIsEqual(to, $ifaceNil))) { */ case 1: - err$1 = $ifaceNil; - _r = to.sockaddr(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - ptr = _tuple[0]; - salen = _tuple[1]; - err$1 = _tuple[2]; - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - _tmp = 0; - _tmp$1 = err$1; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - } - /* } */ case 2: - msg[0] = new Msghdr.ptr(ptrType$2.nil, 0, arrayType$9.zero(), ptrType$19.nil, new $Uint64(0, 0), ptrType$2.nil, new $Uint64(0, 0), 0, arrayType$9.zero()); - msg[0].Name = (ptr); - msg[0].Namelen = ((salen >>> 0)); - iov[0] = new Iovec.ptr(ptrType$2.nil, new $Uint64(0, 0)); - if (p.$length > 0) { - iov[0].Base = $indexPtr(p.$array, p.$offset + 0, ptrType$2); - iov[0].SetLen(p.$length); - } - dummy[0] = 0; - if (oob.$length > 0) { - if (p.$length === 0) { - sockType = 0; - _tuple$1 = GetsockoptInt(fd, 1, 3); - sockType = _tuple$1[0]; - err = _tuple$1[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - _tmp$2 = 0; - _tmp$3 = err; - n = _tmp$2; - err = _tmp$3; - $s = -1; return [n, err]; - } - if (!((sockType === 2))) { - iov[0].Base = (dummy.$ptr || (dummy.$ptr = new ptrType$2(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dummy))); - iov[0].SetLen(1); - } - } - msg[0].Control = $indexPtr(oob.$array, oob.$offset + 0, ptrType$2); - msg[0].SetControllen(oob.$length); - } - msg[0].Iov = iov[0]; - msg[0].Iovlen = new $Uint64(0, 1); - _tuple$2 = sendmsg(fd, msg[0], flags); - n = _tuple$2[0]; - err = _tuple$2[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - _tmp$4 = 0; - _tmp$5 = err; - n = _tmp$4; - err = _tmp$5; - $s = -1; return [n, err]; - } - if (oob.$length > 0 && (p.$length === 0)) { - n = 0; - } - _tmp$6 = n; - _tmp$7 = $ifaceNil; - n = _tmp$6; - err = _tmp$7; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: SendmsgN }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.dummy = dummy; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.flags = flags; $f.iov = iov; $f.msg = msg; $f.n = n; $f.oob = oob; $f.p = p; $f.ptr = ptr; $f.salen = salen; $f.sockType = sockType; $f.to = to; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.SendmsgN = SendmsgN; - ReadDirent = function(fd, buf) { - var _tuple, buf, err, fd, n; - n = 0; - err = $ifaceNil; - _tuple = Getdents(fd, buf); - n = _tuple[0]; - err = _tuple[1]; - return [n, err]; - }; - $pkg.ReadDirent = ReadDirent; - direntIno = function(buf) { - var buf; - return readInt(buf, 0, 8); - }; - direntReclen = function(buf) { - var buf; - return readInt(buf, 16, 2); - }; - direntNamlen = function(buf) { - var _tuple, buf, ok, reclen; - _tuple = direntReclen(buf); - reclen = _tuple[0]; - ok = _tuple[1]; - if (!ok) { - return [new $Uint64(0, 0), false]; - } - return [new $Uint64(reclen.$high - 0, reclen.$low - 19), true]; - }; - Iovec.ptr.prototype.SetLen = function(length) { - var iov, length; - iov = this; - iov.Len = (new $Uint64(0, length)); - }; - Iovec.prototype.SetLen = function(length) { return this.$val.SetLen(length); }; - Msghdr.ptr.prototype.SetControllen = function(length) { - var length, msghdr; - msghdr = this; - msghdr.Controllen = (new $Uint64(0, length)); - }; - Msghdr.prototype.SetControllen = function(length) { return this.$val.SetControllen(length); }; - mmapper.ptr.prototype.Mmap = function(fd, offset, length, prot, flags) { - var _key, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, addr, b, data, err, errno, fd, flags, length, m, offset, p, prot, sl, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; addr = $f.addr; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; fd = $f.fd; flags = $f.flags; length = $f.length; m = $f.m; offset = $f.offset; p = $f.p; prot = $f.prot; sl = $f.sl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - sl = [sl]; - data = sliceType.nil; - err = $ifaceNil; - m = this; - if (length <= 0) { - _tmp = sliceType.nil; - _tmp$1 = new Errno(22); - data = _tmp; - err = _tmp$1; - $s = -1; return [data, err]; - } - _r = m.mmap(0, ((length >>> 0)), prot, flags, fd, offset); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - addr = _tuple[0]; - errno = _tuple[1]; - if (!($interfaceIsEqual(errno, $ifaceNil))) { - _tmp$2 = sliceType.nil; - _tmp$3 = errno; - data = _tmp$2; - err = _tmp$3; - $s = -1; return [data, err]; - } - sl[0] = new structType.ptr(addr, length, length); - b = sl[0]; - p = $indexPtr(b.$array, b.$offset + (b.$capacity - 1 >> 0), ptrType$2); - $r = m.Mutex.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); - _key = p; (m.active || $throwRuntimeError("assignment to entry in nil map"))[ptrType$2.keyFor(_key)] = { k: _key, v: b }; - _tmp$4 = b; - _tmp$5 = $ifaceNil; - data = _tmp$4; - err = _tmp$5; - $s = -1; return [data, err]; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [data, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Mmap }; } $f._key = _key; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.fd = fd; $f.flags = flags; $f.length = length; $f.m = m; $f.offset = offset; $f.p = p; $f.prot = prot; $f.sl = sl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - mmapper.prototype.Mmap = function(fd, offset, length, prot, flags) { return this.$val.Mmap(fd, offset, length, prot, flags); }; - mmapper.ptr.prototype.Munmap = function(data) { - var _entry, _r, b, data, err, errno, m, p, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r = $f._r; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; m = $f.m; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - err = $ifaceNil; - m = this; - if ((data.$length === 0) || !((data.$length === data.$capacity))) { - err = new Errno(22); - $s = -1; return err; - } - p = $indexPtr(data.$array, data.$offset + (data.$capacity - 1 >> 0), ptrType$2); - $r = m.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); - b = (_entry = m.active[ptrType$2.keyFor(p)], _entry !== undefined ? _entry.v : sliceType.nil); - if (b === sliceType.nil || !($indexPtr(b.$array, b.$offset + 0, ptrType$2) === $indexPtr(data.$array, data.$offset + 0, ptrType$2))) { - err = new Errno(22); - $s = -1; return err; - } - _r = m.munmap((($sliceToArray(b))), ((b.$length >>> 0))); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - errno = _r; - if (!($interfaceIsEqual(errno, $ifaceNil))) { - err = errno; - $s = -1; return err; - } - delete m.active[ptrType$2.keyFor(p)]; - err = $ifaceNil; - $s = -1; return err; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Munmap }; } $f._entry = _entry; $f._r = _r; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.m = m; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - mmapper.prototype.Munmap = function(data) { return this.$val.Munmap(data); }; - Errno.prototype.Error = function() { - var e, s; - e = this.$val; - if (0 <= ((e >> 0)) && ((e >> 0)) < 133) { - s = ((e < 0 || e >= errors.length) ? ($throwRuntimeError("index out of range"), undefined) : errors[e]); - if (!(s === "")) { - return s; - } - } - return "errno " + itoa(((e >> 0))); - }; - $ptrType(Errno).prototype.Error = function() { return new Errno(this.$get()).Error(); }; - Errno.prototype.Temporary = function() { - var e; - e = this.$val; - return (e === 4) || (e === 24) || new Errno(e).Timeout(); - }; - $ptrType(Errno).prototype.Temporary = function() { return new Errno(this.$get()).Temporary(); }; - Errno.prototype.Timeout = function() { - var e; - e = this.$val; - return (e === 11) || (e === 11) || (e === 110); - }; - $ptrType(Errno).prototype.Timeout = function() { return new Errno(this.$get()).Timeout(); }; errnoErr = function(e) { var _1, e; _1 = e; @@ -4392,717 +6664,648 @@ $packages["syscall"] = (function() { } return new Errno(e); }; - Read = function(fd, p) { - var _tuple, err, fd, n, p; - n = 0; - err = $ifaceNil; - _tuple = read(fd, p); - n = _tuple[0]; - err = _tuple[1]; - if (false) { - if (n > 0) { - race.WriteRange(($sliceToArray(p)), n); - } - if ($interfaceIsEqual(err, $ifaceNil)) { - race.Acquire(((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; }))))); + Errno.prototype.Error = function() { + var e, s; + e = this.$val; + if (0 <= ((e >> 0)) && ((e >> 0)) < 2054) { + s = ((e < 0 || e >= errorstr.length) ? ($throwRuntimeError("index out of range"), undefined) : errorstr[e]); + if (!(s === "")) { + return s; } } - if (false && n > 0) { - msanWrite(($sliceToArray(p)), n); - } - return [n, err]; + return "errno " + itoa.Itoa(((e >> 0))); }; - $pkg.Read = Read; - Write = function(fd, p) { - var _tuple, err, fd, n, p; - n = 0; + $ptrType(Errno).prototype.Error = function() { return new Errno(this.$get()).Error(); }; + Errno.prototype.Is = function(target) { + var _1, e, target; + e = this.$val; + _1 = target; + if ($interfaceIsEqual(_1, (oserror.ErrPermission))) { + return (e === 13) || (e === 1); + } else if ($interfaceIsEqual(_1, (oserror.ErrExist))) { + return (e === 17) || (e === 39); + } else if ($interfaceIsEqual(_1, (oserror.ErrNotExist))) { + return e === 2; + } + return false; + }; + $ptrType(Errno).prototype.Is = function(target) { return new Errno(this.$get()).Is(target); }; + Errno.prototype.Temporary = function() { + var e; + e = this.$val; + return (e === 4) || (e === 24) || new Errno(e).Timeout(); + }; + $ptrType(Errno).prototype.Temporary = function() { return new Errno(this.$get()).Temporary(); }; + Errno.prototype.Timeout = function() { + var e; + e = this.$val; + return (e === 11) || (e === 11) || (e === 110); + }; + $ptrType(Errno).prototype.Timeout = function() { return new Errno(this.$get()).Timeout(); }; + StopIO = function(fd) { + var fd; + return new Errno(38); + }; + $pkg.StopIO = StopIO; + Accept = function(fd) { + var _tmp, _tmp$1, _tmp$2, err, fd, newfd, sa; + newfd = 0; + sa = $ifaceNil; err = $ifaceNil; - if (false) { - race.ReleaseMerge(((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; }))))); - } - _tuple = write(fd, p); - n = _tuple[0]; - err = _tuple[1]; - if (false && n > 0) { - race.ReadRange(($sliceToArray(p)), n); - } - if (false && n > 0) { - msanRead(($sliceToArray(p)), n); - } - return [n, err]; + _tmp = 0; + _tmp$1 = $ifaceNil; + _tmp$2 = new Errno(38); + newfd = _tmp; + sa = _tmp$1; + err = _tmp$2; + return [newfd, sa, err]; }; - $pkg.Write = Write; - GetsockoptInt = function(fd, level, opt) { - var _tmp, _tmp$1, err, fd, level, n, n$24ptr, opt, vallen, vallen$24ptr, value; - value = 0; - err = $ifaceNil; - n = 0; - vallen = 4; - err = getsockopt(fd, level, opt, ((n$24ptr || (n$24ptr = new ptrType$4(function() { return n; }, function($v) { n = $v; })))), (vallen$24ptr || (vallen$24ptr = new ptrType$18(function() { return vallen; }, function($v) { vallen = $v; })))); - _tmp = ((n >> 0)); - _tmp$1 = err; - value = _tmp; - err = _tmp$1; - return [value, err]; - }; - $pkg.GetsockoptInt = GetsockoptInt; + $pkg.Accept = Accept; Recvfrom = function(fd, p, flags) { - var _tuple, _tuple$1, err, fd, flags, from, len, len$24ptr, n, p, rsa; + var _tmp, _tmp$1, _tmp$2, err, fd, flags, from, n, p; n = 0; from = $ifaceNil; err = $ifaceNil; - rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); - len = 112; - _tuple = recvfrom(fd, p, flags, rsa, (len$24ptr || (len$24ptr = new ptrType$18(function() { return len; }, function($v) { len = $v; })))); - n = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [n, from, err]; - } - if (!((rsa.Addr.Family === 0))) { - _tuple$1 = anyToSockaddr(rsa); - from = _tuple$1[0]; - err = _tuple$1[1]; - } + _tmp = 0; + _tmp$1 = $ifaceNil; + _tmp$2 = new Errno(38); + n = _tmp; + from = _tmp$1; + err = _tmp$2; return [n, from, err]; }; $pkg.Recvfrom = Recvfrom; Sendto = function(fd, p, flags, to) { - var _r, _tuple, err, fd, flags, n, p, ptr, to, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; flags = $f.flags; n = $f.n; p = $f.p; ptr = $f.ptr; to = $f.to; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - err = $ifaceNil; - _r = to.sockaddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - ptr = _tuple[0]; - n = _tuple[1]; - err = _tuple[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - err = err; - $s = -1; return err; - } - err = sendto(fd, p, flags, ptr, n); - $s = -1; return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: Sendto }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.flags = flags; $f.n = n; $f.p = p; $f.ptr = ptr; $f.to = to; $f.$s = $s; $f.$r = $r; return $f; + var fd, flags, p, to; + return new Errno(38); }; $pkg.Sendto = Sendto; - SetsockoptByte = function(fd, level, opt, value) { - var err, fd, level, opt, value, value$24ptr; + Recvmsg = function(fd, p, oob, flags) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, err, fd, flags, from, n, oob, oobn, p, recvflags; + n = 0; + oobn = 0; + recvflags = 0; + from = $ifaceNil; err = $ifaceNil; - err = setsockopt(fd, level, opt, ((value$24ptr || (value$24ptr = new ptrType$2(function() { return value; }, function($v) { value = $v; })))), 1); - return err; + _tmp = 0; + _tmp$1 = 0; + _tmp$2 = 0; + _tmp$3 = $ifaceNil; + _tmp$4 = new Errno(38); + n = _tmp; + oobn = _tmp$1; + recvflags = _tmp$2; + from = _tmp$3; + err = _tmp$4; + return [n, oobn, recvflags, from, err]; }; - $pkg.SetsockoptByte = SetsockoptByte; - SetsockoptInt = function(fd, level, opt, value) { - var err, fd, level, n, n$24ptr, opt, value; + $pkg.Recvmsg = Recvmsg; + SendmsgN = function(fd, p, oob, to, flags) { + var _tmp, _tmp$1, err, fd, flags, n, oob, p, to; + n = 0; err = $ifaceNil; - n = ((value >> 0)); - err = setsockopt(fd, level, opt, ((n$24ptr || (n$24ptr = new ptrType$4(function() { return n; }, function($v) { n = $v; })))), 4); - return err; + _tmp = 0; + _tmp$1 = new Errno(38); + n = _tmp; + err = _tmp$1; + return [n, err]; }; - $pkg.SetsockoptInt = SetsockoptInt; - SetsockoptInet4Addr = function(fd, level, opt, value) { - var err, fd, level, opt, value; - err = $ifaceNil; - err = setsockopt(fd, level, opt, ($sliceToArray(new sliceType(value))), 4); - return err; + $pkg.SendmsgN = SendmsgN; + SetReadDeadline = function(fd, t) { + var fd, t; + return new Errno(38); }; - $pkg.SetsockoptInet4Addr = SetsockoptInet4Addr; - SetsockoptIPMreq = function(fd, level, opt, mreq) { - var _array, _struct, _view, err, fd, level, mreq, opt; - err = $ifaceNil; - _array = new Uint8Array(8); - err = setsockopt(fd, level, opt, (_array), 8); - _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Interface = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 4, _array.buffer.byteLength)); - return err; + $pkg.SetReadDeadline = SetReadDeadline; + SetWriteDeadline = function(fd, t) { + var fd, t; + return new Errno(38); }; - $pkg.SetsockoptIPMreq = SetsockoptIPMreq; - SetsockoptIPv6Mreq = function(fd, level, opt, mreq) { - var _array, _struct, _view, err, fd, level, mreq, opt; - err = $ifaceNil; - _array = new Uint8Array(20); - err = setsockopt(fd, level, opt, (_array), 20); - _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Interface = _view.getUint32(16, true); - return err; + $pkg.SetWriteDeadline = SetWriteDeadline; + Shutdown = function(fd, how) { + var fd, how; + return new Errno(38); }; - $pkg.SetsockoptIPv6Mreq = SetsockoptIPv6Mreq; - SetsockoptLinger = function(fd, level, opt, l) { - var _array, _struct, _view, err, fd, l, level, opt; - err = $ifaceNil; - _array = new Uint8Array(8); - err = setsockopt(fd, level, opt, (_array), 8); - _struct = l, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Onoff = _view.getInt32(0, true), _struct.Linger = _view.getInt32(4, true); - return err; + $pkg.Shutdown = Shutdown; + SetNonblock = function(fd, nonblocking) { + var fd, nonblocking; + return $ifaceNil; }; - $pkg.SetsockoptLinger = SetsockoptLinger; - Close = function(fd) { - var _tuple, e1, err, fd; - err = $ifaceNil; - _tuple = Syscall(3, ((fd >>> 0)), 0, 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); + $pkg.SetNonblock = SetNonblock; + runtime_envs = function() { + var {_r$1, envkeys, envs$1, i, jsEnv, key, process, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + process = $clone($clone(js.Global(), js.Value).Get("process"), js.Value); + if ($clone(process, js.Value).IsUndefined()) { + $s = -1; return sliceType.nil; } - return err; + jsEnv = $clone($clone(process, js.Value).Get("env"), js.Value); + _r$1 = $clone($clone(js.Global(), js.Value).Get("Object"), js.Value).Call("keys", new sliceType$2([new jsEnv.constructor.elem(jsEnv)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + envkeys = $clone(_r$1, js.Value); + envs$1 = $makeSlice(sliceType, $clone(envkeys, js.Value).Length()); + i = 0; + while (true) { + if (!(i < $clone(envkeys, js.Value).Length())) { break; } + key = $clone($clone(envkeys, js.Value).Index(i), js.Value).String(); + ((i < 0 || i >= envs$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : envs$1.$array[envs$1.$offset + i] = key + "=" + $clone($clone(jsEnv, js.Value).Get(key), js.Value).String()); + i = i + (1) >> 0; + } + $s = -1; return envs$1; + /* */ } return; } var $f = {$blk: runtime_envs, $c: true, $r, _r$1, envkeys, envs$1, i, jsEnv, key, process, $s};return $f; + }; + setStat = function(st, jsSt) { + var atime, ctime, jsSt, mtime, st; + st.Dev = (new $Int64(0, $clone($clone(jsSt, js.Value).Get("dev"), js.Value).Int())); + st.Ino = (new $Uint64(0, $clone($clone(jsSt, js.Value).Get("ino"), js.Value).Int())); + st.Mode = (($clone($clone(jsSt, js.Value).Get("mode"), js.Value).Int() >>> 0)); + st.Nlink = (($clone($clone(jsSt, js.Value).Get("nlink"), js.Value).Int() >>> 0)); + st.Uid = (($clone($clone(jsSt, js.Value).Get("uid"), js.Value).Int() >>> 0)); + st.Gid = (($clone($clone(jsSt, js.Value).Get("gid"), js.Value).Int() >>> 0)); + st.Rdev = (new $Int64(0, $clone($clone(jsSt, js.Value).Get("rdev"), js.Value).Int())); + st.Size = (new $Int64(0, $clone($clone(jsSt, js.Value).Get("size"), js.Value).Int())); + st.Blksize = (($clone($clone(jsSt, js.Value).Get("blksize"), js.Value).Int() >> 0)); + st.Blocks = (($clone($clone(jsSt, js.Value).Get("blocks"), js.Value).Int() >> 0)); + atime = (new $Int64(0, $clone($clone(jsSt, js.Value).Get("atimeMs"), js.Value).Float())); + st.Atime = $div64(atime, new $Int64(0, 1000), false); + st.AtimeNsec = $mul64(($div64(atime, new $Int64(0, 1000), true)), new $Int64(0, 1000000)); + mtime = (new $Int64(0, $clone($clone(jsSt, js.Value).Get("mtimeMs"), js.Value).Float())); + st.Mtime = $div64(mtime, new $Int64(0, 1000), false); + st.MtimeNsec = $mul64(($div64(mtime, new $Int64(0, 1000), true)), new $Int64(0, 1000000)); + ctime = (new $Int64(0, $clone($clone(jsSt, js.Value).Get("ctimeMs"), js.Value).Float())); + st.Ctime = $div64(ctime, new $Int64(0, 1000), false); + st.CtimeNsec = $mul64(($div64(ctime, new $Int64(0, 1000), true)), new $Int64(0, 1000000)); + }; + fsCall = function(name, args) { + var {$24r, $24r$1, _r$1, _r$2, args, c, f, name, res, $s, $deferred, $r, $c} = $restore(this, {name, args}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + c = [c]; + c[0] = new $Chan(callResult, 1); + f = $clone(js.FuncOf((function(c) { return function $b(this$1, args$1) { + var {args$1, jsErr, res, this$1, $s, $r, $c} = $restore(this, {this$1, args$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + res = new callResult.ptr(new js.Value.ptr(null, false, arrayType$2.zero()), $ifaceNil); + if (args$1.$length >= 1) { + jsErr = $clone((0 >= args$1.$length ? ($throwRuntimeError("index out of range"), undefined) : args$1.$array[args$1.$offset + 0]), js.Value); + if (!$clone(jsErr, js.Value).IsUndefined() && !$clone(jsErr, js.Value).IsNull()) { + res.err = mapJSError($clone(jsErr, js.Value)); + } + } + js.Value.copy(res.val, js.Undefined()); + if (args$1.$length >= 2) { + js.Value.copy(res.val, (1 >= args$1.$length ? ($throwRuntimeError("index out of range"), undefined) : args$1.$array[args$1.$offset + 1])); + } + $r = $send(c[0], $clone($clone(res, callResult), callResult)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, args$1, jsErr, res, this$1, $s};return $f; + }; })(c)), js.Func); + $deferred.push([$methodVal($clone(f, js.Func), "Release"), []]); + /* */ if ($clone($clone(jsFS, js.Value).Get(name), js.Value).IsUndefined()) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ($clone($clone(jsFS, js.Value).Get(name), js.Value).IsUndefined()) { */ case 1: + $24r = [js.Undefined(), new Errno(38)]; + $s = 3; case 3: return $24r; + /* } */ case 2: + _r$1 = $clone(jsFS, js.Value).Call(name, $append(args, new f.constructor.elem(f))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + _r$2 = $recv(c[0]); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + res = $clone(_r$2[0], callResult); + $24r$1 = [res.val, res.err]; + $s = 6; case 6: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [new js.Value.ptr(null, false, arrayType$2.zero()), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: fsCall, $c: true, $r, $24r, $24r$1, _r$1, _r$2, args, c, f, name, res, $s, $deferred};return $f; } } + }; + fdToFile = function(fd) { + var {_entry, _tuple, f, fd, ok, $s, $r, $c} = $restore(this, {fd}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = filesMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _tuple = (_entry = $mapIndex(files,$Int.keyFor(fd)), _entry !== undefined ? [_entry.v, true] : [ptrType$2.nil, false]); + f = _tuple[0]; + ok = _tuple[1]; + $r = filesMu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (!ok) { + $s = -1; return [ptrType$2.nil, new Errno(9)]; + } + $s = -1; return [f, $ifaceNil]; + /* */ } return; } var $f = {$blk: fdToFile, $c: true, $r, _entry, _tuple, f, fd, ok, $s};return $f; + }; + Close = function(fd) { + var {_r$1, _tuple, err, fd, $s, $r, $c} = $restore(this, {fd}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = filesMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $mapDelete(files, $Int.keyFor(fd)); + $r = filesMu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$1 = fsCall("close", new sliceType$2([new $Int(fd)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + err = _tuple[1]; + $s = -1; return err; + /* */ } return; } var $f = {$blk: Close, $c: true, $r, _r$1, _tuple, err, fd, $s};return $f; }; $pkg.Close = Close; - Dup = function(oldfd) { - var _tuple, e1, err, fd, oldfd, r0; - fd = 0; - err = $ifaceNil; - _tuple = Syscall(32, ((oldfd >>> 0)), 0, 0); - r0 = _tuple[0]; - e1 = _tuple[2]; - fd = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [fd, err]; + CloseOnExec = function(fd) { + var fd; }; - $pkg.Dup = Dup; - Fchdir = function(fd) { - var _tuple, e1, err, fd; - err = $ifaceNil; - _tuple = Syscall(81, ((fd >>> 0)), 0, 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fchdir = Fchdir; - Fchmod = function(fd, mode) { - var _tuple, e1, err, fd, mode; - err = $ifaceNil; - _tuple = Syscall(91, ((fd >>> 0)), ((mode >>> 0)), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fchmod = Fchmod; - fcntl = function(fd, cmd, arg) { - var _tuple, arg, cmd, e1, err, fd, r0, val; - val = 0; - err = $ifaceNil; - _tuple = Syscall(72, ((fd >>> 0)), ((cmd >>> 0)), ((arg >>> 0))); - r0 = _tuple[0]; - e1 = _tuple[2]; - val = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [val, err]; - }; - Fsync = function(fd) { - var _tuple, e1, err, fd; - err = $ifaceNil; - _tuple = Syscall(74, ((fd >>> 0)), 0, 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fsync = Fsync; - Getdents = function(fd, buf) { - var _p0, _tuple, buf, e1, err, fd, n, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (buf.$length > 0) { - _p0 = ($sliceToArray(buf)); - } else { - _p0 = (new Uint8Array(0)); - } - _tuple = Syscall(217, ((fd >>> 0)), (_p0), ((buf.$length >>> 0))); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - $pkg.Getdents = Getdents; - read = function(fd, p) { - var _p0, _tuple, e1, err, fd, n, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = ($sliceToArray(p)); - } else { - _p0 = (new Uint8Array(0)); - } - _tuple = Syscall(0, ((fd >>> 0)), (_p0), ((p.$length >>> 0))); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - write = function(fd, p) { - var _p0, _tuple, e1, err, fd, n, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = ($sliceToArray(p)); - } else { - _p0 = (new Uint8Array(0)); - } - _tuple = Syscall(1, ((fd >>> 0)), (_p0), ((p.$length >>> 0))); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - munmap = function(addr, length) { - var _tuple, addr, e1, err, length; - err = $ifaceNil; - _tuple = Syscall(11, (addr), (length), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - Fchown = function(fd, uid, gid) { - var _tuple, e1, err, fd, gid, uid; - err = $ifaceNil; - _tuple = Syscall(93, ((fd >>> 0)), ((uid >>> 0)), ((gid >>> 0))); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fchown = Fchown; - Fstat = function(fd, stat) { - var _array, _struct, _tuple, _view, e1, err, fd, stat; - err = $ifaceNil; - _array = new Uint8Array(144); - _tuple = Syscall(5, ((fd >>> 0)), ((_array)), 0); - _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fstat = Fstat; - Ftruncate = function(fd, length) { - var _tuple, e1, err, fd, length; - err = $ifaceNil; - _tuple = Syscall(77, ((fd >>> 0)), ((length.$low >>> 0)), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Ftruncate = Ftruncate; - Lstat = function(path, stat) { - var _array, _p0, _struct, _tuple, _tuple$1, _view, e1, err, path, stat; - err = $ifaceNil; - _p0 = ptrType$2.nil; - _tuple = BytePtrFromString(path); - _p0 = _tuple[0]; + $pkg.CloseOnExec = CloseOnExec; + ReadDirent = function(fd, buf) { + var {_r$1, _tuple, buf, entry, err, f, fd, l, n, x, x$1, $s, $r, $c} = $restore(this, {fd, buf}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fdToFile(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + f = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { - return err; + $s = -1; return [0, err]; } - _array = new Uint8Array(144); - _tuple$1 = Syscall(6, ((_p0)), ((_array)), 0); - _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); - e1 = _tuple$1[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); + if (f.entries === sliceType.nil) { + $s = -1; return [0, new Errno(22)]; } - return err; + n = 0; + while (true) { + if (!(f.dirIdx < f.entries.$length)) { break; } + entry = (x = f.entries, x$1 = f.dirIdx, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); + l = 2 + entry.length >> 0; + if (l > buf.$length) { + break; + } + (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0] = ((l << 24 >>> 24))); + (1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1] = (((l >> 8 >> 0) << 24 >>> 24))); + $copyString($subslice(buf, 2), entry); + buf = $subslice(buf, l); + n = n + (l) >> 0; + f.dirIdx = f.dirIdx + (1) >> 0; + } + $s = -1; return [n, $ifaceNil]; + /* */ } return; } var $f = {$blk: ReadDirent, $c: true, $r, _r$1, _tuple, buf, entry, err, f, fd, l, n, x, x$1, $s};return $f; + }; + $pkg.ReadDirent = ReadDirent; + Lstat = function(path, st) { + var {_r$1, _tuple, err, err$1, jsSt, path, st, $s, $r, $c} = $restore(this, {path, st}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + err = checkPath(path); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$1 = fsCall("lstat", new sliceType$2([new $String(path)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + jsSt = $clone(_tuple[0], js.Value); + err$1 = _tuple[1]; + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + $s = -1; return err$1; + } + setStat(st, $clone(jsSt, js.Value)); + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: Lstat, $c: true, $r, _r$1, _tuple, err, err$1, jsSt, path, st, $s};return $f; }; $pkg.Lstat = Lstat; - Pread = function(fd, p, offset) { - var _p0, _tuple, e1, err, fd, n, offset, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = ($sliceToArray(p)); - } else { - _p0 = (new Uint8Array(0)); + Fstat = function(fd, st) { + var {_r$1, _tuple, err, fd, jsSt, st, $s, $r, $c} = $restore(this, {fd, st}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fsCall("fstat", new sliceType$2([new $Int(fd)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + jsSt = $clone(_tuple[0], js.Value); + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; } - _tuple = Syscall6(17, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((offset.$low >>> 0)), 0, 0); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); + setStat(st, $clone(jsSt, js.Value)); + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: Fstat, $c: true, $r, _r$1, _tuple, err, fd, jsSt, st, $s};return $f; + }; + $pkg.Fstat = Fstat; + Fchmod = function(fd, mode) { + var {_r$1, _tuple, err, fd, mode, $s, $r, $c} = $restore(this, {fd, mode}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fsCall("fchmod", new sliceType$2([new $Int(fd), new $Uint32(mode)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + err = _tuple[1]; + $s = -1; return err; + /* */ } return; } var $f = {$blk: Fchmod, $c: true, $r, _r$1, _tuple, err, fd, mode, $s};return $f; + }; + $pkg.Fchmod = Fchmod; + Fchown = function(fd, uid, gid) { + var {_r$1, _tuple, err, fd, gid, uid, $s, $r, $c} = $restore(this, {fd, uid, gid}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fsCall("fchown", new sliceType$2([new $Int(fd), new $Uint32(((uid >>> 0))), new $Uint32(((gid >>> 0)))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + err = _tuple[1]; + $s = -1; return err; + /* */ } return; } var $f = {$blk: Fchown, $c: true, $r, _r$1, _tuple, err, fd, gid, uid, $s};return $f; + }; + $pkg.Fchown = Fchown; + Ftruncate = function(fd, length) { + var {_r$1, _tuple, err, fd, length, $s, $r, $c} = $restore(this, {fd, length}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fsCall("ftruncate", new sliceType$2([new $Int(fd), length])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + err = _tuple[1]; + $s = -1; return err; + /* */ } return; } var $f = {$blk: Ftruncate, $c: true, $r, _r$1, _tuple, err, fd, length, $s};return $f; + }; + $pkg.Ftruncate = Ftruncate; + Chdir = function(path) { + var {$24r, $24r$1, _r$1, err, err$1, path, $s, $deferred, $r, $c} = $restore(this, {path}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + err = [err]; + err[0] = $ifaceNil; + err$1 = checkPath(path); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 1: + err[0] = err$1; + $24r = err[0]; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([recoverErr, [(err.$ptr || (err.$ptr = new ptrType(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, err)))]]); + _r$1 = $clone(jsProcess, js.Value).Call("chdir", new sliceType$2([new $String(path)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + $24r$1 = err[0]; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err[0]; } if($curGoroutine.asleep) { var $f = {$blk: Chdir, $c: true, $r, $24r, $24r$1, _r$1, err, err$1, path, $s, $deferred};return $f; } } + }; + $pkg.Chdir = Chdir; + Fchdir = function(fd) { + var {$24r, _r$1, _r$2, _tuple, err, f, fd, $s, $r, $c} = $restore(this, {fd}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fdToFile(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + f = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; } - return [n, err]; + _r$2 = Chdir(f.path); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Fchdir, $c: true, $r, $24r, _r$1, _r$2, _tuple, err, f, fd, $s};return $f; + }; + $pkg.Fchdir = Fchdir; + Fsync = function(fd) { + var {_r$1, _tuple, err, fd, $s, $r, $c} = $restore(this, {fd}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fsCall("fsync", new sliceType$2([new $Int(fd)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + err = _tuple[1]; + $s = -1; return err; + /* */ } return; } var $f = {$blk: Fsync, $c: true, $r, _r$1, _tuple, err, fd, $s};return $f; + }; + $pkg.Fsync = Fsync; + Read = function(fd, b) { + var {_r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, b, buf, err, err$1, f, fd, n, n$1, n2, x, x$1, x$2, x$3, $s, $r, $c} = $restore(this, {fd, b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fdToFile(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + f = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [0, err]; + } + /* */ if (f.seeked) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (f.seeked) { */ case 2: + _r$2 = Pread(fd, b, f.pos); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + n = _tuple$1[0]; + err$1 = _tuple$1[1]; + f.pos = (x = f.pos, x$1 = (new $Int64(0, n)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); + $s = -1; return [n, err$1]; + /* } */ case 3: + _r$3 = $clone(uint8Array, js.Value).New(new sliceType$2([new $Int(b.$length)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + buf = $clone(_r$3, js.Value); + _r$4 = fsCall("read", new sliceType$2([new $Int(fd), new buf.constructor.elem(buf), new $Int(0), new $Int(b.$length), $ifaceNil])); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _tuple$2 = _r$4; + n$1 = $clone(_tuple$2[0], js.Value); + err = _tuple$2[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [0, err]; + } + js.CopyBytesToGo(b, $clone(buf, js.Value)); + n2 = $clone(n$1, js.Value).Int(); + f.pos = (x$2 = f.pos, x$3 = (new $Int64(0, n2)), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); + $s = -1; return [n2, err]; + /* */ } return; } var $f = {$blk: Read, $c: true, $r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, b, buf, err, err$1, f, fd, n, n$1, n2, x, x$1, x$2, x$3, $s};return $f; + }; + $pkg.Read = Read; + Write = function(fd, b) { + var {_r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, b, buf, err, err$1, f, fd, n, n$1, n$2, n2, x, x$1, x$2, x$3, $s, $r, $c} = $restore(this, {fd, b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = fdToFile(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + f = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [0, err]; + } + /* */ if (f.seeked) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (f.seeked) { */ case 2: + _r$2 = Pwrite(fd, b, f.pos); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + n = _tuple$1[0]; + err$1 = _tuple$1[1]; + f.pos = (x = f.pos, x$1 = (new $Int64(0, n)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); + $s = -1; return [n, err$1]; + /* } */ case 3: + if (false && ((fd === 1) || (fd === 2))) { + n$1 = faketimeWrite(fd, b); + if (n$1 < 0) { + $s = -1; return [0, errnoErr(((-n$1 >>> 0)))]; + } + $s = -1; return [n$1, $ifaceNil]; + } + _r$3 = $clone(uint8Array, js.Value).New(new sliceType$2([new $Int(b.$length)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + buf = $clone(_r$3, js.Value); + js.CopyBytesToJS($clone(buf, js.Value), b); + _r$4 = fsCall("write", new sliceType$2([new $Int(fd), new buf.constructor.elem(buf), new $Int(0), new $Int(b.$length), $ifaceNil])); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _tuple$2 = _r$4; + n$2 = $clone(_tuple$2[0], js.Value); + err = _tuple$2[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [0, err]; + } + n2 = $clone(n$2, js.Value).Int(); + f.pos = (x$2 = f.pos, x$3 = (new $Int64(0, n2)), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); + $s = -1; return [n2, err]; + /* */ } return; } var $f = {$blk: Write, $c: true, $r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, b, buf, err, err$1, f, fd, n, n$1, n$2, n2, x, x$1, x$2, x$3, $s};return $f; + }; + $pkg.Write = Write; + Pread = function(fd, b, offset) { + var {_r$1, _r$2, _tuple, b, buf, err, fd, n, offset, $s, $r, $c} = $restore(this, {fd, b, offset}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = $clone(uint8Array, js.Value).New(new sliceType$2([new $Int(b.$length)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + buf = $clone(_r$1, js.Value); + _r$2 = fsCall("read", new sliceType$2([new $Int(fd), new buf.constructor.elem(buf), new $Int(0), new $Int(b.$length), offset])); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; + n = $clone(_tuple[0], js.Value); + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [0, err]; + } + js.CopyBytesToGo(b, $clone(buf, js.Value)); + $s = -1; return [$clone(n, js.Value).Int(), $ifaceNil]; + /* */ } return; } var $f = {$blk: Pread, $c: true, $r, _r$1, _r$2, _tuple, b, buf, err, fd, n, offset, $s};return $f; }; $pkg.Pread = Pread; - Pwrite = function(fd, p, offset) { - var _p0, _tuple, e1, err, fd, n, offset, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = ($sliceToArray(p)); - } else { - _p0 = (new Uint8Array(0)); + Pwrite = function(fd, b, offset) { + var {_r$1, _r$2, _tuple, b, buf, err, fd, n, offset, $s, $r, $c} = $restore(this, {fd, b, offset}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = $clone(uint8Array, js.Value).New(new sliceType$2([new $Int(b.$length)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + buf = $clone(_r$1, js.Value); + js.CopyBytesToJS($clone(buf, js.Value), b); + _r$2 = fsCall("write", new sliceType$2([new $Int(fd), new buf.constructor.elem(buf), new $Int(0), new $Int(b.$length), offset])); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; + n = $clone(_tuple[0], js.Value); + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [0, err]; } - _tuple = Syscall6(18, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((offset.$low >>> 0)), 0, 0); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; + $s = -1; return [$clone(n, js.Value).Int(), $ifaceNil]; + /* */ } return; } var $f = {$blk: Pwrite, $c: true, $r, _r$1, _r$2, _tuple, b, buf, err, fd, n, offset, $s};return $f; }; $pkg.Pwrite = Pwrite; Seek = function(fd, offset, whence) { - var _tuple, e1, err, fd, off, offset, r0, whence; - off = new $Int64(0, 0); - err = $ifaceNil; - _tuple = Syscall(8, ((fd >>> 0)), ((offset.$low >>> 0)), ((whence >>> 0))); - r0 = _tuple[0]; - e1 = _tuple[2]; - off = (new $Int64(0, r0.constructor === Number ? r0 : 1)); - if (!((e1 === 0))) { - err = errnoErr(e1); + var {_1, _r$1, _r$2, _tuple, err, err$1, f, fd, newPos, offset, st, whence, x, x$1, $s, $r, $c} = $restore(this, {fd, offset, whence}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + st = [st]; + _r$1 = fdToFile(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + f = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [new $Int64(0, 0), err]; } - return [off, err]; + newPos = new $Int64(0, 0); + _1 = whence; + /* */ if (_1 === (0)) { $s = 3; continue; } + /* */ if (_1 === (1)) { $s = 4; continue; } + /* */ if (_1 === (2)) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_1 === (0)) { */ case 3: + newPos = offset; + $s = 7; continue; + /* } else if (_1 === (1)) { */ case 4: + newPos = (x = f.pos, new $Int64(x.$high + offset.$high, x.$low + offset.$low)); + $s = 7; continue; + /* } else if (_1 === (2)) { */ case 5: + st[0] = new Stat_t.ptr(new $Int64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Int64(0, 0), new $Int64(0, 0), 0, 0, new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0)); + _r$2 = Fstat(fd, st[0]); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + err$1 = _r$2; + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + $s = -1; return [new $Int64(0, 0), err$1]; + } + newPos = (x$1 = st[0].Size, new $Int64(x$1.$high + offset.$high, x$1.$low + offset.$low)); + $s = 7; continue; + /* } else { */ case 6: + $s = -1; return [new $Int64(0, 0), errnoErr(22)]; + /* } */ case 7: + case 2: + if ((newPos.$high < 0 || (newPos.$high === 0 && newPos.$low < 0))) { + $s = -1; return [new $Int64(0, 0), errnoErr(22)]; + } + f.seeked = true; + f.dirIdx = 0; + f.pos = newPos; + $s = -1; return [newPos, $ifaceNil]; + /* */ } return; } var $f = {$blk: Seek, $c: true, $r, _1, _r$1, _r$2, _tuple, err, err$1, f, fd, newPos, offset, st, whence, x, x$1, $s};return $f; }; $pkg.Seek = Seek; - Shutdown = function(fd, how) { - var _tuple, e1, err, fd, how; - err = $ifaceNil; - _tuple = Syscall(48, ((fd >>> 0)), ((how >>> 0)), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; + Dup = function(fd) { + var fd; + return [0, new Errno(38)]; }; - $pkg.Shutdown = Shutdown; - accept = function(s, rsa, addrlen) { - var _array, _struct, _tuple, _view, addrlen, e1, err, fd, r0, rsa, s; - fd = 0; - err = $ifaceNil; - _array = new Uint8Array(112); - _tuple = Syscall(43, ((s >>> 0)), ((_array)), ((addrlen))); - _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); - r0 = _tuple[0]; - e1 = _tuple[2]; - fd = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); + $pkg.Dup = Dup; + checkPath = function(path) { + var i, path; + if (path === "") { + return new Errno(22); } - return [fd, err]; + i = 0; + while (true) { + if (!(i < path.length)) { break; } + if (path.charCodeAt(i) === 0) { + return new Errno(22); + } + i = i + (1) >> 0; + } + return $ifaceNil; }; - accept4 = function(s, rsa, addrlen, flags) { - var _array, _struct, _tuple, _view, addrlen, e1, err, fd, flags, r0, rsa, s; - fd = 0; - err = $ifaceNil; - _array = new Uint8Array(112); - _tuple = Syscall6(288, ((s >>> 0)), ((_array)), ((addrlen)), ((flags >>> 0)), 0, 0); - _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); - r0 = _tuple[0]; - e1 = _tuple[2]; - fd = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); + recoverErr = function(errPtr) { + var _tuple, err, errPtr, jsErr, ok; + err = $recover(); + if (!($interfaceIsEqual(err, $ifaceNil))) { + _tuple = $assertType(err, js.Error, true); + jsErr = $clone(_tuple[0], js.Error); + ok = _tuple[1]; + if (!ok) { + $panic(err); + } + errPtr.$set(mapJSError($clone(jsErr.Value, js.Value))); } - return [fd, err]; }; - getsockopt = function(s, level, name, val, vallen) { - var _tuple, e1, err, level, name, s, val, vallen; - err = $ifaceNil; - _tuple = Syscall6(55, ((s >>> 0)), ((level >>> 0)), ((name >>> 0)), (val), ((vallen)), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); + mapJSError = function(jsErr) { + var _entry, _tuple, errno, jsErr, ok; + _tuple = (_entry = $mapIndex(errnoByCode,$String.keyFor($clone($clone(jsErr, js.Value).Get("code"), js.Value).String())), _entry !== undefined ? [_entry.v, true] : [0, false]); + errno = _tuple[0]; + ok = _tuple[1]; + if (!ok) { + $panic(new jsErr.constructor.elem(jsErr)); } - return err; + return errnoErr((errno)); }; - setsockopt = function(s, level, name, val, vallen) { - var _tuple, e1, err, level, name, s, val, vallen; - err = $ifaceNil; - _tuple = Syscall6(54, ((s >>> 0)), ((level >>> 0)), ((name >>> 0)), (val), (vallen), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - recvfrom = function(fd, p, flags, from, fromlen) { - var _array, _p0, _struct, _tuple, _view, e1, err, fd, flags, from, fromlen, n, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = ($sliceToArray(p)); - } else { - _p0 = (new Uint8Array(0)); - } - _array = new Uint8Array(112); - _tuple = Syscall6(45, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((flags >>> 0)), ((_array)), ((fromlen))); - _struct = from, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - sendto = function(s, buf, flags, to, addrlen) { - var _p0, _tuple, addrlen, buf, e1, err, flags, s, to; - err = $ifaceNil; - _p0 = 0; - if (buf.$length > 0) { - _p0 = ($sliceToArray(buf)); - } else { - _p0 = (new Uint8Array(0)); - } - _tuple = Syscall6(44, ((s >>> 0)), (_p0), ((buf.$length >>> 0)), ((flags >>> 0)), (to), ((addrlen >>> 0))); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - recvmsg = function(s, msg, flags) { - var _array, _struct, _tuple, _view, e1, err, flags, msg, n, r0, s; - n = 0; - err = $ifaceNil; - _array = new Uint8Array(48); - _tuple = Syscall(47, ((s >>> 0)), ((_array)), ((flags >>> 0))); - _struct = msg, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Namelen = _view.getUint32(4, true), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 8, _array.buffer.byteLength)), _struct.Iovlen = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Controllen = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.Flags = _view.getInt32(40, true), _struct.Pad_cgo_1 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 44, _array.buffer.byteLength)); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - sendmsg = function(s, msg, flags) { - var _array, _struct, _tuple, _view, e1, err, flags, msg, n, r0, s; - n = 0; - err = $ifaceNil; - _array = new Uint8Array(48); - _tuple = Syscall(46, ((s >>> 0)), ((_array)), ((flags >>> 0))); - _struct = msg, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Namelen = _view.getUint32(4, true), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 8, _array.buffer.byteLength)), _struct.Iovlen = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Controllen = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.Flags = _view.getInt32(40, true), _struct.Pad_cgo_1 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 44, _array.buffer.byteLength)); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = ((r0 >> 0)); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - mmap = function(addr, length, prot, flags, fd, offset) { - var _tuple, addr, e1, err, fd, flags, length, offset, prot, r0, xaddr; - xaddr = 0; - err = $ifaceNil; - _tuple = Syscall6(9, (addr), (length), ((prot >>> 0)), ((flags >>> 0)), ((fd >>> 0)), ((offset.$low >>> 0))); - r0 = _tuple[0]; - e1 = _tuple[2]; - xaddr = (r0); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [xaddr, err]; - }; - ptrType$24.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; - ptrType$11.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; - ptrType$25.methods = [{prop: "Mmap", name: "Mmap", pkg: "", typ: $funcType([$Int, $Int64, $Int, $Int, $Int], [sliceType, $error], false)}, {prop: "Munmap", name: "Munmap", pkg: "", typ: $funcType([sliceType], [$error], false)}]; - Errno.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; - ptrType$26.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; - ptrType$27.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; - ptrType$28.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; - ptrType$29.methods = [{prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64, $Int64], false)}, {prop: "Nano", name: "Nano", pkg: "", typ: $funcType([], [$Int64], false)}]; - ptrType$19.methods = [{prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}]; - ptrType$31.methods = [{prop: "SetControllen", name: "SetControllen", pkg: "", typ: $funcType([$Int], [], false)}]; - SockaddrLinklayer.init("syscall", [{prop: "Protocol", name: "Protocol", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Hatype", name: "Hatype", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pkttype", name: "Pkttype", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Halen", name: "Halen", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$1, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrLinklayer, tag: ""}]); - SockaddrNetlink.init("syscall", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Groups", name: "Groups", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrNetlink, tag: ""}]); - mmapper.init("syscall", [{prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: sync.Mutex, tag: ""}, {prop: "active", name: "active", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "mmap", name: "mmap", embedded: false, exported: false, typ: funcType$2, tag: ""}, {prop: "munmap", name: "munmap", embedded: false, exported: false, typ: funcType$3, tag: ""}]); - Sockaddr.init([{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]); - SockaddrInet4.init("syscall", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrInet4, tag: ""}]); - SockaddrInet6.init("syscall", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ZoneId", name: "ZoneId", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$2, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrInet6, tag: ""}]); - SockaddrUnix.init("syscall", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrUnix, tag: ""}]); - Timespec.init("", [{prop: "Sec", name: "Sec", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Nsec", name: "Nsec", embedded: false, exported: true, typ: $Int64, tag: ""}]); - Stat_t.init("", [{prop: "Dev", name: "Dev", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Ino", name: "Ino", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Nlink", name: "Nlink", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Mode", name: "Mode", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Uid", name: "Uid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Gid", name: "Gid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "X__pad0", name: "X__pad0", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Rdev", name: "Rdev", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Size", name: "Size", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Blksize", name: "Blksize", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Blocks", name: "Blocks", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Atim", name: "Atim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "Mtim", name: "Mtim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "Ctim", name: "Ctim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "X__unused", name: "X__unused", embedded: false, exported: true, typ: arrayType$5, tag: ""}]); - RawSockaddrInet4.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Zero", name: "Zero", embedded: false, exported: true, typ: arrayType$1, tag: ""}]); - RawSockaddrInet6.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Flowinfo", name: "Flowinfo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$2, tag: ""}, {prop: "Scope_id", name: "Scope_id", embedded: false, exported: true, typ: $Uint32, tag: ""}]); - RawSockaddrUnix.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: arrayType$8, tag: ""}]); - RawSockaddrLinklayer.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Protocol", name: "Protocol", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Hatype", name: "Hatype", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pkttype", name: "Pkttype", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Halen", name: "Halen", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$1, tag: ""}]); - RawSockaddrNetlink.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Groups", name: "Groups", embedded: false, exported: true, typ: $Uint32, tag: ""}]); - RawSockaddr.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: arrayType$10, tag: ""}]); - RawSockaddrAny.init("", [{prop: "Addr", name: "Addr", embedded: false, exported: true, typ: RawSockaddr, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: arrayType$11, tag: ""}]); - Linger.init("", [{prop: "Onoff", name: "Onoff", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Linger", name: "Linger", embedded: false, exported: true, typ: $Int32, tag: ""}]); - Iovec.init("", [{prop: "Base", name: "Base", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Len", name: "Len", embedded: false, exported: true, typ: $Uint64, tag: ""}]); - IPMreq.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Interface", name: "Interface", embedded: false, exported: true, typ: arrayType$9, tag: ""}]); - IPMreqn.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Address", name: "Address", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int32, tag: ""}]); - IPv6Mreq.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$2, tag: ""}, {prop: "Interface", name: "Interface", embedded: false, exported: true, typ: $Uint32, tag: ""}]); - Msghdr.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Namelen", name: "Namelen", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Pad_cgo_0", name: "Pad_cgo_0", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Iov", name: "Iov", embedded: false, exported: true, typ: ptrType$19, tag: ""}, {prop: "Iovlen", name: "Iovlen", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Control", name: "Control", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Controllen", name: "Controllen", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Pad_cgo_1", name: "Pad_cgo_1", embedded: false, exported: true, typ: arrayType$9, tag: ""}]); + Errno.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Is", name: "Is", pkg: "", typ: $funcType([$error], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; + Stat_t.init("", [{prop: "Dev", name: "Dev", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Ino", name: "Ino", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Mode", name: "Mode", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Nlink", name: "Nlink", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Uid", name: "Uid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Gid", name: "Gid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Rdev", name: "Rdev", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Size", name: "Size", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Blksize", name: "Blksize", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Blocks", name: "Blocks", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Atime", name: "Atime", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "AtimeNsec", name: "AtimeNsec", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Mtime", name: "Mtime", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "MtimeNsec", name: "MtimeNsec", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Ctime", name: "Ctime", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "CtimeNsec", name: "CtimeNsec", embedded: false, exported: true, typ: $Int64, tag: ""}]); + Iovec.init("", []); + Sockaddr.init([]); + SockaddrInet4.init("", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$3, tag: ""}]); + SockaddrInet6.init("", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ZoneId", name: "ZoneId", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$4, tag: ""}]); + RawConn.init([{prop: "Control", name: "Control", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([funcType$2], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([funcType$2], [$error], false)}]); + jsFile.init("syscall", [{prop: "path", name: "path", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "entries", name: "entries", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "dirIdx", name: "dirIdx", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "pos", name: "pos", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "seeked", name: "seeked", embedded: false, exported: false, typ: $Bool, tag: ""}]); + callResult.init("syscall", [{prop: "val", name: "val", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = race.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - lineBuffer = sliceType.nil; - syscallModule = null; + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = itoa.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = oserror.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ForkLock = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); - ioSync = new $Int64(0, 0); - warningPrinted = false; - alreadyTriedToLoad = false; - minusOne = -1; - envs = runtime_envs(); - $pkg.Stdin = 0; - $pkg.Stdout = 1; - $pkg.Stderr = 2; + filesMu = new sync.Mutex.ptr(0, 0); + errorstr = $toNativeArray($kindString, ["", "Operation not permitted", "No such file or directory", "No such process", "Interrupted system call", "I/O error", "No such device or address", "Argument list too long", "Exec format error", "Bad file number", "No child processes", "Try again", "Out of memory", "Permission denied", "Bad address", "", "Device or resource busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Is a directory", "Invalid argument", "File table overflow", "Too many open files", "Not a typewriter", "", "File too large", "No space left on device", "Illegal seek", "Read-only file system", "Too many links", "Broken pipe", "Math arg out of domain of func", "Math result not representable", "Deadlock condition", "File name too long", "No record locks available", "not implemented on js", "Directory not empty", "Too many symbolic links", "", "No message of desired type", "Identifier removed", "Channel number out of range", "Level 2 not synchronized", "Level 3 halted", "Level 3 reset", "Link number out of range", "Protocol driver not attached", "No CSI structure available", "Level 2 halted", "Invalid exchange", "Invalid request descriptor", "Exchange full", "No anode", "Invalid request code", "Invalid slot", "", "Bad font file fmt", "Device not a stream", "No data (for no delay io)", "Timer expired", "Out of streams resources", "Machine is not on the network", "Package not installed", "The object is remote", "The link has been severed", "Advertise error", "Srmount error", "Communication error on send", "Protocol error", "Multihop attempted", "Cross mount point (not really error)", "Trying to read unreadable message", "Value too large for defined data type", "Given log. name not unique", "f.d. invalid for this operation", "Remote address changed", "Can't access a needed shared lib", "Accessing a corrupted shared lib", ".lib section in a.out corrupted", "Attempting to link in too many libs", "Attempting to exec a shared library", "", "", "", "", "Socket operation on non-socket", "Destination address required", "Message too long", "Protocol wrong type for socket", "Protocol not available", "Unknown protocol", "Socket type not supported", "Operation not supported on transport endpoint", "Protocol family not supported", "Address family not supported by protocol family", "Address already in use", "Address not available", "Network interface is not configured", "Network is unreachable", "", "Connection aborted", "Connection reset by peer", "No buffer space available", "Socket is already connected", "Socket is not connected", "Can't send after socket shutdown", "", "Connection timed out", "Connection refused", "Host is down", "Host is unreachable", "Socket already connected", "Connection already in progress", "", "", "", "", "", "", "Quota exceeded", "No medium (in tape drive)", "", "Operation canceled.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Inode is remote (not really error)", "Inappropriate file type or format", "No more files", "", "No such host or network path", "Filename exists with different case"]); errEAGAIN = new Errno(11); errEINVAL = new Errno(22); errENOENT = new Errno(2); - errors = $toNativeArray($kindString, ["", "operation not permitted", "no such file or directory", "no such process", "interrupted system call", "input/output error", "no such device or address", "argument list too long", "exec format error", "bad file descriptor", "no child processes", "resource temporarily unavailable", "cannot allocate memory", "permission denied", "bad address", "block device required", "device or resource busy", "file exists", "invalid cross-device link", "no such device", "not a directory", "is a directory", "invalid argument", "too many open files in system", "too many open files", "inappropriate ioctl for device", "text file busy", "file too large", "no space left on device", "illegal seek", "read-only file system", "too many links", "broken pipe", "numerical argument out of domain", "numerical result out of range", "resource deadlock avoided", "file name too long", "no locks available", "function not implemented", "directory not empty", "too many levels of symbolic links", "", "no message of desired type", "identifier removed", "channel number out of range", "level 2 not synchronized", "level 3 halted", "level 3 reset", "link number out of range", "protocol driver not attached", "no CSI structure available", "level 2 halted", "invalid exchange", "invalid request descriptor", "exchange full", "no anode", "invalid request code", "invalid slot", "", "bad font file format", "device not a stream", "no data available", "timer expired", "out of streams resources", "machine is not on the network", "package not installed", "object is remote", "link has been severed", "advertise error", "srmount error", "communication error on send", "protocol error", "multihop attempted", "RFS specific error", "bad message", "value too large for defined data type", "name not unique on network", "file descriptor in bad state", "remote address changed", "can not access a needed shared library", "accessing a corrupted shared library", ".lib section in a.out corrupted", "attempting to link in too many shared libraries", "cannot exec a shared library directly", "invalid or incomplete multibyte or wide character", "interrupted system call should be restarted", "streams pipe error", "too many users", "socket operation on non-socket", "destination address required", "message too long", "protocol wrong type for socket", "protocol not available", "protocol not supported", "socket type not supported", "operation not supported", "protocol family not supported", "address family not supported by protocol", "address already in use", "cannot assign requested address", "network is down", "network is unreachable", "network dropped connection on reset", "software caused connection abort", "connection reset by peer", "no buffer space available", "transport endpoint is already connected", "transport endpoint is not connected", "cannot send after transport endpoint shutdown", "too many references: cannot splice", "connection timed out", "connection refused", "host is down", "no route to host", "operation already in progress", "operation now in progress", "stale NFS file handle", "structure needs cleaning", "not a XENIX named type file", "no XENIX semaphores available", "is a named type file", "remote I/O error", "disk quota exceeded", "no medium found", "wrong medium type", "operation canceled", "required key not available", "key has expired", "key has been revoked", "key was rejected by service", "owner died", "state not recoverable", "operation not possible due to RF-kill"]); - mapper = new mmapper.ptr(new sync.Mutex.ptr(0, 0), {}, mmap, munmap); - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["github.com/gopherjs/gopherjs/nosync"] = (function() { - var $pkg = {}, $init, Once, funcType$1, ptrType$4; - Once = $pkg.Once = $newType(0, $kindStruct, "nosync.Once", true, "github.com/gopherjs/gopherjs/nosync", true, function(doing_, done_) { - this.$val = this; - if (arguments.length === 0) { - this.doing = false; - this.done = false; - return; - } - this.doing = doing_; - this.done = done_; - }); - funcType$1 = $funcType([], [], false); - ptrType$4 = $ptrType(Once); - Once.ptr.prototype.Do = function(f) { - var f, o, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - o = [o]; - o[0] = this; - if (o[0].done) { - $s = -1; return; - } - if (o[0].doing) { - $panic(new $String("nosync: Do called within f")); - } - o[0].doing = true; - $deferred.push([(function(o) { return function() { - o[0].doing = false; - o[0].done = true; - }; })(o), []]); - $r = f(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - Once.prototype.Do = function(f) { return this.$val.Do(f); }; - ptrType$4.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$1], [], false)}]; - Once.init("github.com/gopherjs/gopherjs/nosync", [{prop: "doing", name: "doing", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: $Bool, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + errnoByCode = $makeMap($String.keyFor, [{ k: "EPERM", v: 1 }, { k: "ENOENT", v: 2 }, { k: "ESRCH", v: 3 }, { k: "EINTR", v: 4 }, { k: "EIO", v: 5 }, { k: "ENXIO", v: 6 }, { k: "E2BIG", v: 7 }, { k: "ENOEXEC", v: 8 }, { k: "EBADF", v: 9 }, { k: "ECHILD", v: 10 }, { k: "EAGAIN", v: 11 }, { k: "ENOMEM", v: 12 }, { k: "EACCES", v: 13 }, { k: "EFAULT", v: 14 }, { k: "EBUSY", v: 16 }, { k: "EEXIST", v: 17 }, { k: "EXDEV", v: 18 }, { k: "ENODEV", v: 19 }, { k: "ENOTDIR", v: 20 }, { k: "EISDIR", v: 21 }, { k: "EINVAL", v: 22 }, { k: "ENFILE", v: 23 }, { k: "EMFILE", v: 24 }, { k: "ENOTTY", v: 25 }, { k: "EFBIG", v: 27 }, { k: "ENOSPC", v: 28 }, { k: "ESPIPE", v: 29 }, { k: "EROFS", v: 30 }, { k: "EMLINK", v: 31 }, { k: "EPIPE", v: 32 }, { k: "ENAMETOOLONG", v: 36 }, { k: "ENOSYS", v: 38 }, { k: "EDQUOT", v: 122 }, { k: "EDOM", v: 33 }, { k: "ERANGE", v: 34 }, { k: "EDEADLK", v: 35 }, { k: "ENOLCK", v: 37 }, { k: "ENOTEMPTY", v: 39 }, { k: "ELOOP", v: 40 }, { k: "ENOMSG", v: 42 }, { k: "EIDRM", v: 43 }, { k: "ECHRNG", v: 44 }, { k: "EL2NSYNC", v: 45 }, { k: "EL3HLT", v: 46 }, { k: "EL3RST", v: 47 }, { k: "ELNRNG", v: 48 }, { k: "EUNATCH", v: 49 }, { k: "ENOCSI", v: 50 }, { k: "EL2HLT", v: 51 }, { k: "EBADE", v: 52 }, { k: "EBADR", v: 53 }, { k: "EXFULL", v: 54 }, { k: "ENOANO", v: 55 }, { k: "EBADRQC", v: 56 }, { k: "EBADSLT", v: 57 }, { k: "EDEADLOCK", v: 35 }, { k: "EBFONT", v: 59 }, { k: "ENOSTR", v: 60 }, { k: "ENODATA", v: 61 }, { k: "ETIME", v: 62 }, { k: "ENOSR", v: 63 }, { k: "ENONET", v: 64 }, { k: "ENOPKG", v: 65 }, { k: "EREMOTE", v: 66 }, { k: "ENOLINK", v: 67 }, { k: "EADV", v: 68 }, { k: "ESRMNT", v: 69 }, { k: "ECOMM", v: 70 }, { k: "EPROTO", v: 71 }, { k: "EMULTIHOP", v: 72 }, { k: "EDOTDOT", v: 73 }, { k: "EBADMSG", v: 74 }, { k: "EOVERFLOW", v: 75 }, { k: "ENOTUNIQ", v: 76 }, { k: "EBADFD", v: 77 }, { k: "EREMCHG", v: 78 }, { k: "ELIBACC", v: 79 }, { k: "ELIBBAD", v: 80 }, { k: "ELIBSCN", v: 81 }, { k: "ELIBMAX", v: 82 }, { k: "ELIBEXEC", v: 83 }, { k: "EILSEQ", v: 84 }, { k: "EUSERS", v: 87 }, { k: "ENOTSOCK", v: 88 }, { k: "EDESTADDRREQ", v: 89 }, { k: "EMSGSIZE", v: 90 }, { k: "EPROTOTYPE", v: 91 }, { k: "ENOPROTOOPT", v: 92 }, { k: "EPROTONOSUPPORT", v: 93 }, { k: "ESOCKTNOSUPPORT", v: 94 }, { k: "EOPNOTSUPP", v: 95 }, { k: "EPFNOSUPPORT", v: 96 }, { k: "EAFNOSUPPORT", v: 97 }, { k: "EADDRINUSE", v: 98 }, { k: "EADDRNOTAVAIL", v: 99 }, { k: "ENETDOWN", v: 100 }, { k: "ENETUNREACH", v: 101 }, { k: "ENETRESET", v: 102 }, { k: "ECONNABORTED", v: 103 }, { k: "ECONNRESET", v: 104 }, { k: "ENOBUFS", v: 105 }, { k: "EISCONN", v: 106 }, { k: "ENOTCONN", v: 107 }, { k: "ESHUTDOWN", v: 108 }, { k: "ETOOMANYREFS", v: 109 }, { k: "ETIMEDOUT", v: 110 }, { k: "ECONNREFUSED", v: 111 }, { k: "EHOSTDOWN", v: 112 }, { k: "EHOSTUNREACH", v: 113 }, { k: "EALREADY", v: 114 }, { k: "EINPROGRESS", v: 115 }, { k: "ESTALE", v: 116 }, { k: "ENOTSUP", v: 95 }, { k: "ENOMEDIUM", v: 123 }, { k: "ECANCELED", v: 125 }, { k: "ELBIN", v: 2048 }, { k: "EFTYPE", v: 2049 }, { k: "ENMFILE", v: 2050 }, { k: "EPROCLIM", v: 2051 }, { k: "ENOSHARE", v: 2052 }, { k: "ECASECLASH", v: 2053 }, { k: "EWOULDBLOCK", v: 11 }]); + jsProcess = $clone($clone(js.Global(), js.Value).Get("process"), js.Value); + jsFS = $clone($clone(js.Global(), js.Value).Get("fs"), js.Value); + constants = $clone($clone(jsFS, js.Value).Get("constants"), js.Value); + uint8Array = $clone($clone(js.Global(), js.Value).Get("Uint8Array"), js.Value); + nodeWRONLY = $clone($clone(constants, js.Value).Get("O_WRONLY"), js.Value).Int(); + nodeRDWR = $clone($clone(constants, js.Value).Get("O_RDWR"), js.Value).Int(); + nodeCREATE = $clone($clone(constants, js.Value).Get("O_CREAT"), js.Value).Int(); + nodeTRUNC = $clone($clone(constants, js.Value).Get("O_TRUNC"), js.Value).Int(); + nodeAPPEND = $clone($clone(constants, js.Value).Get("O_APPEND"), js.Value).Int(); + nodeEXCL = $clone($clone(constants, js.Value).Get("O_EXCL"), js.Value).Int(); + files = $makeMap($Int.keyFor, [{ k: 0, v: new jsFile.ptr("", sliceType.nil, 0, new $Int64(0, 0), false) }, { k: 1, v: new jsFile.ptr("", sliceType.nil, 0, new $Int64(0, 0), false) }, { k: 2, v: new jsFile.ptr("", sliceType.nil, 0, new $Int64(0, 0), false) }]); + _r = runtime_envs(); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + envs = _r; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["time"] = (function() { - var $pkg = {}, $init, errors, js, nosync, runtime, syscall, runtimeTimer, ParseError, Timer, Time, Month, Weekday, Duration, Location, zone, zoneTrans, sliceType, sliceType$1, ptrType, sliceType$2, structType, arrayType, sliceType$3, arrayType$1, arrayType$2, ptrType$2, funcType, arrayType$3, funcType$1, ptrType$3, ptrType$4, ptrType$5, chanType$1, ptrType$7, zoneSources, std0x, longDayNames, shortDayNames, shortMonthNames, longMonthNames, atoiError, errBad, errLeadingInt, months, days, daysBefore, utcLoc, utcLoc$24ptr, localLoc, localLoc$24ptr, localOnce, errLocation, badData, init, initLocal, runtimeNano, now, Sleep, startTimer, stopTimer, indexByte, startsWithLowerCase, nextStdChunk, match, lookup, appendInt, atoi, formatNano, quote, isDigit, getnum, cutspace, skip, Parse, parse, parseTimeZone, parseGMT, parseSignedOffset, parseNanoseconds, leadingInt, when, AfterFunc, goFunc, absWeekday, absClock, fmtFrac, fmtInt, lessThanHalf, Until, absDate, daysIn, Now, unixTime, Unix, isLeap, norm, Date, div, FixedZone; + var $pkg = {}, $init, errors, js$1, nosync, runtime, syscall, js, Location, zone, zoneTrans, ruleKind, rule, Time, Month, Weekday, Duration, Timer, runtimeTimer, ParseError, sliceType, sliceType$1, ptrType, sliceType$2, sliceType$3, ptrType$2, arrayType$2, funcType, structType, arrayType$3, arrayType$4, arrayType$5, ptrType$4, chanType$1, ptrType$6, funcType$1, ptrType$7, ptrType$8, badData, utcLoc, utcLoc$24ptr, localLoc, localLoc$24ptr, localOnce, errLocation, daysBefore, startNano, zoneSources, std0x, longDayNames, shortDayNames, shortMonthNames, longMonthNames, atoiError, errBad, errLeadingInt, x, _r, FixedZone, tzset, tzsetName, tzsetOffset, tzsetRule, tzsetNum, tzruleTime, absWeekday, absClock, fmtFrac, fmtInt, lessThanHalf, Until, absDate, daysIn, daysSinceEpoch, runtimeNano, Now, unixTime, Unix, isLeap, norm, Date, div, when, AfterFunc, goFunc, initLocal, itoa, init, now, Sleep, startTimer, stopTimer, modTimer, resetTimer, startsWithLowerCase, nextStdChunk, match, lookup, appendInt, atoi, stdFracSecond, digitsLen, separator, formatNano, quote, isDigit, getnum, getnum3, cutspace, skip, Parse, parse, parseTimeZone, parseGMT, parseSignedOffset, commaOrPeriod, parseNanoseconds, leadingInt; errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; + js$1 = $packages["github.com/gopherjs/gopherjs/js"]; nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; runtime = $packages["runtime"]; syscall = $packages["syscall"]; - runtimeTimer = $pkg.runtimeTimer = $newType(0, $kindStruct, "time.runtimeTimer", true, "time", false, function(i_, when_, period_, f_, arg_, timeout_, active_) { - this.$val = this; - if (arguments.length === 0) { - this.i = 0; - this.when = new $Int64(0, 0); - this.period = new $Int64(0, 0); - this.f = $throwNilPointerError; - this.arg = $ifaceNil; - this.timeout = null; - this.active = false; - return; - } - this.i = i_; - this.when = when_; - this.period = period_; - this.f = f_; - this.arg = arg_; - this.timeout = timeout_; - this.active = active_; - }); - ParseError = $pkg.ParseError = $newType(0, $kindStruct, "time.ParseError", true, "time", true, function(Layout_, Value_, LayoutElem_, ValueElem_, Message_) { - this.$val = this; - if (arguments.length === 0) { - this.Layout = ""; - this.Value = ""; - this.LayoutElem = ""; - this.ValueElem = ""; - this.Message = ""; - return; - } - this.Layout = Layout_; - this.Value = Value_; - this.LayoutElem = LayoutElem_; - this.ValueElem = ValueElem_; - this.Message = Message_; - }); - Timer = $pkg.Timer = $newType(0, $kindStruct, "time.Timer", true, "time", true, function(C_, r_) { - this.$val = this; - if (arguments.length === 0) { - this.C = $chanNil; - this.r = new runtimeTimer.ptr(0, new $Int64(0, 0), new $Int64(0, 0), $throwNilPointerError, $ifaceNil, null, false); - return; - } - this.C = C_; - this.r = r_; - }); - Time = $pkg.Time = $newType(0, $kindStruct, "time.Time", true, "time", true, function(wall_, ext_, loc_) { - this.$val = this; - if (arguments.length === 0) { - this.wall = new $Uint64(0, 0); - this.ext = new $Int64(0, 0); - this.loc = ptrType$2.nil; - return; - } - this.wall = wall_; - this.ext = ext_; - this.loc = loc_; - }); - Month = $pkg.Month = $newType(4, $kindInt, "time.Month", true, "time", true, null); - Weekday = $pkg.Weekday = $newType(4, $kindInt, "time.Weekday", true, "time", true, null); - Duration = $pkg.Duration = $newType(8, $kindInt64, "time.Duration", true, "time", true, null); - Location = $pkg.Location = $newType(0, $kindStruct, "time.Location", true, "time", true, function(name_, zone_, tx_, cacheStart_, cacheEnd_, cacheZone_) { + js = $packages["syscall/js"]; + Location = $pkg.Location = $newType(0, $kindStruct, "time.Location", true, "time", true, function(name_, zone_, tx_, extend_, cacheStart_, cacheEnd_, cacheZone_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.zone = sliceType.nil; this.tx = sliceType$1.nil; + this.extend = ""; this.cacheStart = new $Int64(0, 0); this.cacheEnd = new $Int64(0, 0); this.cacheZone = ptrType.nil; @@ -5111,6 +7314,7 @@ $packages["time"] = (function() { this.name = name_; this.zone = zone_; this.tx = tx_; + this.extend = extend_; this.cacheStart = cacheStart_; this.cacheEnd = cacheEnd_; this.cacheZone = cacheZone_; @@ -5141,1492 +7345,915 @@ $packages["time"] = (function() { this.isstd = isstd_; this.isutc = isutc_; }); + ruleKind = $pkg.ruleKind = $newType(4, $kindInt, "time.ruleKind", true, "time", false, null); + rule = $pkg.rule = $newType(0, $kindStruct, "time.rule", true, "time", false, function(kind_, day_, week_, mon_, time_) { + this.$val = this; + if (arguments.length === 0) { + this.kind = 0; + this.day = 0; + this.week = 0; + this.mon = 0; + this.time = 0; + return; + } + this.kind = kind_; + this.day = day_; + this.week = week_; + this.mon = mon_; + this.time = time_; + }); + Time = $pkg.Time = $newType(0, $kindStruct, "time.Time", true, "time", true, function(wall_, ext_, loc_) { + this.$val = this; + if (arguments.length === 0) { + this.wall = new $Uint64(0, 0); + this.ext = new $Int64(0, 0); + this.loc = ptrType$2.nil; + return; + } + this.wall = wall_; + this.ext = ext_; + this.loc = loc_; + }); + Month = $pkg.Month = $newType(4, $kindInt, "time.Month", true, "time", true, null); + Weekday = $pkg.Weekday = $newType(4, $kindInt, "time.Weekday", true, "time", true, null); + Duration = $pkg.Duration = $newType(8, $kindInt64, "time.Duration", true, "time", true, null); + Timer = $pkg.Timer = $newType(0, $kindStruct, "time.Timer", true, "time", true, function(C_, r_) { + this.$val = this; + if (arguments.length === 0) { + this.C = $chanNil; + this.r = new runtimeTimer.ptr(0, new $Int64(0, 0), new $Int64(0, 0), $throwNilPointerError, $ifaceNil, 0, null, false); + return; + } + this.C = C_; + this.r = r_; + }); + runtimeTimer = $pkg.runtimeTimer = $newType(0, $kindStruct, "time.runtimeTimer", true, "time", false, function(i_, when_, period_, f_, arg_, seq_, timeout_, active_) { + this.$val = this; + if (arguments.length === 0) { + this.i = 0; + this.when = new $Int64(0, 0); + this.period = new $Int64(0, 0); + this.f = $throwNilPointerError; + this.arg = $ifaceNil; + this.seq = 0; + this.timeout = null; + this.active = false; + return; + } + this.i = i_; + this.when = when_; + this.period = period_; + this.f = f_; + this.arg = arg_; + this.seq = seq_; + this.timeout = timeout_; + this.active = active_; + }); + ParseError = $pkg.ParseError = $newType(0, $kindStruct, "time.ParseError", true, "time", true, function(Layout_, Value_, LayoutElem_, ValueElem_, Message_) { + this.$val = this; + if (arguments.length === 0) { + this.Layout = ""; + this.Value = ""; + this.LayoutElem = ""; + this.ValueElem = ""; + this.Message = ""; + return; + } + this.Layout = Layout_; + this.Value = Value_; + this.LayoutElem = LayoutElem_; + this.ValueElem = ValueElem_; + this.Message = Message_; + }); sliceType = $sliceType(zone); sliceType$1 = $sliceType(zoneTrans); ptrType = $ptrType(zone); sliceType$2 = $sliceType($String); - structType = $structType("", []); - arrayType = $arrayType($Uint8, 20); sliceType$3 = $sliceType($Uint8); - arrayType$1 = $arrayType($Uint8, 9); - arrayType$2 = $arrayType($Uint8, 64); ptrType$2 = $ptrType(Location); + arrayType$2 = $arrayType($Uint8, 32); funcType = $funcType([], [], false); - arrayType$3 = $arrayType($Uint8, 32); - funcType$1 = $funcType([$emptyInterface, $Uintptr], [], false); - ptrType$3 = $ptrType(js.Object); - ptrType$4 = $ptrType(ParseError); - ptrType$5 = $ptrType(Timer); + structType = $structType("", []); + arrayType$3 = $arrayType($Uint8, 20); + arrayType$4 = $arrayType($Uint8, 9); + arrayType$5 = $arrayType($Uint8, 64); + ptrType$4 = $ptrType(Time); chanType$1 = $chanType(Time, false, true); - ptrType$7 = $ptrType(Time); - init = function() { - $unused(Unix(new $Int64(0, 0), new $Int64(0, 0))); - }; - initLocal = function() { - var d, i, j, s; - d = new ($global.Date)(); - s = $internalize(d, $String); - i = indexByte(s, 40); - j = indexByte(s, 41); - if ((i === -1) || (j === -1)) { - localLoc.name = "UTC"; - return; + ptrType$6 = $ptrType(Timer); + funcType$1 = $funcType([$emptyInterface, $Uintptr], [], false); + ptrType$7 = $ptrType(js$1.Object); + ptrType$8 = $ptrType(ParseError); + Location.ptr.prototype.get = function() { + var {l, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + l = this; + if (l === ptrType$2.nil) { + $s = -1; return utcLoc; } - localLoc.name = $substring(s, (i + 1 >> 0), j); - localLoc.zone = new sliceType([new zone.ptr(localLoc.name, $imul(($parseInt(d.getTimezoneOffset()) >> 0), -60), false)]); + /* */ if (l === localLoc) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (l === localLoc) { */ case 1: + $r = localOnce.Do(initLocal); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + $s = -1; return l; + /* */ } return; } var $f = {$blk: Location.ptr.prototype.get, $c: true, $r, l, $s};return $f; }; - runtimeNano = function() { - return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); + Location.prototype.get = function() { return this.$val.get(); }; + Location.ptr.prototype.String = function() { + var {$24r, _r$1, l, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + l = this; + _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1.name; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Location.ptr.prototype.String, $c: true, $r, $24r, _r$1, l, $s};return $f; }; - now = function() { - var _tmp, _tmp$1, _tmp$2, mono, n, nsec, sec, x; - sec = new $Int64(0, 0); - nsec = 0; - mono = new $Int64(0, 0); - n = runtimeNano(); - _tmp = $div64(n, new $Int64(0, 1000000000), false); - _tmp$1 = (((x = $div64(n, new $Int64(0, 1000000000), true), x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); - _tmp$2 = n; - sec = _tmp; - nsec = _tmp$1; - mono = _tmp$2; - return [sec, nsec, mono]; + Location.prototype.String = function() { return this.$val.String(); }; + FixedZone = function(name, offset) { + var l, name, offset, x$1; + l = new Location.ptr(name, new sliceType([new zone.ptr(name, offset, false)]), new sliceType$1([new zoneTrans.ptr(new $Int64(-2147483648, 0), 0, false, false)]), "", new $Int64(-2147483648, 0), new $Int64(2147483647, 4294967295), ptrType.nil); + l.cacheZone = (x$1 = l.zone, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); + return l; }; - Sleep = function(d) { - var _r, c, d, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; d = $f.d; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = [c]; - c[0] = new $Chan(structType, 0); - $setTimeout((function(c) { return function() { - $close(c[0]); - }; })(c), (((x = $div64(d, new Duration(0, 1000000), false), x.$low + ((x.$high >> 31) * 4294967296)) >> 0))); - _r = $recv(c[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r[0]; - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Sleep }; } $f._r = _r; $f.c = c; $f.d = d; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Sleep = Sleep; - startTimer = function(t) { - var diff, t, x, x$1; - t.active = true; - diff = $div64(((x = t.when, x$1 = runtimeNano(), new $Int64(x.$high - x$1.$high, x.$low - x$1.$low))), new $Int64(0, 1000000), false); - if ((diff.$high > 0 || (diff.$high === 0 && diff.$low > 2147483647))) { - return; + $pkg.FixedZone = FixedZone; + Location.ptr.prototype.lookup = function(sec) { + var {_q, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, eend, eisDST, ename, end, eoffset, estart, hi, isDST, l, lim, lo, m, name, offset, ok, sec, start, tx, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, zone$1, zone$2, zone$3, $s, $r, $c} = $restore(this, {sec}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + name = ""; + offset = 0; + start = new $Int64(0, 0); + end = new $Int64(0, 0); + isDST = false; + l = this; + _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; + if (l.zone.$length === 0) { + name = "UTC"; + offset = 0; + start = new $Int64(-2147483648, 0); + end = new $Int64(2147483647, 4294967295); + isDST = false; + $s = -1; return [name, offset, start, end, isDST]; } - if ((diff.$high < 0 || (diff.$high === 0 && diff.$low < 0))) { - diff = new $Int64(0, 0); + zone$1 = l.cacheZone; + if (!(zone$1 === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { + name = zone$1.name; + offset = zone$1.offset; + start = l.cacheStart; + end = l.cacheEnd; + isDST = zone$1.isDST; + $s = -1; return [name, offset, start, end, isDST]; } - t.timeout = $setTimeout((function() { - var x$2, x$3, x$4; - t.active = false; - if (!((x$2 = t.period, (x$2.$high === 0 && x$2.$low === 0)))) { - t.when = (x$3 = t.when, x$4 = t.period, new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)); - startTimer(t); + if ((l.tx.$length === 0) || (x$3 = (x$4 = l.tx, (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0])).when, (sec.$high < x$3.$high || (sec.$high === x$3.$high && sec.$low < x$3.$low)))) { + zone$2 = (x$5 = l.zone, x$6 = l.lookupFirstZone(), ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])); + name = zone$2.name; + offset = zone$2.offset; + start = new $Int64(-2147483648, 0); + if (l.tx.$length > 0) { + end = (x$7 = l.tx, (0 >= x$7.$length ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + 0])).when; + } else { + end = new $Int64(2147483647, 4294967295); } - $go(t.f, [t.arg, 0]); - }), $externalize(new $Int64(diff.$high + 0, diff.$low + 1), $Int64)); - }; - stopTimer = function(t) { - var t, wasActive; - $global.clearTimeout(t.timeout); - wasActive = t.active; - t.active = false; - return wasActive; - }; - indexByte = function(s, c) { - var c, s; - return $parseInt(s.indexOf($global.String.fromCharCode(c))) >> 0; - }; - startsWithLowerCase = function(str) { - var c, str; - if (str.length === 0) { - return false; + isDST = zone$2.isDST; + $s = -1; return [name, offset, start, end, isDST]; } - c = str.charCodeAt(0); - return 97 <= c && c <= 122; - }; - nextStdChunk = function(layout) { - var _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$44, _tmp$45, _tmp$46, _tmp$47, _tmp$48, _tmp$49, _tmp$5, _tmp$50, _tmp$51, _tmp$52, _tmp$53, _tmp$54, _tmp$55, _tmp$56, _tmp$57, _tmp$58, _tmp$59, _tmp$6, _tmp$60, _tmp$61, _tmp$62, _tmp$63, _tmp$64, _tmp$65, _tmp$66, _tmp$67, _tmp$68, _tmp$69, _tmp$7, _tmp$70, _tmp$71, _tmp$72, _tmp$73, _tmp$74, _tmp$75, _tmp$76, _tmp$77, _tmp$78, _tmp$79, _tmp$8, _tmp$80, _tmp$81, _tmp$82, _tmp$83, _tmp$84, _tmp$85, _tmp$86, _tmp$9, c, ch, i, j, layout, prefix, std, std$1, suffix, x; - prefix = ""; - std = 0; - suffix = ""; - i = 0; + tx = l.tx; + end = new $Int64(2147483647, 4294967295); + lo = 0; + hi = tx.$length; while (true) { - if (!(i < layout.length)) { break; } - c = ((layout.charCodeAt(i) >> 0)); - _1 = c; - if (_1 === (74)) { - if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "Jan") { - if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "January") { - _tmp = $substring(layout, 0, i); - _tmp$1 = 257; - _tmp$2 = $substring(layout, (i + 7 >> 0)); - prefix = _tmp; - std = _tmp$1; - suffix = _tmp$2; - return [prefix, std, suffix]; - } - if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { - _tmp$3 = $substring(layout, 0, i); - _tmp$4 = 258; - _tmp$5 = $substring(layout, (i + 3 >> 0)); - prefix = _tmp$3; - std = _tmp$4; - suffix = _tmp$5; - return [prefix, std, suffix]; - } - } - } else if (_1 === (77)) { - if (layout.length >= (i + 3 >> 0)) { - if ($substring(layout, i, (i + 3 >> 0)) === "Mon") { - if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Monday") { - _tmp$6 = $substring(layout, 0, i); - _tmp$7 = 261; - _tmp$8 = $substring(layout, (i + 6 >> 0)); - prefix = _tmp$6; - std = _tmp$7; - suffix = _tmp$8; - return [prefix, std, suffix]; - } - if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { - _tmp$9 = $substring(layout, 0, i); - _tmp$10 = 262; - _tmp$11 = $substring(layout, (i + 3 >> 0)); - prefix = _tmp$9; - std = _tmp$10; - suffix = _tmp$11; - return [prefix, std, suffix]; - } - } - if ($substring(layout, i, (i + 3 >> 0)) === "MST") { - _tmp$12 = $substring(layout, 0, i); - _tmp$13 = 21; - _tmp$14 = $substring(layout, (i + 3 >> 0)); - prefix = _tmp$12; - std = _tmp$13; - suffix = _tmp$14; - return [prefix, std, suffix]; - } - } - } else if (_1 === (48)) { - if (layout.length >= (i + 2 >> 0) && 49 <= layout.charCodeAt((i + 1 >> 0)) && layout.charCodeAt((i + 1 >> 0)) <= 54) { - _tmp$15 = $substring(layout, 0, i); - _tmp$16 = (x = layout.charCodeAt((i + 1 >> 0)) - 49 << 24 >>> 24, ((x < 0 || x >= std0x.length) ? ($throwRuntimeError("index out of range"), undefined) : std0x[x])); - _tmp$17 = $substring(layout, (i + 2 >> 0)); - prefix = _tmp$15; - std = _tmp$16; - suffix = _tmp$17; - return [prefix, std, suffix]; - } - } else if (_1 === (49)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 53)) { - _tmp$18 = $substring(layout, 0, i); - _tmp$19 = 522; - _tmp$20 = $substring(layout, (i + 2 >> 0)); - prefix = _tmp$18; - std = _tmp$19; - suffix = _tmp$20; - return [prefix, std, suffix]; - } - _tmp$21 = $substring(layout, 0, i); - _tmp$22 = 259; - _tmp$23 = $substring(layout, (i + 1 >> 0)); - prefix = _tmp$21; - std = _tmp$22; - suffix = _tmp$23; - return [prefix, std, suffix]; - } else if (_1 === (50)) { - if (layout.length >= (i + 4 >> 0) && $substring(layout, i, (i + 4 >> 0)) === "2006") { - _tmp$24 = $substring(layout, 0, i); - _tmp$25 = 273; - _tmp$26 = $substring(layout, (i + 4 >> 0)); - prefix = _tmp$24; - std = _tmp$25; - suffix = _tmp$26; - return [prefix, std, suffix]; - } - _tmp$27 = $substring(layout, 0, i); - _tmp$28 = 263; - _tmp$29 = $substring(layout, (i + 1 >> 0)); - prefix = _tmp$27; - std = _tmp$28; - suffix = _tmp$29; - return [prefix, std, suffix]; - } else if (_1 === (95)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 50)) { - if (layout.length >= (i + 5 >> 0) && $substring(layout, (i + 1 >> 0), (i + 5 >> 0)) === "2006") { - _tmp$30 = $substring(layout, 0, (i + 1 >> 0)); - _tmp$31 = 273; - _tmp$32 = $substring(layout, (i + 5 >> 0)); - prefix = _tmp$30; - std = _tmp$31; - suffix = _tmp$32; - return [prefix, std, suffix]; - } - _tmp$33 = $substring(layout, 0, i); - _tmp$34 = 264; - _tmp$35 = $substring(layout, (i + 2 >> 0)); - prefix = _tmp$33; - std = _tmp$34; - suffix = _tmp$35; - return [prefix, std, suffix]; - } - } else if (_1 === (51)) { - _tmp$36 = $substring(layout, 0, i); - _tmp$37 = 523; - _tmp$38 = $substring(layout, (i + 1 >> 0)); - prefix = _tmp$36; - std = _tmp$37; - suffix = _tmp$38; - return [prefix, std, suffix]; - } else if (_1 === (52)) { - _tmp$39 = $substring(layout, 0, i); - _tmp$40 = 525; - _tmp$41 = $substring(layout, (i + 1 >> 0)); - prefix = _tmp$39; - std = _tmp$40; - suffix = _tmp$41; - return [prefix, std, suffix]; - } else if (_1 === (53)) { - _tmp$42 = $substring(layout, 0, i); - _tmp$43 = 527; - _tmp$44 = $substring(layout, (i + 1 >> 0)); - prefix = _tmp$42; - std = _tmp$43; - suffix = _tmp$44; - return [prefix, std, suffix]; - } else if (_1 === (80)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 77)) { - _tmp$45 = $substring(layout, 0, i); - _tmp$46 = 531; - _tmp$47 = $substring(layout, (i + 2 >> 0)); - prefix = _tmp$45; - std = _tmp$46; - suffix = _tmp$47; - return [prefix, std, suffix]; - } - } else if (_1 === (112)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 109)) { - _tmp$48 = $substring(layout, 0, i); - _tmp$49 = 532; - _tmp$50 = $substring(layout, (i + 2 >> 0)); - prefix = _tmp$48; - std = _tmp$49; - suffix = _tmp$50; - return [prefix, std, suffix]; - } - } else if (_1 === (45)) { - if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "-070000") { - _tmp$51 = $substring(layout, 0, i); - _tmp$52 = 28; - _tmp$53 = $substring(layout, (i + 7 >> 0)); - prefix = _tmp$51; - std = _tmp$52; - suffix = _tmp$53; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "-07:00:00") { - _tmp$54 = $substring(layout, 0, i); - _tmp$55 = 31; - _tmp$56 = $substring(layout, (i + 9 >> 0)); - prefix = _tmp$54; - std = _tmp$55; - suffix = _tmp$56; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "-0700") { - _tmp$57 = $substring(layout, 0, i); - _tmp$58 = 27; - _tmp$59 = $substring(layout, (i + 5 >> 0)); - prefix = _tmp$57; - std = _tmp$58; - suffix = _tmp$59; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "-07:00") { - _tmp$60 = $substring(layout, 0, i); - _tmp$61 = 30; - _tmp$62 = $substring(layout, (i + 6 >> 0)); - prefix = _tmp$60; - std = _tmp$61; - suffix = _tmp$62; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "-07") { - _tmp$63 = $substring(layout, 0, i); - _tmp$64 = 29; - _tmp$65 = $substring(layout, (i + 3 >> 0)); - prefix = _tmp$63; - std = _tmp$64; - suffix = _tmp$65; - return [prefix, std, suffix]; - } - } else if (_1 === (90)) { - if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "Z070000") { - _tmp$66 = $substring(layout, 0, i); - _tmp$67 = 23; - _tmp$68 = $substring(layout, (i + 7 >> 0)); - prefix = _tmp$66; - std = _tmp$67; - suffix = _tmp$68; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "Z07:00:00") { - _tmp$69 = $substring(layout, 0, i); - _tmp$70 = 26; - _tmp$71 = $substring(layout, (i + 9 >> 0)); - prefix = _tmp$69; - std = _tmp$70; - suffix = _tmp$71; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "Z0700") { - _tmp$72 = $substring(layout, 0, i); - _tmp$73 = 22; - _tmp$74 = $substring(layout, (i + 5 >> 0)); - prefix = _tmp$72; - std = _tmp$73; - suffix = _tmp$74; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Z07:00") { - _tmp$75 = $substring(layout, 0, i); - _tmp$76 = 25; - _tmp$77 = $substring(layout, (i + 6 >> 0)); - prefix = _tmp$75; - std = _tmp$76; - suffix = _tmp$77; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "Z07") { - _tmp$78 = $substring(layout, 0, i); - _tmp$79 = 24; - _tmp$80 = $substring(layout, (i + 3 >> 0)); - prefix = _tmp$78; - std = _tmp$79; - suffix = _tmp$80; - return [prefix, std, suffix]; - } - } else if (_1 === (46)) { - if ((i + 1 >> 0) < layout.length && ((layout.charCodeAt((i + 1 >> 0)) === 48) || (layout.charCodeAt((i + 1 >> 0)) === 57))) { - ch = layout.charCodeAt((i + 1 >> 0)); - j = i + 1 >> 0; - while (true) { - if (!(j < layout.length && (layout.charCodeAt(j) === ch))) { break; } - j = j + (1) >> 0; - } - if (!isDigit(layout, j)) { - std$1 = 32; - if (layout.charCodeAt((i + 1 >> 0)) === 57) { - std$1 = 33; - } - std$1 = std$1 | ((((j - ((i + 1 >> 0)) >> 0)) << 16 >> 0)); - _tmp$81 = $substring(layout, 0, i); - _tmp$82 = std$1; - _tmp$83 = $substring(layout, j); - prefix = _tmp$81; - std = _tmp$82; - suffix = _tmp$83; - return [prefix, std, suffix]; - } - } + if (!((hi - lo >> 0) > 1)) { break; } + m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + lim = ((m < 0 || m >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + m]).when; + if ((sec.$high < lim.$high || (sec.$high === lim.$high && sec.$low < lim.$low))) { + end = lim; + hi = m; + } else { + lo = m; } - i = i + (1) >> 0; } - _tmp$84 = layout; - _tmp$85 = 0; - _tmp$86 = ""; - prefix = _tmp$84; - std = _tmp$85; - suffix = _tmp$86; - return [prefix, std, suffix]; - }; - match = function(s1, s2) { - var c1, c2, i, s1, s2; - i = 0; - while (true) { - if (!(i < s1.length)) { break; } - c1 = s1.charCodeAt(i); - c2 = s2.charCodeAt(i); - if (!((c1 === c2))) { - c1 = (c1 | (32)) >>> 0; - c2 = (c2 | (32)) >>> 0; - if (!((c1 === c2)) || c1 < 97 || c1 > 122) { - return false; - } + zone$3 = (x$8 = l.zone, x$9 = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).index, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9])); + name = zone$3.name; + offset = zone$3.offset; + start = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).when; + isDST = zone$3.isDST; + if ((lo === (tx.$length - 1 >> 0)) && !(l.extend === "")) { + _tuple = tzset(l.extend, end, sec); + ename = _tuple[0]; + eoffset = _tuple[1]; + estart = _tuple[2]; + eend = _tuple[3]; + eisDST = _tuple[4]; + ok = _tuple[5]; + if (ok) { + _tmp = ename; + _tmp$1 = eoffset; + _tmp$2 = estart; + _tmp$3 = eend; + _tmp$4 = eisDST; + name = _tmp; + offset = _tmp$1; + start = _tmp$2; + end = _tmp$3; + isDST = _tmp$4; + $s = -1; return [name, offset, start, end, isDST]; } - i = i + (1) >> 0; } - return true; + $s = -1; return [name, offset, start, end, isDST]; + /* */ } return; } var $f = {$blk: Location.ptr.prototype.lookup, $c: true, $r, _q, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, eend, eisDST, ename, end, eoffset, estart, hi, isDST, l, lim, lo, m, name, offset, ok, sec, start, tx, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, zone$1, zone$2, zone$3, $s};return $f; }; - lookup = function(tab, val) { - var _i, _ref, i, tab, v, val; - _ref = tab; + Location.prototype.lookup = function(sec) { return this.$val.lookup(sec); }; + Location.ptr.prototype.lookupFirstZone = function() { + var _i, _ref, l, x$1, x$2, x$3, x$4, x$5, x$6, zi, zi$1; + l = this; + if (!l.firstZoneUsed()) { + return 0; + } + if (l.tx.$length > 0 && (x$1 = l.zone, x$2 = (x$3 = l.tx, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).index, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2])).isDST) { + zi = (((x$4 = l.tx, (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0])).index >> 0)) - 1 >> 0; + while (true) { + if (!(zi >= 0)) { break; } + if (!(x$5 = l.zone, ((zi < 0 || zi >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + zi])).isDST) { + return zi; + } + zi = zi - (1) >> 0; + } + } + _ref = l.zone; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } - i = _i; - v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - if (val.length >= v.length && match($substring(val, 0, v.length), v)) { - return [i, $substring(val, v.length), $ifaceNil]; + zi$1 = _i; + if (!(x$6 = l.zone, ((zi$1 < 0 || zi$1 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + zi$1])).isDST) { + return zi$1; } _i++; } - return [-1, val, errBad]; + return 0; }; - appendInt = function(b, x, width) { - var _q, b, buf, i, q, u, w, width, x; - u = ((x >>> 0)); - if (x < 0) { - b = $append(b, 45); - u = ((-x >>> 0)); - } - buf = arrayType.zero(); - i = 20; + Location.prototype.lookupFirstZone = function() { return this.$val.lookupFirstZone(); }; + Location.ptr.prototype.firstZoneUsed = function() { + var _i, _ref, l, tx; + l = this; + _ref = l.tx; + _i = 0; while (true) { - if (!(u >= 10)) { break; } - i = i - (1) >> 0; - q = (_q = u / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((((48 + u >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24))); - u = q; + if (!(_i < _ref.$length)) { break; } + tx = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), zoneTrans); + if (tx.index === 0) { + return true; + } + _i++; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((48 + u >>> 0) << 24 >>> 24))); - w = 20 - i >> 0; - while (true) { - if (!(w < width)) { break; } - b = $append(b, 48); - w = w + (1) >> 0; - } - return $appendSlice(b, $subslice(new sliceType$3(buf), i)); + return false; }; - atoi = function(s) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, neg, q, rem, s, x; - x = 0; - err = $ifaceNil; - neg = false; - if (!(s === "") && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { - neg = s.charCodeAt(0) === 45; - s = $substring(s, 1); - } - _tuple = leadingInt(s); - q = _tuple[0]; - rem = _tuple[1]; - err = _tuple[2]; - x = (((q.$low + ((q.$high >> 31) * 4294967296)) >> 0)); - if (!($interfaceIsEqual(err, $ifaceNil)) || !(rem === "")) { - _tmp = 0; - _tmp$1 = atoiError; - x = _tmp; - err = _tmp$1; - return [x, err]; - } - if (neg) { - x = -x; - } - _tmp$2 = x; - _tmp$3 = $ifaceNil; - x = _tmp$2; - err = _tmp$3; - return [x, err]; - }; - formatNano = function(b, nanosec, n, trim) { - var _q, _r, b, buf, n, nanosec, start, trim, u, x; - u = nanosec; - buf = arrayType$1.zero(); - start = 9; - while (true) { - if (!(start > 0)) { break; } - start = start - (1) >> 0; - ((start < 0 || start >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[start] = ((((_r = u % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24))); - u = (_q = u / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - } - if (n > 9) { - n = 9; - } - if (trim) { - while (true) { - if (!(n > 0 && ((x = n - 1 >> 0, ((x < 0 || x >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x])) === 48))) { break; } - n = n - (1) >> 0; - } - if (n === 0) { - return b; - } - } - b = $append(b, 46); - return $appendSlice(b, $subslice(new sliceType$3(buf), 0, n)); - }; - Time.ptr.prototype.String = function() { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, buf, m0, m1, m2, s, sign, t, wid, x, x$1, x$2, x$3, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; buf = $f.buf; m0 = $f.m0; m1 = $f.m1; m2 = $f.m2; s = $f.s; sign = $f.sign; t = $f.t; wid = $f.wid; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - _r = $clone(t, Time).Format("2006-01-02 15:04:05.999999999 -0700 MST"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - s = _r; - if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { - m2 = ((x$2 = t.ext, new $Uint64(x$2.$high, x$2.$low))); - sign = 43; - if ((x$3 = t.ext, (x$3.$high < 0 || (x$3.$high === 0 && x$3.$low < 0)))) { - sign = 45; - m2 = new $Uint64(-m2.$high, -m2.$low); - } - _tmp = $div64(m2, new $Uint64(0, 1000000000), false); - _tmp$1 = $div64(m2, new $Uint64(0, 1000000000), true); - m1 = _tmp; - m2 = _tmp$1; - _tmp$2 = $div64(m1, new $Uint64(0, 1000000000), false); - _tmp$3 = $div64(m1, new $Uint64(0, 1000000000), true); - m0 = _tmp$2; - m1 = _tmp$3; - buf = sliceType$3.nil; - buf = $appendSlice(buf, " m="); - buf = $append(buf, sign); - wid = 0; - if (!((m0.$high === 0 && m0.$low === 0))) { - buf = appendInt(buf, ((m0.$low >> 0)), 0); - wid = 9; - } - buf = appendInt(buf, ((m1.$low >> 0)), wid); - buf = $append(buf, 46); - buf = appendInt(buf, ((m2.$low >> 0)), 9); - s = s + (($bytesToString(buf))); - } - $s = -1; return s; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.String }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.buf = buf; $f.m0 = m0; $f.m1 = m1; $f.m2 = m2; $f.s = s; $f.sign = sign; $f.t = t; $f.wid = wid; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.String = function() { return this.$val.String(); }; - Time.ptr.prototype.Format = function(layout) { - var _r, b, buf, layout, max, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; b = $f.b; buf = $f.buf; layout = $f.layout; max = $f.max; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - b = sliceType$3.nil; - max = layout.length + 10 >> 0; - if (max < 64) { - buf = arrayType$2.zero(); - b = $subslice(new sliceType$3(buf), 0, 0); - } else { - b = $makeSlice(sliceType$3, 0, max); - } - _r = $clone(t, Time).AppendFormat(b, layout); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - b = _r; - $s = -1; return ($bytesToString(b)); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Format }; } $f._r = _r; $f.b = b; $f.buf = buf; $f.layout = layout; $f.max = max; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Format = function(layout) { return this.$val.Format(layout); }; - Time.ptr.prototype.AppendFormat = function(b, layout) { - var _1, _q, _q$1, _q$2, _q$3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, _tuple$2, _tuple$3, abs, absoffset, b, day, hour, hr, hr$1, layout, m, min, month, name, offset, prefix, s, sec, std, suffix, t, y, year, zone$1, zone$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _q = $f._q; _q$1 = $f._q$1; _q$2 = $f._q$2; _q$3 = $f._q$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; abs = $f.abs; absoffset = $f.absoffset; b = $f.b; day = $f.day; hour = $f.hour; hr = $f.hr; hr$1 = $f.hr$1; layout = $f.layout; m = $f.m; min = $f.min; month = $f.month; name = $f.name; offset = $f.offset; prefix = $f.prefix; s = $f.s; sec = $f.sec; std = $f.std; suffix = $f.suffix; t = $f.t; y = $f.y; year = $f.year; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - _r = $clone(t, Time).locabs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - name = _tuple[0]; - offset = _tuple[1]; - abs = _tuple[2]; - year = -1; - month = 0; - day = 0; - hour = -1; - min = 0; - sec = 0; - while (true) { - if (!(!(layout === ""))) { break; } - _tuple$1 = nextStdChunk(layout); - prefix = _tuple$1[0]; - std = _tuple$1[1]; - suffix = _tuple$1[2]; - if (!(prefix === "")) { - b = $appendSlice(b, prefix); - } - if (std === 0) { - break; - } - layout = suffix; - if (year < 0 && !(((std & 256) === 0))) { - _tuple$2 = absDate(abs, true); - year = _tuple$2[0]; - month = _tuple$2[1]; - day = _tuple$2[2]; - } - if (hour < 0 && !(((std & 512) === 0))) { - _tuple$3 = absClock(abs); - hour = _tuple$3[0]; - min = _tuple$3[1]; - sec = _tuple$3[2]; - } - switch (0) { default: - _1 = std & 65535; - if (_1 === (274)) { - y = year; - if (y < 0) { - y = -y; - } - b = appendInt(b, (_r$1 = y % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")), 2); - } else if (_1 === (273)) { - b = appendInt(b, year, 4); - } else if (_1 === (258)) { - b = $appendSlice(b, $substring(new Month(month).String(), 0, 3)); - } else if (_1 === (257)) { - m = new Month(month).String(); - b = $appendSlice(b, m); - } else if (_1 === (259)) { - b = appendInt(b, ((month >> 0)), 0); - } else if (_1 === (260)) { - b = appendInt(b, ((month >> 0)), 2); - } else if (_1 === (262)) { - b = $appendSlice(b, $substring(new Weekday(absWeekday(abs)).String(), 0, 3)); - } else if (_1 === (261)) { - s = new Weekday(absWeekday(abs)).String(); - b = $appendSlice(b, s); - } else if (_1 === (263)) { - b = appendInt(b, day, 0); - } else if (_1 === (264)) { - if (day < 10) { - b = $append(b, 32); - } - b = appendInt(b, day, 0); - } else if (_1 === (265)) { - b = appendInt(b, day, 2); - } else if (_1 === (522)) { - b = appendInt(b, hour, 2); - } else if (_1 === (523)) { - hr = (_r$2 = hour % 12, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")); - if (hr === 0) { - hr = 12; - } - b = appendInt(b, hr, 0); - } else if (_1 === (524)) { - hr$1 = (_r$3 = hour % 12, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); - if (hr$1 === 0) { - hr$1 = 12; - } - b = appendInt(b, hr$1, 2); - } else if (_1 === (525)) { - b = appendInt(b, min, 0); - } else if (_1 === (526)) { - b = appendInt(b, min, 2); - } else if (_1 === (527)) { - b = appendInt(b, sec, 0); - } else if (_1 === (528)) { - b = appendInt(b, sec, 2); - } else if (_1 === (531)) { - if (hour >= 12) { - b = $appendSlice(b, "PM"); - } else { - b = $appendSlice(b, "AM"); - } - } else if (_1 === (532)) { - if (hour >= 12) { - b = $appendSlice(b, "pm"); - } else { - b = $appendSlice(b, "am"); - } - } else if ((_1 === (22)) || (_1 === (25)) || (_1 === (23)) || (_1 === (24)) || (_1 === (26)) || (_1 === (27)) || (_1 === (30)) || (_1 === (28)) || (_1 === (29)) || (_1 === (31))) { - if ((offset === 0) && ((std === 22) || (std === 25) || (std === 23) || (std === 24) || (std === 26))) { - b = $append(b, 90); - break; - } - zone$1 = (_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - absoffset = offset; - if (zone$1 < 0) { - b = $append(b, 45); - zone$1 = -zone$1; - absoffset = -absoffset; - } else { - b = $append(b, 43); - } - b = appendInt(b, (_q$1 = zone$1 / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 2); - if ((std === 25) || (std === 30) || (std === 26) || (std === 31)) { - b = $append(b, 58); - } - if (!((std === 29)) && !((std === 24))) { - b = appendInt(b, (_r$4 = zone$1 % 60, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")), 2); - } - if ((std === 23) || (std === 28) || (std === 31) || (std === 26)) { - if ((std === 31) || (std === 26)) { - b = $append(b, 58); - } - b = appendInt(b, (_r$5 = absoffset % 60, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")), 2); - } - } else if (_1 === (21)) { - if (!(name === "")) { - b = $appendSlice(b, name); - break; - } - zone$2 = (_q$2 = offset / 60, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")); - if (zone$2 < 0) { - b = $append(b, 45); - zone$2 = -zone$2; - } else { - b = $append(b, 43); - } - b = appendInt(b, (_q$3 = zone$2 / 60, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")), 2); - b = appendInt(b, (_r$6 = zone$2 % 60, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")), 2); - } else if ((_1 === (32)) || (_1 === (33))) { - b = formatNano(b, (($clone(t, Time).Nanosecond() >>> 0)), std >> 16 >> 0, (std & 65535) === 33); - } - } - } - $s = -1; return b; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AppendFormat }; } $f._1 = _1; $f._q = _q; $f._q$1 = _q$1; $f._q$2 = _q$2; $f._q$3 = _q$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.abs = abs; $f.absoffset = absoffset; $f.b = b; $f.day = day; $f.hour = hour; $f.hr = hr; $f.hr$1 = hr$1; $f.layout = layout; $f.m = m; $f.min = min; $f.month = month; $f.name = name; $f.offset = offset; $f.prefix = prefix; $f.s = s; $f.sec = sec; $f.std = std; $f.suffix = suffix; $f.t = t; $f.y = y; $f.year = year; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.AppendFormat = function(b, layout) { return this.$val.AppendFormat(b, layout); }; - quote = function(s) { - var s; - return "\"" + s + "\""; - }; - ParseError.ptr.prototype.Error = function() { - var e; - e = this; - if (e.Message === "") { - return "parsing time " + quote(e.Value) + " as " + quote(e.Layout) + ": cannot parse " + quote(e.ValueElem) + " as " + quote(e.LayoutElem); - } - return "parsing time " + quote(e.Value) + e.Message; - }; - ParseError.prototype.Error = function() { return this.$val.Error(); }; - isDigit = function(s, i) { - var c, i, s; - if (s.length <= i) { - return false; - } - c = s.charCodeAt(i); - return 48 <= c && c <= 57; - }; - getnum = function(s, fixed) { - var fixed, s; - if (!isDigit(s, 0)) { - return [0, s, errBad]; - } - if (!isDigit(s, 1)) { - if (fixed) { - return [0, s, errBad]; - } - return [(((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0)), $substring(s, 1), $ifaceNil]; - } - return [($imul((((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0)), 10)) + (((s.charCodeAt(1) - 48 << 24 >>> 24) >> 0)) >> 0, $substring(s, 2), $ifaceNil]; - }; - cutspace = function(s) { - var s; - while (true) { - if (!(s.length > 0 && (s.charCodeAt(0) === 32))) { break; } - s = $substring(s, 1); - } - return s; - }; - skip = function(value, prefix) { - var prefix, value; - while (true) { - if (!(prefix.length > 0)) { break; } - if (prefix.charCodeAt(0) === 32) { - if (value.length > 0 && !((value.charCodeAt(0) === 32))) { - return [value, errBad]; - } - prefix = cutspace(prefix); - value = cutspace(value); - continue; - } - if ((value.length === 0) || !((value.charCodeAt(0) === prefix.charCodeAt(0)))) { - return [value, errBad]; - } - prefix = $substring(prefix, 1); - value = $substring(value, 1); - } - return [value, $ifaceNil]; - }; - Parse = function(layout, value) { - var _r, layout, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; layout = $f.layout; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = parse(layout, value, $pkg.UTC, $pkg.Local); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Parse }; } $f._r = _r; $f.layout = layout; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Parse = Parse; - parse = function(layout, value, defaultLocation, local) { - var _1, _2, _3, _4, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$17, _tuple$18, _tuple$19, _tuple$2, _tuple$20, _tuple$21, _tuple$22, _tuple$23, _tuple$24, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, alayout, amSet, avalue, day, defaultLocation, err, hour, hour$1, hr, i, layout, local, min, min$1, mm, month, n, n$1, name, ndigit, nsec, offset, offset$1, ok, ok$1, p, pmSet, prefix, rangeErrString, sec, seconds, sign, ss, std, stdstr, suffix, t, t$1, value, x, x$1, year, z, zoneName, zoneOffset, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _tmp$12 = $f._tmp$12; _tmp$13 = $f._tmp$13; _tmp$14 = $f._tmp$14; _tmp$15 = $f._tmp$15; _tmp$16 = $f._tmp$16; _tmp$17 = $f._tmp$17; _tmp$18 = $f._tmp$18; _tmp$19 = $f._tmp$19; _tmp$2 = $f._tmp$2; _tmp$20 = $f._tmp$20; _tmp$21 = $f._tmp$21; _tmp$22 = $f._tmp$22; _tmp$23 = $f._tmp$23; _tmp$24 = $f._tmp$24; _tmp$25 = $f._tmp$25; _tmp$26 = $f._tmp$26; _tmp$27 = $f._tmp$27; _tmp$28 = $f._tmp$28; _tmp$29 = $f._tmp$29; _tmp$3 = $f._tmp$3; _tmp$30 = $f._tmp$30; _tmp$31 = $f._tmp$31; _tmp$32 = $f._tmp$32; _tmp$33 = $f._tmp$33; _tmp$34 = $f._tmp$34; _tmp$35 = $f._tmp$35; _tmp$36 = $f._tmp$36; _tmp$37 = $f._tmp$37; _tmp$38 = $f._tmp$38; _tmp$39 = $f._tmp$39; _tmp$4 = $f._tmp$4; _tmp$40 = $f._tmp$40; _tmp$41 = $f._tmp$41; _tmp$42 = $f._tmp$42; _tmp$43 = $f._tmp$43; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$10 = $f._tuple$10; _tuple$11 = $f._tuple$11; _tuple$12 = $f._tuple$12; _tuple$13 = $f._tuple$13; _tuple$14 = $f._tuple$14; _tuple$15 = $f._tuple$15; _tuple$16 = $f._tuple$16; _tuple$17 = $f._tuple$17; _tuple$18 = $f._tuple$18; _tuple$19 = $f._tuple$19; _tuple$2 = $f._tuple$2; _tuple$20 = $f._tuple$20; _tuple$21 = $f._tuple$21; _tuple$22 = $f._tuple$22; _tuple$23 = $f._tuple$23; _tuple$24 = $f._tuple$24; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; alayout = $f.alayout; amSet = $f.amSet; avalue = $f.avalue; day = $f.day; defaultLocation = $f.defaultLocation; err = $f.err; hour = $f.hour; hour$1 = $f.hour$1; hr = $f.hr; i = $f.i; layout = $f.layout; local = $f.local; min = $f.min; min$1 = $f.min$1; mm = $f.mm; month = $f.month; n = $f.n; n$1 = $f.n$1; name = $f.name; ndigit = $f.ndigit; nsec = $f.nsec; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; pmSet = $f.pmSet; prefix = $f.prefix; rangeErrString = $f.rangeErrString; sec = $f.sec; seconds = $f.seconds; sign = $f.sign; ss = $f.ss; std = $f.std; stdstr = $f.stdstr; suffix = $f.suffix; t = $f.t; t$1 = $f.t$1; value = $f.value; x = $f.x; x$1 = $f.x$1; year = $f.year; z = $f.z; zoneName = $f.zoneName; zoneOffset = $f.zoneOffset; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _tmp = layout; - _tmp$1 = value; - alayout = _tmp; - avalue = _tmp$1; - rangeErrString = ""; - amSet = false; - pmSet = false; - year = 0; - month = 1; - day = 1; - hour = 0; - min = 0; - sec = 0; - nsec = 0; - z = ptrType$2.nil; - zoneOffset = -1; - zoneName = ""; - while (true) { - err = $ifaceNil; - _tuple = nextStdChunk(layout); - prefix = _tuple[0]; - std = _tuple[1]; - suffix = _tuple[2]; - stdstr = $substring(layout, prefix.length, (layout.length - suffix.length >> 0)); - _tuple$1 = skip(value, prefix); - value = _tuple$1[0]; - err = _tuple$1[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, prefix, value, "")]; - } - if (std === 0) { - if (!((value.length === 0))) { - $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": extra text: " + value)]; - } - break; - } - layout = suffix; - p = ""; - switch (0) { default: - _1 = std & 65535; - if (_1 === (274)) { - if (value.length < 2) { - err = errBad; - break; - } - _tmp$2 = $substring(value, 0, 2); - _tmp$3 = $substring(value, 2); - p = _tmp$2; - value = _tmp$3; - _tuple$2 = atoi(p); - year = _tuple$2[0]; - err = _tuple$2[1]; - if (year >= 69) { - year = year + (1900) >> 0; - } else { - year = year + (2000) >> 0; - } - } else if (_1 === (273)) { - if (value.length < 4 || !isDigit(value, 0)) { - err = errBad; - break; - } - _tmp$4 = $substring(value, 0, 4); - _tmp$5 = $substring(value, 4); - p = _tmp$4; - value = _tmp$5; - _tuple$3 = atoi(p); - year = _tuple$3[0]; - err = _tuple$3[1]; - } else if (_1 === (258)) { - _tuple$4 = lookup(shortMonthNames, value); - month = _tuple$4[0]; - value = _tuple$4[1]; - err = _tuple$4[2]; - month = month + (1) >> 0; - } else if (_1 === (257)) { - _tuple$5 = lookup(longMonthNames, value); - month = _tuple$5[0]; - value = _tuple$5[1]; - err = _tuple$5[2]; - month = month + (1) >> 0; - } else if ((_1 === (259)) || (_1 === (260))) { - _tuple$6 = getnum(value, std === 260); - month = _tuple$6[0]; - value = _tuple$6[1]; - err = _tuple$6[2]; - if (month <= 0 || 12 < month) { - rangeErrString = "month"; - } - } else if (_1 === (262)) { - _tuple$7 = lookup(shortDayNames, value); - value = _tuple$7[1]; - err = _tuple$7[2]; - } else if (_1 === (261)) { - _tuple$8 = lookup(longDayNames, value); - value = _tuple$8[1]; - err = _tuple$8[2]; - } else if ((_1 === (263)) || (_1 === (264)) || (_1 === (265))) { - if ((std === 264) && value.length > 0 && (value.charCodeAt(0) === 32)) { - value = $substring(value, 1); - } - _tuple$9 = getnum(value, std === 265); - day = _tuple$9[0]; - value = _tuple$9[1]; - err = _tuple$9[2]; - if (day < 0) { - rangeErrString = "day"; - } - } else if (_1 === (522)) { - _tuple$10 = getnum(value, false); - hour = _tuple$10[0]; - value = _tuple$10[1]; - err = _tuple$10[2]; - if (hour < 0 || 24 <= hour) { - rangeErrString = "hour"; - } - } else if ((_1 === (523)) || (_1 === (524))) { - _tuple$11 = getnum(value, std === 524); - hour = _tuple$11[0]; - value = _tuple$11[1]; - err = _tuple$11[2]; - if (hour < 0 || 12 < hour) { - rangeErrString = "hour"; - } - } else if ((_1 === (525)) || (_1 === (526))) { - _tuple$12 = getnum(value, std === 526); - min = _tuple$12[0]; - value = _tuple$12[1]; - err = _tuple$12[2]; - if (min < 0 || 60 <= min) { - rangeErrString = "minute"; - } - } else if ((_1 === (527)) || (_1 === (528))) { - _tuple$13 = getnum(value, std === 528); - sec = _tuple$13[0]; - value = _tuple$13[1]; - err = _tuple$13[2]; - if (sec < 0 || 60 <= sec) { - rangeErrString = "second"; - break; - } - if (value.length >= 2 && (value.charCodeAt(0) === 46) && isDigit(value, 1)) { - _tuple$14 = nextStdChunk(layout); - std = _tuple$14[1]; - std = std & (65535); - if ((std === 32) || (std === 33)) { - break; - } - n = 2; - while (true) { - if (!(n < value.length && isDigit(value, n))) { break; } - n = n + (1) >> 0; - } - _tuple$15 = parseNanoseconds(value, n); - nsec = _tuple$15[0]; - rangeErrString = _tuple$15[1]; - err = _tuple$15[2]; - value = $substring(value, n); - } - } else if (_1 === (531)) { - if (value.length < 2) { - err = errBad; - break; - } - _tmp$6 = $substring(value, 0, 2); - _tmp$7 = $substring(value, 2); - p = _tmp$6; - value = _tmp$7; - _2 = p; - if (_2 === ("PM")) { - pmSet = true; - } else if (_2 === ("AM")) { - amSet = true; - } else { - err = errBad; - } - } else if (_1 === (532)) { - if (value.length < 2) { - err = errBad; - break; - } - _tmp$8 = $substring(value, 0, 2); - _tmp$9 = $substring(value, 2); - p = _tmp$8; - value = _tmp$9; - _3 = p; - if (_3 === ("pm")) { - pmSet = true; - } else if (_3 === ("am")) { - amSet = true; - } else { - err = errBad; - } - } else if ((_1 === (22)) || (_1 === (25)) || (_1 === (23)) || (_1 === (24)) || (_1 === (26)) || (_1 === (27)) || (_1 === (29)) || (_1 === (30)) || (_1 === (28)) || (_1 === (31))) { - if (((std === 22) || (std === 24) || (std === 25)) && value.length >= 1 && (value.charCodeAt(0) === 90)) { - value = $substring(value, 1); - z = $pkg.UTC; - break; - } - _tmp$10 = ""; - _tmp$11 = ""; - _tmp$12 = ""; - _tmp$13 = ""; - sign = _tmp$10; - hour$1 = _tmp$11; - min$1 = _tmp$12; - seconds = _tmp$13; - if ((std === 25) || (std === 30)) { - if (value.length < 6) { - err = errBad; - break; - } - if (!((value.charCodeAt(3) === 58))) { - err = errBad; - break; - } - _tmp$14 = $substring(value, 0, 1); - _tmp$15 = $substring(value, 1, 3); - _tmp$16 = $substring(value, 4, 6); - _tmp$17 = "00"; - _tmp$18 = $substring(value, 6); - sign = _tmp$14; - hour$1 = _tmp$15; - min$1 = _tmp$16; - seconds = _tmp$17; - value = _tmp$18; - } else if ((std === 29) || (std === 24)) { - if (value.length < 3) { - err = errBad; - break; - } - _tmp$19 = $substring(value, 0, 1); - _tmp$20 = $substring(value, 1, 3); - _tmp$21 = "00"; - _tmp$22 = "00"; - _tmp$23 = $substring(value, 3); - sign = _tmp$19; - hour$1 = _tmp$20; - min$1 = _tmp$21; - seconds = _tmp$22; - value = _tmp$23; - } else if ((std === 26) || (std === 31)) { - if (value.length < 9) { - err = errBad; - break; - } - if (!((value.charCodeAt(3) === 58)) || !((value.charCodeAt(6) === 58))) { - err = errBad; - break; - } - _tmp$24 = $substring(value, 0, 1); - _tmp$25 = $substring(value, 1, 3); - _tmp$26 = $substring(value, 4, 6); - _tmp$27 = $substring(value, 7, 9); - _tmp$28 = $substring(value, 9); - sign = _tmp$24; - hour$1 = _tmp$25; - min$1 = _tmp$26; - seconds = _tmp$27; - value = _tmp$28; - } else if ((std === 23) || (std === 28)) { - if (value.length < 7) { - err = errBad; - break; - } - _tmp$29 = $substring(value, 0, 1); - _tmp$30 = $substring(value, 1, 3); - _tmp$31 = $substring(value, 3, 5); - _tmp$32 = $substring(value, 5, 7); - _tmp$33 = $substring(value, 7); - sign = _tmp$29; - hour$1 = _tmp$30; - min$1 = _tmp$31; - seconds = _tmp$32; - value = _tmp$33; - } else { - if (value.length < 5) { - err = errBad; - break; - } - _tmp$34 = $substring(value, 0, 1); - _tmp$35 = $substring(value, 1, 3); - _tmp$36 = $substring(value, 3, 5); - _tmp$37 = "00"; - _tmp$38 = $substring(value, 5); - sign = _tmp$34; - hour$1 = _tmp$35; - min$1 = _tmp$36; - seconds = _tmp$37; - value = _tmp$38; - } - _tmp$39 = 0; - _tmp$40 = 0; - _tmp$41 = 0; - hr = _tmp$39; - mm = _tmp$40; - ss = _tmp$41; - _tuple$16 = atoi(hour$1); - hr = _tuple$16[0]; - err = _tuple$16[1]; - if ($interfaceIsEqual(err, $ifaceNil)) { - _tuple$17 = atoi(min$1); - mm = _tuple$17[0]; - err = _tuple$17[1]; - } - if ($interfaceIsEqual(err, $ifaceNil)) { - _tuple$18 = atoi(seconds); - ss = _tuple$18[0]; - err = _tuple$18[1]; - } - zoneOffset = ($imul(((($imul(hr, 60)) + mm >> 0)), 60)) + ss >> 0; - _4 = sign.charCodeAt(0); - if (_4 === (43)) { - } else if (_4 === (45)) { - zoneOffset = -zoneOffset; - } else { - err = errBad; - } - } else if (_1 === (21)) { - if (value.length >= 3 && $substring(value, 0, 3) === "UTC") { - z = $pkg.UTC; - value = $substring(value, 3); - break; - } - _tuple$19 = parseTimeZone(value); - n$1 = _tuple$19[0]; - ok = _tuple$19[1]; - if (!ok) { - err = errBad; - break; - } - _tmp$42 = $substring(value, 0, n$1); - _tmp$43 = $substring(value, n$1); - zoneName = _tmp$42; - value = _tmp$43; - } else if (_1 === (32)) { - ndigit = 1 + ((std >> 16 >> 0)) >> 0; - if (value.length < ndigit) { - err = errBad; - break; - } - _tuple$20 = parseNanoseconds(value, ndigit); - nsec = _tuple$20[0]; - rangeErrString = _tuple$20[1]; - err = _tuple$20[2]; - value = $substring(value, ndigit); - } else if (_1 === (33)) { - if (value.length < 2 || !((value.charCodeAt(0) === 46)) || value.charCodeAt(1) < 48 || 57 < value.charCodeAt(1)) { - break; - } - i = 0; - while (true) { - if (!(i < 9 && (i + 1 >> 0) < value.length && 48 <= value.charCodeAt((i + 1 >> 0)) && value.charCodeAt((i + 1 >> 0)) <= 57)) { break; } - i = i + (1) >> 0; - } - _tuple$21 = parseNanoseconds(value, 1 + i >> 0); - nsec = _tuple$21[0]; - rangeErrString = _tuple$21[1]; - err = _tuple$21[2]; - value = $substring(value, (1 + i >> 0)); - } - } - if (!(rangeErrString === "")) { - $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, ": " + rangeErrString + " out of range")]; - } - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, "")]; - } - } - if (pmSet && hour < 12) { - hour = hour + (12) >> 0; - } else if (amSet && (hour === 12)) { - hour = 0; - } - if (day < 1 || day > daysIn(((month >> 0)), year)) { - $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day out of range")]; - } - /* */ if (!(z === ptrType$2.nil)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!(z === ptrType$2.nil)) { */ case 1: - _r = Date(year, ((month >> 0)), day, hour, min, sec, nsec, z); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return [_r, $ifaceNil]; - /* } */ case 2: - /* */ if (!((zoneOffset === -1))) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (!((zoneOffset === -1))) { */ case 4: - _r$1 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - t = $clone(_r$1, Time); - t.addSec((x = (new $Int64(0, zoneOffset)), new $Int64(-x.$high, -x.$low))); - _r$2 = local.lookup(t.unixSec()); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$22 = _r$2; - name = _tuple$22[0]; - offset = _tuple$22[1]; - if ((offset === zoneOffset) && (zoneName === "" || name === zoneName)) { - t.setLoc(local); - $s = -1; return [t, $ifaceNil]; - } - t.setLoc(FixedZone(zoneName, zoneOffset)); - $s = -1; return [t, $ifaceNil]; - /* } */ case 5: - /* */ if (!(zoneName === "")) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (!(zoneName === "")) { */ case 8: - _r$3 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - t$1 = $clone(_r$3, Time); - _r$4 = local.lookupName(zoneName, t$1.unixSec()); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _tuple$23 = _r$4; - offset$1 = _tuple$23[0]; - ok$1 = _tuple$23[1]; - if (ok$1) { - t$1.addSec((x$1 = (new $Int64(0, offset$1)), new $Int64(-x$1.$high, -x$1.$low))); - t$1.setLoc(local); - $s = -1; return [t$1, $ifaceNil]; - } - if (zoneName.length > 3 && $substring(zoneName, 0, 3) === "GMT") { - _tuple$24 = atoi($substring(zoneName, 3)); - offset$1 = _tuple$24[0]; - offset$1 = $imul(offset$1, (3600)); - } - t$1.setLoc(FixedZone(zoneName, offset$1)); - $s = -1; return [t$1, $ifaceNil]; - /* } */ case 9: - _r$5 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, defaultLocation); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - $s = -1; return [_r$5, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: parse }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $f._tmp$12 = _tmp$12; $f._tmp$13 = _tmp$13; $f._tmp$14 = _tmp$14; $f._tmp$15 = _tmp$15; $f._tmp$16 = _tmp$16; $f._tmp$17 = _tmp$17; $f._tmp$18 = _tmp$18; $f._tmp$19 = _tmp$19; $f._tmp$2 = _tmp$2; $f._tmp$20 = _tmp$20; $f._tmp$21 = _tmp$21; $f._tmp$22 = _tmp$22; $f._tmp$23 = _tmp$23; $f._tmp$24 = _tmp$24; $f._tmp$25 = _tmp$25; $f._tmp$26 = _tmp$26; $f._tmp$27 = _tmp$27; $f._tmp$28 = _tmp$28; $f._tmp$29 = _tmp$29; $f._tmp$3 = _tmp$3; $f._tmp$30 = _tmp$30; $f._tmp$31 = _tmp$31; $f._tmp$32 = _tmp$32; $f._tmp$33 = _tmp$33; $f._tmp$34 = _tmp$34; $f._tmp$35 = _tmp$35; $f._tmp$36 = _tmp$36; $f._tmp$37 = _tmp$37; $f._tmp$38 = _tmp$38; $f._tmp$39 = _tmp$39; $f._tmp$4 = _tmp$4; $f._tmp$40 = _tmp$40; $f._tmp$41 = _tmp$41; $f._tmp$42 = _tmp$42; $f._tmp$43 = _tmp$43; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$10 = _tuple$10; $f._tuple$11 = _tuple$11; $f._tuple$12 = _tuple$12; $f._tuple$13 = _tuple$13; $f._tuple$14 = _tuple$14; $f._tuple$15 = _tuple$15; $f._tuple$16 = _tuple$16; $f._tuple$17 = _tuple$17; $f._tuple$18 = _tuple$18; $f._tuple$19 = _tuple$19; $f._tuple$2 = _tuple$2; $f._tuple$20 = _tuple$20; $f._tuple$21 = _tuple$21; $f._tuple$22 = _tuple$22; $f._tuple$23 = _tuple$23; $f._tuple$24 = _tuple$24; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f.alayout = alayout; $f.amSet = amSet; $f.avalue = avalue; $f.day = day; $f.defaultLocation = defaultLocation; $f.err = err; $f.hour = hour; $f.hour$1 = hour$1; $f.hr = hr; $f.i = i; $f.layout = layout; $f.local = local; $f.min = min; $f.min$1 = min$1; $f.mm = mm; $f.month = month; $f.n = n; $f.n$1 = n$1; $f.name = name; $f.ndigit = ndigit; $f.nsec = nsec; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.pmSet = pmSet; $f.prefix = prefix; $f.rangeErrString = rangeErrString; $f.sec = sec; $f.seconds = seconds; $f.sign = sign; $f.ss = ss; $f.std = std; $f.stdstr = stdstr; $f.suffix = suffix; $f.t = t; $f.t$1 = t$1; $f.value = value; $f.x = x; $f.x$1 = x$1; $f.year = year; $f.z = z; $f.zoneName = zoneName; $f.zoneOffset = zoneOffset; $f.$s = $s; $f.$r = $r; return $f; - }; - parseTimeZone = function(value) { - var _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c, length, nUpper, ok, value; - length = 0; + Location.prototype.firstZoneUsed = function() { return this.$val.firstZoneUsed(); }; + tzset = function(s, initEnd, sec) { + var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$44, _tmp$45, _tmp$46, _tmp$47, _tmp$48, _tmp$49, _tmp$5, _tmp$50, _tmp$51, _tmp$52, _tmp$53, _tmp$54, _tmp$55, _tmp$56, _tmp$57, _tmp$58, _tmp$59, _tmp$6, _tmp$60, _tmp$61, _tmp$62, _tmp$63, _tmp$64, _tmp$65, _tmp$66, _tmp$67, _tmp$68, _tmp$69, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, abs, d, dstIsDST, dstName, dstOffset, end, endRule, endSec, initEnd, isDST, name, offset, ok, s, sec, start, startRule, startSec, stdIsDST, stdName, stdOffset, x$1, x$2, x$3, x$4, x$5, x$6, yday, year, ysec; + name = ""; + offset = 0; + start = new $Int64(0, 0); + end = new $Int64(0, 0); + isDST = false; ok = false; - if (value.length < 3) { - _tmp = 0; - _tmp$1 = false; - length = _tmp; - ok = _tmp$1; - return [length, ok]; + _tmp = ""; + _tmp$1 = ""; + stdName = _tmp; + dstName = _tmp$1; + _tmp$2 = 0; + _tmp$3 = 0; + stdOffset = _tmp$2; + dstOffset = _tmp$3; + _tuple = tzsetName(s); + stdName = _tuple[0]; + s = _tuple[1]; + ok = _tuple[2]; + if (ok) { + _tuple$1 = tzsetOffset(s); + stdOffset = _tuple$1[0]; + s = _tuple$1[1]; + ok = _tuple$1[2]; } - if (value.length >= 4 && ($substring(value, 0, 4) === "ChST" || $substring(value, 0, 4) === "MeST")) { - _tmp$2 = 4; - _tmp$3 = true; - length = _tmp$2; - ok = _tmp$3; - return [length, ok]; - } - if ($substring(value, 0, 3) === "GMT") { - length = parseGMT(value); - _tmp$4 = length; - _tmp$5 = true; - length = _tmp$4; - ok = _tmp$5; - return [length, ok]; - } - if ((value.charCodeAt(0) === 43) || (value.charCodeAt(0) === 45)) { - length = parseSignedOffset(value); - _tmp$6 = length; - _tmp$7 = true; - length = _tmp$6; - ok = _tmp$7; - return [length, ok]; - } - nUpper = 0; - nUpper = 0; - while (true) { - if (!(nUpper < 6)) { break; } - if (nUpper >= value.length) { - break; - } - c = value.charCodeAt(nUpper); - if (c < 65 || 90 < c) { - break; - } - nUpper = nUpper + (1) >> 0; - } - _1 = nUpper; - if ((_1 === (0)) || (_1 === (1)) || (_1 === (2)) || (_1 === (6))) { - _tmp$8 = 0; + if (!ok) { + _tmp$4 = ""; + _tmp$5 = 0; + _tmp$6 = new $Int64(0, 0); + _tmp$7 = new $Int64(0, 0); + _tmp$8 = false; _tmp$9 = false; - length = _tmp$8; + name = _tmp$4; + offset = _tmp$5; + start = _tmp$6; + end = _tmp$7; + isDST = _tmp$8; ok = _tmp$9; - return [length, ok]; - } else if (_1 === (5)) { - if (value.charCodeAt(4) === 84) { - _tmp$10 = 5; - _tmp$11 = true; - length = _tmp$10; - ok = _tmp$11; - return [length, ok]; - } - } else if (_1 === (4)) { - if ((value.charCodeAt(3) === 84) || $substring(value, 0, 4) === "WITA") { - _tmp$12 = 4; - _tmp$13 = true; - length = _tmp$12; - ok = _tmp$13; - return [length, ok]; - } - } else if (_1 === (3)) { - _tmp$14 = 3; + return [name, offset, start, end, isDST, ok]; + } + stdOffset = -stdOffset; + if ((s.length === 0) || (s.charCodeAt(0) === 44)) { + _tmp$10 = stdName; + _tmp$11 = stdOffset; + _tmp$12 = initEnd; + _tmp$13 = new $Int64(2147483647, 4294967295); + _tmp$14 = false; _tmp$15 = true; - length = _tmp$14; + name = _tmp$10; + offset = _tmp$11; + start = _tmp$12; + end = _tmp$13; + isDST = _tmp$14; ok = _tmp$15; - return [length, ok]; + return [name, offset, start, end, isDST, ok]; } - _tmp$16 = 0; - _tmp$17 = false; - length = _tmp$16; + _tuple$2 = tzsetName(s); + dstName = _tuple$2[0]; + s = _tuple$2[1]; + ok = _tuple$2[2]; + if (ok) { + if ((s.length === 0) || (s.charCodeAt(0) === 44)) { + dstOffset = stdOffset + 3600 >> 0; + } else { + _tuple$3 = tzsetOffset(s); + dstOffset = _tuple$3[0]; + s = _tuple$3[1]; + ok = _tuple$3[2]; + dstOffset = -dstOffset; + } + } + if (!ok) { + _tmp$16 = ""; + _tmp$17 = 0; + _tmp$18 = new $Int64(0, 0); + _tmp$19 = new $Int64(0, 0); + _tmp$20 = false; + _tmp$21 = false; + name = _tmp$16; + offset = _tmp$17; + start = _tmp$18; + end = _tmp$19; + isDST = _tmp$20; + ok = _tmp$21; + return [name, offset, start, end, isDST, ok]; + } + if (s.length === 0) { + s = ",M3.2.0,M11.1.0"; + } + if (!((s.charCodeAt(0) === 44)) && !((s.charCodeAt(0) === 59))) { + _tmp$22 = ""; + _tmp$23 = 0; + _tmp$24 = new $Int64(0, 0); + _tmp$25 = new $Int64(0, 0); + _tmp$26 = false; + _tmp$27 = false; + name = _tmp$22; + offset = _tmp$23; + start = _tmp$24; + end = _tmp$25; + isDST = _tmp$26; + ok = _tmp$27; + return [name, offset, start, end, isDST, ok]; + } + s = $substring(s, 1); + _tmp$28 = new rule.ptr(0, 0, 0, 0, 0); + _tmp$29 = new rule.ptr(0, 0, 0, 0, 0); + startRule = $clone(_tmp$28, rule); + endRule = $clone(_tmp$29, rule); + _tuple$4 = tzsetRule(s); + rule.copy(startRule, _tuple$4[0]); + s = _tuple$4[1]; + ok = _tuple$4[2]; + if (!ok || (s.length === 0) || !((s.charCodeAt(0) === 44))) { + _tmp$30 = ""; + _tmp$31 = 0; + _tmp$32 = new $Int64(0, 0); + _tmp$33 = new $Int64(0, 0); + _tmp$34 = false; + _tmp$35 = false; + name = _tmp$30; + offset = _tmp$31; + start = _tmp$32; + end = _tmp$33; + isDST = _tmp$34; + ok = _tmp$35; + return [name, offset, start, end, isDST, ok]; + } + s = $substring(s, 1); + _tuple$5 = tzsetRule(s); + rule.copy(endRule, _tuple$5[0]); + s = _tuple$5[1]; + ok = _tuple$5[2]; + if (!ok || s.length > 0) { + _tmp$36 = ""; + _tmp$37 = 0; + _tmp$38 = new $Int64(0, 0); + _tmp$39 = new $Int64(0, 0); + _tmp$40 = false; + _tmp$41 = false; + name = _tmp$36; + offset = _tmp$37; + start = _tmp$38; + end = _tmp$39; + isDST = _tmp$40; + ok = _tmp$41; + return [name, offset, start, end, isDST, ok]; + } + _tuple$6 = absDate(((x$1 = (x$2 = new $Int64(sec.$high + 14, sec.$low + 2006054656), new $Int64(x$2.$high + 2147483631, x$2.$low + 2739393024)), new $Uint64(x$1.$high, x$1.$low))), false); + year = _tuple$6[0]; + yday = _tuple$6[3]; + ysec = (x$3 = (new $Int64(0, ($imul(yday, 86400)))), x$4 = $div64(sec, new $Int64(0, 86400), true), new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)); + d = daysSinceEpoch(year); + abs = ((x$5 = $mul64(d, new $Uint64(0, 86400)), new $Int64(x$5.$high, x$5.$low))); + abs = (x$6 = new $Int64(-2147483647, 3844486912), new $Int64(abs.$high + x$6.$high, abs.$low + x$6.$low)); + startSec = (new $Int64(0, tzruleTime(year, $clone(startRule, rule), stdOffset))); + endSec = (new $Int64(0, tzruleTime(year, $clone(endRule, rule), dstOffset))); + _tmp$42 = true; + _tmp$43 = false; + dstIsDST = _tmp$42; + stdIsDST = _tmp$43; + if ((endSec.$high < startSec.$high || (endSec.$high === startSec.$high && endSec.$low < startSec.$low))) { + _tmp$44 = endSec; + _tmp$45 = startSec; + startSec = _tmp$44; + endSec = _tmp$45; + _tmp$46 = dstName; + _tmp$47 = stdName; + stdName = _tmp$46; + dstName = _tmp$47; + _tmp$48 = dstOffset; + _tmp$49 = stdOffset; + stdOffset = _tmp$48; + dstOffset = _tmp$49; + _tmp$50 = dstIsDST; + _tmp$51 = stdIsDST; + stdIsDST = _tmp$50; + dstIsDST = _tmp$51; + } + if ((ysec.$high < startSec.$high || (ysec.$high === startSec.$high && ysec.$low < startSec.$low))) { + _tmp$52 = stdName; + _tmp$53 = stdOffset; + _tmp$54 = abs; + _tmp$55 = new $Int64(startSec.$high + abs.$high, startSec.$low + abs.$low); + _tmp$56 = stdIsDST; + _tmp$57 = true; + name = _tmp$52; + offset = _tmp$53; + start = _tmp$54; + end = _tmp$55; + isDST = _tmp$56; + ok = _tmp$57; + return [name, offset, start, end, isDST, ok]; + } else if ((ysec.$high > endSec.$high || (ysec.$high === endSec.$high && ysec.$low >= endSec.$low))) { + _tmp$58 = stdName; + _tmp$59 = stdOffset; + _tmp$60 = new $Int64(endSec.$high + abs.$high, endSec.$low + abs.$low); + _tmp$61 = new $Int64(abs.$high + 0, abs.$low + 31536000); + _tmp$62 = stdIsDST; + _tmp$63 = true; + name = _tmp$58; + offset = _tmp$59; + start = _tmp$60; + end = _tmp$61; + isDST = _tmp$62; + ok = _tmp$63; + return [name, offset, start, end, isDST, ok]; + } else { + _tmp$64 = dstName; + _tmp$65 = dstOffset; + _tmp$66 = new $Int64(startSec.$high + abs.$high, startSec.$low + abs.$low); + _tmp$67 = new $Int64(endSec.$high + abs.$high, endSec.$low + abs.$low); + _tmp$68 = dstIsDST; + _tmp$69 = true; + name = _tmp$64; + offset = _tmp$65; + start = _tmp$66; + end = _tmp$67; + isDST = _tmp$68; + ok = _tmp$69; + return [name, offset, start, end, isDST, ok]; + } + }; + tzsetName = function(s) { + var _1, _i, _i$1, _ref, _ref$1, _rune, _rune$1, i, i$1, r, r$1, s; + if (s.length === 0) { + return ["", "", false]; + } + if (!((s.charCodeAt(0) === 60))) { + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + r = _rune[0]; + _1 = r; + if ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55)) || (_1 === (56)) || (_1 === (57)) || (_1 === (44)) || (_1 === (45)) || (_1 === (43))) { + if (i < 3) { + return ["", "", false]; + } + return [$substring(s, 0, i), $substring(s, i), true]; + } + _i += _rune[1]; + } + if (s.length < 3) { + return ["", "", false]; + } + return [s, "", true]; + } else { + _ref$1 = s; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.length)) { break; } + _rune$1 = $decodeRune(_ref$1, _i$1); + i$1 = _i$1; + r$1 = _rune$1[0]; + if (r$1 === 62) { + return [$substring(s, 1, i$1), $substring(s, (i$1 + 1 >> 0)), true]; + } + _i$1 += _rune$1[1]; + } + return ["", "", false]; + } + }; + tzsetOffset = function(s) { + var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, hours, mins, neg, off, offset, ok, rest, s, secs; + offset = 0; + rest = ""; + ok = false; + if (s.length === 0) { + _tmp = 0; + _tmp$1 = ""; + _tmp$2 = false; + offset = _tmp; + rest = _tmp$1; + ok = _tmp$2; + return [offset, rest, ok]; + } + neg = false; + if (s.charCodeAt(0) === 43) { + s = $substring(s, 1); + } else if (s.charCodeAt(0) === 45) { + s = $substring(s, 1); + neg = true; + } + hours = 0; + _tuple = tzsetNum(s, 0, 168); + hours = _tuple[0]; + s = _tuple[1]; + ok = _tuple[2]; + if (!ok) { + _tmp$3 = 0; + _tmp$4 = ""; + _tmp$5 = false; + offset = _tmp$3; + rest = _tmp$4; + ok = _tmp$5; + return [offset, rest, ok]; + } + off = $imul(hours, 3600); + if ((s.length === 0) || !((s.charCodeAt(0) === 58))) { + if (neg) { + off = -off; + } + _tmp$6 = off; + _tmp$7 = s; + _tmp$8 = true; + offset = _tmp$6; + rest = _tmp$7; + ok = _tmp$8; + return [offset, rest, ok]; + } + mins = 0; + _tuple$1 = tzsetNum($substring(s, 1), 0, 59); + mins = _tuple$1[0]; + s = _tuple$1[1]; + ok = _tuple$1[2]; + if (!ok) { + _tmp$9 = 0; + _tmp$10 = ""; + _tmp$11 = false; + offset = _tmp$9; + rest = _tmp$10; + ok = _tmp$11; + return [offset, rest, ok]; + } + off = off + (($imul(mins, 60))) >> 0; + if ((s.length === 0) || !((s.charCodeAt(0) === 58))) { + if (neg) { + off = -off; + } + _tmp$12 = off; + _tmp$13 = s; + _tmp$14 = true; + offset = _tmp$12; + rest = _tmp$13; + ok = _tmp$14; + return [offset, rest, ok]; + } + secs = 0; + _tuple$2 = tzsetNum($substring(s, 1), 0, 59); + secs = _tuple$2[0]; + s = _tuple$2[1]; + ok = _tuple$2[2]; + if (!ok) { + _tmp$15 = 0; + _tmp$16 = ""; + _tmp$17 = false; + offset = _tmp$15; + rest = _tmp$16; + ok = _tmp$17; + return [offset, rest, ok]; + } + off = off + (secs) >> 0; + if (neg) { + off = -off; + } + _tmp$18 = off; + _tmp$19 = s; + _tmp$20 = true; + offset = _tmp$18; + rest = _tmp$19; + ok = _tmp$20; + return [offset, rest, ok]; + }; + tzsetRule = function(s) { + var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, day, day$1, jday, mon, offset, ok, r, s, week; + r = new rule.ptr(0, 0, 0, 0, 0); + if (s.length === 0) { + return [new rule.ptr(0, 0, 0, 0, 0), "", false]; + } + ok = false; + if (s.charCodeAt(0) === 74) { + jday = 0; + _tuple = tzsetNum($substring(s, 1), 1, 365); + jday = _tuple[0]; + s = _tuple[1]; + ok = _tuple[2]; + if (!ok) { + return [new rule.ptr(0, 0, 0, 0, 0), "", false]; + } + r.kind = 0; + r.day = jday; + } else if (s.charCodeAt(0) === 77) { + mon = 0; + _tuple$1 = tzsetNum($substring(s, 1), 1, 12); + mon = _tuple$1[0]; + s = _tuple$1[1]; + ok = _tuple$1[2]; + if (!ok || (s.length === 0) || !((s.charCodeAt(0) === 46))) { + return [new rule.ptr(0, 0, 0, 0, 0), "", false]; + } + week = 0; + _tuple$2 = tzsetNum($substring(s, 1), 1, 5); + week = _tuple$2[0]; + s = _tuple$2[1]; + ok = _tuple$2[2]; + if (!ok || (s.length === 0) || !((s.charCodeAt(0) === 46))) { + return [new rule.ptr(0, 0, 0, 0, 0), "", false]; + } + day = 0; + _tuple$3 = tzsetNum($substring(s, 1), 0, 6); + day = _tuple$3[0]; + s = _tuple$3[1]; + ok = _tuple$3[2]; + if (!ok) { + return [new rule.ptr(0, 0, 0, 0, 0), "", false]; + } + r.kind = 2; + r.day = day; + r.week = week; + r.mon = mon; + } else { + day$1 = 0; + _tuple$4 = tzsetNum(s, 0, 365); + day$1 = _tuple$4[0]; + s = _tuple$4[1]; + ok = _tuple$4[2]; + if (!ok) { + return [new rule.ptr(0, 0, 0, 0, 0), "", false]; + } + r.kind = 1; + r.day = day$1; + } + if ((s.length === 0) || !((s.charCodeAt(0) === 47))) { + r.time = 7200; + return [r, s, true]; + } + _tuple$5 = tzsetOffset($substring(s, 1)); + offset = _tuple$5[0]; + s = _tuple$5[1]; + ok = _tuple$5[2]; + if (!ok) { + return [new rule.ptr(0, 0, 0, 0, 0), "", false]; + } + r.time = offset; + return [r, s, true]; + }; + tzsetNum = function(s, min, max) { + var _i, _ref, _rune, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, i, max, min, num, ok, r, rest, s; + num = 0; + rest = ""; + ok = false; + if (s.length === 0) { + _tmp = 0; + _tmp$1 = ""; + _tmp$2 = false; + num = _tmp; + rest = _tmp$1; + ok = _tmp$2; + return [num, rest, ok]; + } + num = 0; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + r = _rune[0]; + if (r < 48 || r > 57) { + if ((i === 0) || num < min) { + _tmp$3 = 0; + _tmp$4 = ""; + _tmp$5 = false; + num = _tmp$3; + rest = _tmp$4; + ok = _tmp$5; + return [num, rest, ok]; + } + _tmp$6 = num; + _tmp$7 = $substring(s, i); + _tmp$8 = true; + num = _tmp$6; + rest = _tmp$7; + ok = _tmp$8; + return [num, rest, ok]; + } + num = $imul(num, (10)); + num = num + ((((r >> 0)) - 48 >> 0)) >> 0; + if (num > max) { + _tmp$9 = 0; + _tmp$10 = ""; + _tmp$11 = false; + num = _tmp$9; + rest = _tmp$10; + ok = _tmp$11; + return [num, rest, ok]; + } + _i += _rune[1]; + } + if (num < min) { + _tmp$12 = 0; + _tmp$13 = ""; + _tmp$14 = false; + num = _tmp$12; + rest = _tmp$13; + ok = _tmp$14; + return [num, rest, ok]; + } + _tmp$15 = num; + _tmp$16 = ""; + _tmp$17 = true; + num = _tmp$15; + rest = _tmp$16; ok = _tmp$17; - return [length, ok]; + return [num, rest, ok]; }; - parseGMT = function(value) { - var value; - value = $substring(value, 3); - if (value.length === 0) { - return 3; + tzruleTime = function(year, r, off) { + var _1, _q, _q$1, _q$2, _q$3, _r$1, _r$2, _r$3, d, dow, i, m1, off, r, s, x$1, year, yy0, yy1, yy2; + s = 0; + _1 = r.kind; + if (_1 === (0)) { + s = $imul(((r.day - 1 >> 0)), 86400); + if (isLeap(year) && r.day >= 60) { + s = s + (86400) >> 0; + } + } else if (_1 === (1)) { + s = $imul(r.day, 86400); + } else if (_1 === (2)) { + m1 = (_r$1 = ((r.mon + 9 >> 0)) % 12, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; + yy0 = year; + if (r.mon <= 2) { + yy0 = yy0 - (1) >> 0; + } + yy1 = (_q = yy0 / 100, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + yy2 = (_r$2 = yy0 % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")); + dow = (_r$3 = (((((((_q$1 = ((($imul(26, m1)) - 2 >> 0)) / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0) + yy2 >> 0) + (_q$2 = yy2 / 4, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) + (_q$3 = yy1 / 4, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) - ($imul(2, yy1)) >> 0)) % 7, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); + if (dow < 0) { + dow = dow + (7) >> 0; + } + d = r.day - dow >> 0; + if (d < 0) { + d = d + (7) >> 0; + } + i = 1; + while (true) { + if (!(i < r.week)) { break; } + if ((d + 7 >> 0) >= daysIn(((r.mon >> 0)), year)) { + break; + } + d = d + (7) >> 0; + i = i + (1) >> 0; + } + d = d + ((((x$1 = r.mon - 1 >> 0, ((x$1 < 0 || x$1 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$1])) >> 0))) >> 0; + if (isLeap(year) && r.mon > 2) { + d = d + (1) >> 0; + } + s = $imul(d, 86400); } - return 3 + parseSignedOffset(value) >> 0; + return (s + r.time >> 0) - off >> 0; }; - parseSignedOffset = function(value) { - var _tuple, err, rem, sign, value, x; - sign = value.charCodeAt(0); - if (!((sign === 45)) && !((sign === 43))) { - return 0; - } - _tuple = leadingInt($substring(value, 1)); - x = _tuple[0]; - rem = _tuple[1]; - err = _tuple[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return 0; - } - if (sign === 45) { - x = new $Int64(-x.$high, -x.$low); - } - if ((x.$high === 0 && x.$low === 0) || (x.$high < -1 || (x.$high === -1 && x.$low < 4294967282)) || (0 < x.$high || (0 === x.$high && 12 < x.$low))) { - return 0; - } - return value.length - rem.length >> 0; - }; - parseNanoseconds = function(value, nbytes) { - var _tuple, err, i, nbytes, ns, rangeErrString, scaleDigits, value; - ns = 0; - rangeErrString = ""; - err = $ifaceNil; - if (!((value.charCodeAt(0) === 46))) { - err = errBad; - return [ns, rangeErrString, err]; - } - _tuple = atoi($substring(value, 1, nbytes)); - ns = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [ns, rangeErrString, err]; - } - if (ns < 0 || 1000000000 <= ns) { - rangeErrString = "fractional second"; - return [ns, rangeErrString, err]; - } - scaleDigits = 10 - nbytes >> 0; - i = 0; + Location.ptr.prototype.lookupName = function(name, unix) { + var {_i, _i$1, _r$1, _r$2, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, i, i$1, l, nam, name, offset, offset$1, ok, unix, x$1, x$2, x$3, zone$1, zone$2, $s, $r, $c} = $restore(this, {name, unix}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + offset = 0; + ok = false; + l = this; + _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; + _ref = l.zone; + _i = 0; + /* while (true) { */ case 2: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } + i = _i; + zone$1 = (x$1 = l.zone, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])); + /* */ if (zone$1.name === name) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (zone$1.name === name) { */ case 4: + _r$2 = l.lookup((x$2 = (new $Int64(0, zone$1.offset)), new $Int64(unix.$high - x$2.$high, unix.$low - x$2.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; + nam = _tuple[0]; + offset$1 = _tuple[1]; + if (nam === zone$1.name) { + _tmp = offset$1; + _tmp$1 = true; + offset = _tmp; + ok = _tmp$1; + $s = -1; return [offset, ok]; + } + /* } */ case 5: + _i++; + $s = 2; continue; + case 3: + _ref$1 = l.zone; + _i$1 = 0; while (true) { - if (!(i < scaleDigits)) { break; } - ns = $imul(ns, (10)); - i = i + (1) >> 0; - } - return [ns, rangeErrString, err]; - }; - leadingInt = function(s) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, c, err, i, rem, s, x, x$1, x$2, x$3; - x = new $Int64(0, 0); - rem = ""; - err = $ifaceNil; - i = 0; - while (true) { - if (!(i < s.length)) { break; } - c = s.charCodeAt(i); - if (c < 48 || c > 57) { - break; + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + zone$2 = (x$3 = l.zone, ((i$1 < 0 || i$1 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i$1])); + if (zone$2.name === name) { + _tmp$2 = zone$2.offset; + _tmp$3 = true; + offset = _tmp$2; + ok = _tmp$3; + $s = -1; return [offset, ok]; } - if ((x.$high > 214748364 || (x.$high === 214748364 && x.$low > 3435973836))) { - _tmp = new $Int64(0, 0); - _tmp$1 = ""; - _tmp$2 = errLeadingInt; - x = _tmp; - rem = _tmp$1; - err = _tmp$2; - return [x, rem, err]; - } - x = (x$1 = (x$2 = $mul64(x, new $Int64(0, 10)), x$3 = (new $Int64(0, c)), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), new $Int64(x$1.$high - 0, x$1.$low - 48)); - if ((x.$high < 0 || (x.$high === 0 && x.$low < 0))) { - _tmp$3 = new $Int64(0, 0); - _tmp$4 = ""; - _tmp$5 = errLeadingInt; - x = _tmp$3; - rem = _tmp$4; - err = _tmp$5; - return [x, rem, err]; - } - i = i + (1) >> 0; + _i$1++; } - _tmp$6 = x; - _tmp$7 = $substring(s, i); - _tmp$8 = $ifaceNil; - x = _tmp$6; - rem = _tmp$7; - err = _tmp$8; - return [x, rem, err]; - }; - when = function(d) { - var d, t, x, x$1; - if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { - return runtimeNano(); - } - t = (x = runtimeNano(), x$1 = (new $Int64(d.$high, d.$low)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); - if ((t.$high < 0 || (t.$high === 0 && t.$low < 0))) { - t = new $Int64(2147483647, 4294967295); - } - return t; - }; - Timer.ptr.prototype.Stop = function() { - var t; - t = this; - if (t.r.f === $throwNilPointerError) { - $panic(new $String("time: Stop called on uninitialized Timer")); - } - return stopTimer(t.r); - }; - Timer.prototype.Stop = function() { return this.$val.Stop(); }; - Timer.ptr.prototype.Reset = function(d) { - var active, d, t, w; - t = this; - if (t.r.f === $throwNilPointerError) { - $panic(new $String("time: Reset called on uninitialized Timer")); - } - w = when(d); - active = stopTimer(t.r); - t.r.when = w; - startTimer(t.r); - return active; - }; - Timer.prototype.Reset = function(d) { return this.$val.Reset(d); }; - AfterFunc = function(d, f) { - var d, f, t; - t = new Timer.ptr($chanNil, new runtimeTimer.ptr(0, when(d), new $Int64(0, 0), goFunc, new funcType(f), null, false)); - startTimer(t.r); - return t; - }; - $pkg.AfterFunc = AfterFunc; - goFunc = function(arg, seq) { - var arg, seq; - $go($assertType(arg, funcType), []); + $s = -1; return [offset, ok]; + /* */ } return; } var $f = {$blk: Location.ptr.prototype.lookupName, $c: true, $r, _i, _i$1, _r$1, _r$2, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, i, i$1, l, nam, name, offset, offset$1, ok, unix, x$1, x$2, x$3, zone$1, zone$2, $s};return $f; }; + Location.prototype.lookupName = function(name, unix) { return this.$val.lookupName(name, unix); }; Time.ptr.prototype.nsec = function() { - var t, x; + var t, x$1; t = this; - return (((x = t.wall, new $Uint64(x.$high & 0, (x.$low & 1073741823) >>> 0)).$low >> 0)); + return (((x$1 = t.wall, new $Uint64(x$1.$high & 0, (x$1.$low & 1073741823) >>> 0)).$low >> 0)); }; Time.prototype.nsec = function() { return this.$val.nsec(); }; Time.ptr.prototype.sec = function() { - var t, x, x$1, x$2, x$3; + var t, x$1, x$2, x$3, x$4; t = this; - if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { - return (x$2 = ((x$3 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$3.$high, x$3.$low))), new $Int64(13 + x$2.$high, 3618733952 + x$2.$low)); + if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { + return (x$3 = ((x$4 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$4.$high, x$4.$low))), new $Int64(13 + x$3.$high, 3618733952 + x$3.$low)); } return t.ext; }; Time.prototype.sec = function() { return this.$val.sec(); }; Time.ptr.prototype.unixSec = function() { - var t, x; + var t, x$1; t = this; - return (x = t.sec(), new $Int64(x.$high + -15, x.$low + 2288912640)); + return (x$1 = t.sec(), new $Int64(x$1.$high + -15, x$1.$low + 2288912640)); }; Time.prototype.unixSec = function() { return this.$val.unixSec(); }; Time.ptr.prototype.addSec = function(d) { - var d, dsec, sec, t, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; + var d, dsec, sec, sum, t, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; - if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { - sec = ((x$2 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$2.$high, x$2.$low))); + if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { + sec = ((x$3 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$3.$high, x$3.$low))); dsec = new $Int64(sec.$high + d.$high, sec.$low + d.$low); if ((0 < dsec.$high || (0 === dsec.$high && 0 <= dsec.$low)) && (dsec.$high < 1 || (dsec.$high === 1 && dsec.$low <= 4294967295))) { - t.wall = (x$3 = (x$4 = (x$5 = t.wall, new $Uint64(x$5.$high & 0, (x$5.$low & 1073741823) >>> 0)), x$6 = $shiftLeft64((new $Uint64(dsec.$high, dsec.$low)), 30), new $Uint64(x$4.$high | x$6.$high, (x$4.$low | x$6.$low) >>> 0)), new $Uint64(x$3.$high | 2147483648, (x$3.$low | 0) >>> 0)); + t.wall = (x$4 = (x$5 = (x$6 = t.wall, new $Uint64(x$6.$high & 0, (x$6.$low & 1073741823) >>> 0)), x$7 = $shiftLeft64((new $Uint64(dsec.$high, dsec.$low)), 30), new $Uint64(x$5.$high | x$7.$high, (x$5.$low | x$7.$low) >>> 0)), new $Uint64(x$4.$high | 2147483648, (x$4.$low | 0) >>> 0)); return; } t.stripMono(); } - t.ext = (x$7 = t.ext, x$8 = d, new $Int64(x$7.$high + x$8.$high, x$7.$low + x$8.$low)); + sum = (x$8 = t.ext, new $Int64(x$8.$high + d.$high, x$8.$low + d.$low)); + if (((x$9 = t.ext, (sum.$high > x$9.$high || (sum.$high === x$9.$high && sum.$low > x$9.$low)))) === ((d.$high > 0 || (d.$high === 0 && d.$low > 0)))) { + t.ext = sum; + } else if ((d.$high > 0 || (d.$high === 0 && d.$low > 0))) { + t.ext = new $Int64(2147483647, 4294967295); + } else { + t.ext = new $Int64(-2147483648, 1); + } }; Time.prototype.addSec = function(d) { return this.$val.addSec(d); }; Time.ptr.prototype.setLoc = function(loc) { @@ -6640,19 +8267,19 @@ $packages["time"] = (function() { }; Time.prototype.setLoc = function(loc) { return this.$val.setLoc(loc); }; Time.ptr.prototype.stripMono = function() { - var t, x, x$1, x$2, x$3; + var t, x$1, x$2, x$3, x$4; t = this; - if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { + if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { t.ext = t.sec(); - t.wall = (x$2 = t.wall, x$3 = new $Uint64(0, 1073741823), new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); + t.wall = (x$3 = t.wall, x$4 = new $Uint64(0, 1073741823), new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)); } }; Time.prototype.stripMono = function() { return this.$val.stripMono(); }; Time.ptr.prototype.After = function(u) { - var t, ts, u, us, x, x$1, x$2, x$3, x$4, x$5; + var t, ts, u, us, x$1, x$2, x$3, x$4, x$5, x$6; t = this; - if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { - return (x$4 = t.ext, x$5 = u.ext, (x$4.$high > x$5.$high || (x$4.$high === x$5.$high && x$4.$low > x$5.$low))); + if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { + return (x$5 = t.ext, x$6 = u.ext, (x$5.$high > x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low))); } ts = t.sec(); us = u.sec(); @@ -6660,28 +8287,30 @@ $packages["time"] = (function() { }; Time.prototype.After = function(u) { return this.$val.After(u); }; Time.ptr.prototype.Before = function(u) { - var t, u, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + var t, ts, u, us, x$1, x$2, x$3, x$4, x$5, x$6; t = this; - if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { - return (x$4 = t.ext, x$5 = u.ext, (x$4.$high < x$5.$high || (x$4.$high === x$5.$high && x$4.$low < x$5.$low))); + if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { + return (x$5 = t.ext, x$6 = u.ext, (x$5.$high < x$6.$high || (x$5.$high === x$6.$high && x$5.$low < x$6.$low))); } - return (x$6 = t.sec(), x$7 = u.sec(), (x$6.$high < x$7.$high || (x$6.$high === x$7.$high && x$6.$low < x$7.$low))) || (x$8 = t.sec(), x$9 = u.sec(), (x$8.$high === x$9.$high && x$8.$low === x$9.$low)) && t.nsec() < u.nsec(); + ts = t.sec(); + us = u.sec(); + return (ts.$high < us.$high || (ts.$high === us.$high && ts.$low < us.$low)) || (ts.$high === us.$high && ts.$low === us.$low) && t.nsec() < u.nsec(); }; Time.prototype.Before = function(u) { return this.$val.Before(u); }; Time.ptr.prototype.Equal = function(u) { - var t, u, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; + var t, u, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; t = this; - if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { - return (x$4 = t.ext, x$5 = u.ext, (x$4.$high === x$5.$high && x$4.$low === x$5.$low)); + if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { + return (x$5 = t.ext, x$6 = u.ext, (x$5.$high === x$6.$high && x$5.$low === x$6.$low)); } - return (x$6 = t.sec(), x$7 = u.sec(), (x$6.$high === x$7.$high && x$6.$low === x$7.$low)) && (t.nsec() === u.nsec()); + return (x$7 = t.sec(), x$8 = u.sec(), (x$7.$high === x$8.$high && x$7.$low === x$8.$low)) && (t.nsec() === u.nsec()); }; Time.prototype.Equal = function(u) { return this.$val.Equal(u); }; Month.prototype.String = function() { - var buf, m, n, x; + var buf, m, n, x$1; m = this.$val; if (1 <= m && m <= 12) { - return (x = m - 1 >> 0, ((x < 0 || x >= months.length) ? ($throwRuntimeError("index out of range"), undefined) : months[x])); + return (x$1 = m - 1 >> 0, ((x$1 < 0 || x$1 >= longMonthNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : longMonthNames.$array[longMonthNames.$offset + x$1])); } buf = $makeSlice(sliceType$3, 20); n = fmtInt(buf, (new $Uint64(0, m))); @@ -6692,7 +8321,7 @@ $packages["time"] = (function() { var buf, d, n; d = this.$val; if (0 <= d && d <= 6) { - return ((d < 0 || d >= days.length) ? ($throwRuntimeError("index out of range"), undefined) : days[d]); + return ((d < 0 || d >= longDayNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : longDayNames.$array[longDayNames.$offset + d]); } buf = $makeSlice(sliceType$3, 20); n = fmtInt(buf, (new $Uint64(0, d))); @@ -6700,45 +8329,45 @@ $packages["time"] = (function() { }; $ptrType(Weekday).prototype.String = function() { return new Weekday(this.$get()).String(); }; Time.ptr.prototype.IsZero = function() { - var t, x; + var t, x$1; t = this; - return (x = t.sec(), (x.$high === 0 && x.$low === 0)) && (t.nsec() === 0); + return (x$1 = t.sec(), (x$1.$high === 0 && x$1.$low === 0)) && (t.nsec() === 0); }; Time.prototype.IsZero = function() { return this.$val.IsZero(); }; Time.ptr.prototype.abs = function() { - var _r, _r$1, _tuple, l, offset, sec, t, x, x$1, x$2, x$3, x$4, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; l = $f.l; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _r$2, _tuple, l, offset, sec, t, x$1, x$2, x$3, x$4, x$5, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; l = t.loc; /* */ if (l === ptrType$2.nil || l === localLoc) { $s = 1; continue; } /* */ $s = 2; continue; /* if (l === ptrType$2.nil || l === localLoc) { */ case 1: - _r = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - l = _r; + _r$1 = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; /* } */ case 2: sec = t.unixSec(); /* */ if (!(l === utcLoc)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(l === utcLoc)) { */ case 4: - /* */ if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { $s = 6; continue; } + /* */ if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { $s = 6; continue; } /* */ $s = 7; continue; - /* if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { */ case 6: - sec = (x$2 = (new $Int64(0, l.cacheZone.offset)), new $Int64(sec.$high + x$2.$high, sec.$low + x$2.$low)); + /* if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { */ case 6: + sec = (x$3 = (new $Int64(0, l.cacheZone.offset)), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); $s = 8; continue; /* } else { */ case 7: - _r$1 = l.lookup(sec); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; + _r$2 = l.lookup(sec); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; offset = _tuple[1]; - sec = (x$3 = (new $Int64(0, offset)), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); + sec = (x$4 = (new $Int64(0, offset)), new $Int64(sec.$high + x$4.$high, sec.$low + x$4.$low)); /* } */ case 8: /* } */ case 5: - $s = -1; return ((x$4 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$4.$high, x$4.$low))); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.abs }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.l = l; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; + $s = -1; return ((x$5 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$5.$high, x$5.$low))); + /* */ } return; } var $f = {$blk: Time.ptr.prototype.abs, $c: true, $r, _r$1, _r$2, _tuple, l, offset, sec, t, x$1, x$2, x$3, x$4, x$5, $s};return $f; }; Time.prototype.abs = function() { return this.$val.abs(); }; Time.ptr.prototype.locabs = function() { - var _r, _r$1, _tuple, abs, l, name, offset, sec, t, x, x$1, x$2, x$3, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; abs = $f.abs; l = $f.l; name = $f.name; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _r$2, _tuple, abs, l, name, offset, sec, t, x$1, x$2, x$3, x$4, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: name = ""; offset = 0; abs = new $Uint64(0, 0); @@ -6747,92 +8376,93 @@ $packages["time"] = (function() { /* */ if (l === ptrType$2.nil || l === localLoc) { $s = 1; continue; } /* */ $s = 2; continue; /* if (l === ptrType$2.nil || l === localLoc) { */ case 1: - _r = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - l = _r; + _r$1 = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; /* } */ case 2: sec = t.unixSec(); /* */ if (!(l === utcLoc)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(l === utcLoc)) { */ case 4: - /* */ if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { $s = 7; continue; } + /* */ if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { $s = 7; continue; } /* */ $s = 8; continue; - /* if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { */ case 7: + /* if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { */ case 7: name = l.cacheZone.name; offset = l.cacheZone.offset; $s = 9; continue; /* } else { */ case 8: - _r$1 = l.lookup(sec); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; + _r$2 = l.lookup(sec); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; name = _tuple[0]; offset = _tuple[1]; /* } */ case 9: - sec = (x$2 = (new $Int64(0, offset)), new $Int64(sec.$high + x$2.$high, sec.$low + x$2.$low)); + sec = (x$3 = (new $Int64(0, offset)), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); $s = 6; continue; /* } else { */ case 5: name = "UTC"; /* } */ case 6: - abs = ((x$3 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$3.$high, x$3.$low))); + abs = ((x$4 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$4.$high, x$4.$low))); $s = -1; return [name, offset, abs]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.locabs }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.abs = abs; $f.l = l; $f.name = name; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.locabs, $c: true, $r, _r$1, _r$2, _tuple, abs, l, name, offset, sec, t, x$1, x$2, x$3, x$4, $s};return $f; }; Time.prototype.locabs = function() { return this.$val.locabs(); }; Time.ptr.prototype.Date = function() { - var _r, _tuple, day, month, t, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; day = $f.day; month = $f.month; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, day, month, t, year, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: year = 0; month = 0; day = 0; t = this; - _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; $s = -1; return [year, month, day]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Date }; } $f._r = _r; $f._tuple = _tuple; $f.day = day; $f.month = month; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Date, $c: true, $r, _r$1, _tuple, day, month, t, year, $s};return $f; }; Time.prototype.Date = function() { return this.$val.Date(); }; Time.ptr.prototype.Year = function() { - var _r, _tuple, t, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, t, year, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; year = _tuple[0]; $s = -1; return year; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Year }; } $f._r = _r; $f._tuple = _tuple; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Year, $c: true, $r, _r$1, _tuple, t, year, $s};return $f; }; Time.prototype.Year = function() { return this.$val.Year(); }; Time.ptr.prototype.Month = function() { - var _r, _tuple, month, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; month = $f.month; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, month, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; month = _tuple[1]; $s = -1; return month; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Month }; } $f._r = _r; $f._tuple = _tuple; $f.month = month; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Month, $c: true, $r, _r$1, _tuple, month, t, $s};return $f; }; Time.prototype.Month = function() { return this.$val.Month(); }; Time.ptr.prototype.Day = function() { - var _r, _tuple, day, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; day = $f.day; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, day, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; day = _tuple[2]; $s = -1; return day; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Day }; } $f._r = _r; $f._tuple = _tuple; $f.day = day; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Day, $c: true, $r, _r$1, _tuple, day, t, $s};return $f; }; Time.prototype.Day = function() { return this.$val.Day(); }; Time.ptr.prototype.Weekday = function() { - var _r, _r$1, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r$1, _r$2, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = absWeekday(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Weekday }; } $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = absWeekday(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Weekday, $c: true, $r, $24r, _r$1, _r$2, t, $s};return $f; }; Time.prototype.Weekday = function() { return this.$val.Weekday(); }; absWeekday = function(abs) { @@ -6841,57 +8471,45 @@ $packages["time"] = (function() { return (((_q = ((sec.$low >> 0)) / 86400, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0)); }; Time.ptr.prototype.ISOWeek = function() { - var _q, _r, _r$1, _r$2, _r$3, _r$4, _tuple, day, dec31wday, jan1wday, month, t, wday, week, yday, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; day = $f.day; dec31wday = $f.dec31wday; jan1wday = $f.jan1wday; month = $f.month; t = $f.t; wday = $f.wday; week = $f.week; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_q, _r$1, _tmp, _tmp$1, _tuple, abs, d, t, week, x$1, yday, year, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: year = 0; week = 0; t = this; - _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + abs = _r$1; + d = 4 - absWeekday(abs) >> 0; + if (d === 4) { + d = -3; + } + abs = (x$1 = $mul64((new $Uint64(0, d)), new $Uint64(0, 86400)), new $Uint64(abs.$high + x$1.$high, abs.$low + x$1.$low)); + _tuple = absDate(abs, false); year = _tuple[0]; - month = _tuple[1]; - day = _tuple[2]; yday = _tuple[3]; - _r$2 = $clone(t, Time).Weekday(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - wday = (_r$1 = (((_r$2 + 6 >> 0) >> 0)) % 7, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); - week = (_q = (((yday - wday >> 0) + 7 >> 0)) / 7, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - jan1wday = (_r$3 = (((wday - yday >> 0) + 371 >> 0)) % 7, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); - if (1 <= jan1wday && jan1wday <= 3) { - week = week + (1) >> 0; - } - if (week === 0) { - year = year - (1) >> 0; - week = 52; - if ((jan1wday === 4) || ((jan1wday === 5) && isLeap(year))) { - week = week + (1) >> 0; - } - } - if ((month === 12) && day >= 29 && wday < 3) { - dec31wday = (_r$4 = (((wday + 31 >> 0) - day >> 0)) % 7, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); - if (0 <= dec31wday && dec31wday <= 2) { - year = year + (1) >> 0; - week = 1; - } - } + _tmp = year; + _tmp$1 = (_q = yday / 7, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; + year = _tmp; + week = _tmp$1; $s = -1; return [year, week]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.ISOWeek }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.day = day; $f.dec31wday = dec31wday; $f.jan1wday = jan1wday; $f.month = month; $f.t = t; $f.wday = wday; $f.week = week; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.ISOWeek, $c: true, $r, _q, _r$1, _tmp, _tmp$1, _tuple, abs, d, t, week, x$1, yday, year, $s};return $f; }; Time.prototype.ISOWeek = function() { return this.$val.ISOWeek(); }; Time.ptr.prototype.Clock = function() { - var _r, _r$1, _tuple, hour, min, sec, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; hour = $f.hour; min = $f.min; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r$1, _r$2, _tuple, hour, min, sec, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: hour = 0; min = 0; sec = 0; t = this; - _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = absClock(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; + _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = absClock(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; hour = _tuple[0]; min = _tuple[1]; sec = _tuple[2]; - $s = -1; return [hour, min, sec]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Clock }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.hour = hour; $f.min = min; $f.sec = sec; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + $24r = [hour, min, sec]; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Clock, $c: true, $r, $24r, _r$1, _r$2, _tuple, hour, min, sec, t, $s};return $f; }; Time.prototype.Clock = function() { return this.$val.Clock(); }; absClock = function(abs) { @@ -6907,30 +8525,33 @@ $packages["time"] = (function() { return [hour, min, sec]; }; Time.ptr.prototype.Hour = function() { - var _q, _r, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _q, _r$1, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return (_q = (($div64(_r, new $Uint64(0, 86400), true).$low >> 0)) / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Hour }; } $f._q = _q; $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = (_q = (($div64(_r$1, new $Uint64(0, 86400), true).$low >> 0)) / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Hour, $c: true, $r, $24r, _q, _r$1, t, $s};return $f; }; Time.prototype.Hour = function() { return this.$val.Hour(); }; Time.ptr.prototype.Minute = function() { - var _q, _r, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _q, _r$1, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return (_q = (($div64(_r, new $Uint64(0, 3600), true).$low >> 0)) / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Minute }; } $f._q = _q; $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = (_q = (($div64(_r$1, new $Uint64(0, 3600), true).$low >> 0)) / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Minute, $c: true, $r, $24r, _q, _r$1, t, $s};return $f; }; Time.prototype.Minute = function() { return this.$val.Minute(); }; Time.ptr.prototype.Second = function() { - var _r, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r$1, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return (($div64(_r, new $Uint64(0, 60), true).$low >> 0)); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Second }; } $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = (($div64(_r$1, new $Uint64(0, 60), true).$low >> 0)); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Second, $c: true, $r, $24r, _r$1, t, $s};return $f; }; Time.prototype.Second = function() { return this.$val.Second(); }; Time.ptr.prototype.Nanosecond = function() { @@ -6940,20 +8561,20 @@ $packages["time"] = (function() { }; Time.prototype.Nanosecond = function() { return this.$val.Nanosecond(); }; Time.ptr.prototype.YearDay = function() { - var _r, _tuple, t, yday, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; t = $f.t; yday = $f.yday; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, t, yday, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; yday = _tuple[3]; $s = -1; return yday + 1 >> 0; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.YearDay }; } $f._r = _r; $f._tuple = _tuple; $f.t = t; $f.yday = yday; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.YearDay, $c: true, $r, _r$1, _tuple, t, yday, $s};return $f; }; Time.prototype.YearDay = function() { return this.$val.YearDay(); }; Duration.prototype.String = function() { var _tuple, _tuple$1, buf, d, neg, prec, u, w; d = this; - buf = arrayType$3.zero(); + buf = arrayType$2.zero(); w = 32; u = (new $Uint64(d.$high, d.$low)); neg = (d.$high < 0 || (d.$high === 0 && d.$low < 0)); @@ -7059,6 +8680,18 @@ $packages["time"] = (function() { return (new $Int64(d.$high, d.$low)); }; $ptrType(Duration).prototype.Nanoseconds = function() { return this.$get().Nanoseconds(); }; + Duration.prototype.Microseconds = function() { + var d; + d = this; + return $div64((new $Int64(d.$high, d.$low)), new $Int64(0, 1000), false); + }; + $ptrType(Duration).prototype.Microseconds = function() { return this.$get().Microseconds(); }; + Duration.prototype.Milliseconds = function() { + var d; + d = this; + return $div64((new $Int64(d.$high, d.$low)), new $Int64(0, 1000000), false); + }; + $ptrType(Duration).prototype.Milliseconds = function() { return this.$get().Milliseconds(); }; Duration.prototype.Seconds = function() { var d, nsec, sec; d = this; @@ -7084,20 +8717,20 @@ $packages["time"] = (function() { }; $ptrType(Duration).prototype.Hours = function() { return this.$get().Hours(); }; Duration.prototype.Truncate = function(m) { - var d, m, x; + var d, m, x$1; d = this; if ((m.$high < 0 || (m.$high === 0 && m.$low <= 0))) { return d; } - return (x = $div64(d, m, true), new Duration(d.$high - x.$high, d.$low - x.$low)); + return (x$1 = $div64(d, m, true), new Duration(d.$high - x$1.$high, d.$low - x$1.$low)); }; $ptrType(Duration).prototype.Truncate = function(m) { return this.$get().Truncate(m); }; - lessThanHalf = function(x, y) { - var x, x$1, x$2, x$3, x$4, y; - return (x$1 = (x$2 = (new $Uint64(x.$high, x.$low)), x$3 = (new $Uint64(x.$high, x.$low)), new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), x$4 = (new $Uint64(y.$high, y.$low)), (x$1.$high < x$4.$high || (x$1.$high === x$4.$high && x$1.$low < x$4.$low))); + lessThanHalf = function(x$1, y) { + var x$1, x$2, x$3, x$4, x$5, y; + return (x$2 = (x$3 = (new $Uint64(x$1.$high, x$1.$low)), x$4 = (new $Uint64(x$1.$high, x$1.$low)), new $Uint64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)), x$5 = (new $Uint64(y.$high, y.$low)), (x$2.$high < x$5.$high || (x$2.$high === x$5.$high && x$2.$low < x$5.$low))); }; Duration.prototype.Round = function(m) { - var d, d1, d1$1, m, r, x, x$1; + var d, d1, d1$1, m, r, x$1, x$2; d = this; if ((m.$high < 0 || (m.$high === 0 && m.$low <= 0))) { return d; @@ -7108,7 +8741,7 @@ $packages["time"] = (function() { if (lessThanHalf(r, m)) { return new Duration(d.$high + r.$high, d.$low + r.$low); } - d1 = (x = new Duration(d.$high - m.$high, d.$low - m.$low), new Duration(x.$high + r.$high, x.$low + r.$low)); + d1 = (x$1 = new Duration(d.$high - m.$high, d.$low - m.$low), new Duration(x$1.$high + r.$high, x$1.$low + r.$low)); if ((d1.$high < d.$high || (d1.$high === d.$high && d1.$low < d.$low))) { return d1; } @@ -7117,7 +8750,7 @@ $packages["time"] = (function() { if (lessThanHalf(r, m)) { return new Duration(d.$high - r.$high, d.$low - r.$low); } - d1$1 = (x$1 = new Duration(d.$high + m.$high, d.$low + m.$low), new Duration(x$1.$high - r.$high, x$1.$low - r.$low)); + d1$1 = (x$2 = new Duration(d.$high + m.$high, d.$low + m.$low), new Duration(x$2.$high - r.$high, x$2.$low - r.$low)); if ((d1$1.$high > d.$high || (d1$1.$high === d.$high && d1$1.$low > d.$low))) { return d1$1; } @@ -7125,22 +8758,22 @@ $packages["time"] = (function() { }; $ptrType(Duration).prototype.Round = function(m) { return this.$get().Round(m); }; Time.ptr.prototype.Add = function(d) { - var d, dsec, nsec, t, te, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + var d, dsec, nsec, t, te, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; - dsec = ((x = $div64(d, new Duration(0, 1000000000), false), new $Int64(x.$high, x.$low))); - nsec = t.nsec() + (((x$1 = $div64(d, new Duration(0, 1000000000), true), x$1.$low + ((x$1.$high >> 31) * 4294967296)) >> 0)) >> 0; + dsec = ((x$1 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$1.$high, x$1.$low))); + nsec = t.nsec() + (((x$2 = $div64(d, new Duration(0, 1000000000), true), x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0)) >> 0; if (nsec >= 1000000000) { - dsec = (x$2 = new $Int64(0, 1), new $Int64(dsec.$high + x$2.$high, dsec.$low + x$2.$low)); + dsec = (x$3 = new $Int64(0, 1), new $Int64(dsec.$high + x$3.$high, dsec.$low + x$3.$low)); nsec = nsec - (1000000000) >> 0; } else if (nsec < 0) { - dsec = (x$3 = new $Int64(0, 1), new $Int64(dsec.$high - x$3.$high, dsec.$low - x$3.$low)); + dsec = (x$4 = new $Int64(0, 1), new $Int64(dsec.$high - x$4.$high, dsec.$low - x$4.$low)); nsec = nsec + (1000000000) >> 0; } - t.wall = (x$4 = (x$5 = t.wall, new $Uint64(x$5.$high & ~0, (x$5.$low & ~1073741823) >>> 0)), x$6 = (new $Uint64(0, nsec)), new $Uint64(x$4.$high | x$6.$high, (x$4.$low | x$6.$low) >>> 0)); + t.wall = (x$5 = (x$6 = t.wall, new $Uint64(x$6.$high & ~0, (x$6.$low & ~1073741823) >>> 0)), x$7 = (new $Uint64(0, nsec)), new $Uint64(x$5.$high | x$7.$high, (x$5.$low | x$7.$low) >>> 0)); t.addSec(dsec); - if (!((x$7 = (x$8 = t.wall, new $Uint64(x$8.$high & 2147483648, (x$8.$low & 0) >>> 0)), (x$7.$high === 0 && x$7.$low === 0)))) { - te = (x$9 = t.ext, x$10 = (new $Int64(d.$high, d.$low)), new $Int64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)); - if ((d.$high < 0 || (d.$high === 0 && d.$low < 0)) && (x$11 = t.ext, (te.$high > x$11.$high || (te.$high === x$11.$high && te.$low > x$11.$low))) || (d.$high > 0 || (d.$high === 0 && d.$low > 0)) && (x$12 = t.ext, (te.$high < x$12.$high || (te.$high === x$12.$high && te.$low < x$12.$low)))) { + if (!((x$8 = (x$9 = t.wall, new $Uint64(x$9.$high & 2147483648, (x$9.$low & 0) >>> 0)), (x$8.$high === 0 && x$8.$low === 0)))) { + te = (x$10 = t.ext, x$11 = (new $Int64(d.$high, d.$low)), new $Int64(x$10.$high + x$11.$high, x$10.$low + x$11.$low)); + if ((d.$high < 0 || (d.$high === 0 && d.$low < 0)) && (x$12 = t.ext, (te.$high > x$12.$high || (te.$high === x$12.$high && te.$low > x$12.$low))) || (d.$high > 0 || (d.$high === 0 && d.$low > 0)) && (x$13 = t.ext, (te.$high < x$13.$high || (te.$high === x$13.$high && te.$low < x$13.$low)))) { t.stripMono(); } else { t.ext = te; @@ -7150,12 +8783,12 @@ $packages["time"] = (function() { }; Time.prototype.Add = function(d) { return this.$val.Add(d); }; Time.ptr.prototype.Sub = function(u) { - var d, d$1, t, te, u, ue, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + var d, d$1, t, te, u, ue, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; - if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { + if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { te = t.ext; ue = u.ext; - d = ((x$4 = new $Int64(te.$high - ue.$high, te.$low - ue.$low), new Duration(x$4.$high, x$4.$low))); + d = ((x$5 = new $Int64(te.$high - ue.$high, te.$low - ue.$low), new Duration(x$5.$high, x$5.$low))); if ((d.$high < 0 || (d.$high === 0 && d.$low < 0)) && (te.$high > ue.$high || (te.$high === ue.$high && te.$low > ue.$low))) { return new Duration(2147483647, 4294967295); } @@ -7164,7 +8797,7 @@ $packages["time"] = (function() { } return d; } - d$1 = (x$5 = $mul64(((x$6 = (x$7 = t.sec(), x$8 = u.sec(), new $Int64(x$7.$high - x$8.$high, x$7.$low - x$8.$low)), new Duration(x$6.$high, x$6.$low))), new Duration(0, 1000000000)), x$9 = (new Duration(0, (t.nsec() - u.nsec() >> 0))), new Duration(x$5.$high + x$9.$high, x$5.$low + x$9.$low)); + d$1 = (x$6 = $mul64(((x$7 = (x$8 = t.sec(), x$9 = u.sec(), new $Int64(x$8.$high - x$9.$high, x$8.$low - x$9.$low)), new Duration(x$7.$high, x$7.$low))), new Duration(0, 1000000000)), x$10 = (new Duration(0, (t.nsec() - u.nsec() >> 0))), new Duration(x$6.$high + x$10.$high, x$6.$low + x$10.$low)); if ($clone($clone(u, Time).Add(d$1), Time).Equal($clone(t, Time))) { return d$1; } else if ($clone(t, Time).Before($clone(u, Time))) { @@ -7175,50 +8808,65 @@ $packages["time"] = (function() { }; Time.prototype.Sub = function(u) { return this.$val.Sub(u); }; Until = function(t) { - var t; - return $clone(t, Time).Sub($clone(Now(), Time)); + var {_r$1, _r$2, now$1, t, x$1, x$2, x$3, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + now$1 = new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil); + /* */ if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { */ case 1: + _r$1 = runtimeNano(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + Time.copy(now$1, new Time.ptr(new $Uint64(2147483648, 0), (x$3 = _r$1, new $Int64(x$3.$high - startNano.$high, x$3.$low - startNano.$low)), ptrType$2.nil)); + $s = 3; continue; + /* } else { */ case 2: + _r$2 = Now(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + Time.copy(now$1, _r$2); + /* } */ case 3: + $s = -1; return $clone(t, Time).Sub($clone(now$1, Time)); + /* */ } return; } var $f = {$blk: Until, $c: true, $r, _r$1, _r$2, now$1, t, x$1, x$2, x$3, $s};return $f; }; $pkg.Until = Until; - Time.ptr.prototype.AddDate = function(years, months$1, days$1) { - var _r, _r$1, _r$2, _tuple, _tuple$1, day, days$1, hour, min, month, months$1, sec, t, year, years, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; day = $f.day; days$1 = $f.days$1; hour = $f.hour; min = $f.min; month = $f.month; months$1 = $f.months$1; sec = $f.sec; t = $f.t; year = $f.year; years = $f.years; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + Time.ptr.prototype.AddDate = function(years, months, days) { + var {$24r, _r$1, _r$2, _r$3, _tuple, _tuple$1, day, days, hour, min, month, months, sec, t, year, years, $s, $r, $c} = $restore(this, {years, months, days}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; - _r$1 = $clone(t, Time).Clock(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; + _r$2 = $clone(t, Time).Clock(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; hour = _tuple$1[0]; min = _tuple$1[1]; sec = _tuple$1[2]; - _r$2 = Date(year + years >> 0, month + ((months$1 >> 0)) >> 0, day + days$1 >> 0, hour, min, sec, ((t.nsec() >> 0)), $clone(t, Time).Location()); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $s = -1; return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AddDate }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.day = day; $f.days$1 = days$1; $f.hour = hour; $f.min = min; $f.month = month; $f.months$1 = months$1; $f.sec = sec; $f.t = t; $f.year = year; $f.years = years; $f.$s = $s; $f.$r = $r; return $f; + _r$3 = Date(year + years >> 0, month + ((months >> 0)) >> 0, day + days >> 0, hour, min, sec, ((t.nsec() >> 0)), $clone(t, Time).Location()); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 4; case 4: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.AddDate, $c: true, $r, $24r, _r$1, _r$2, _r$3, _tuple, _tuple$1, day, days, hour, min, month, months, sec, t, year, years, $s};return $f; }; - Time.prototype.AddDate = function(years, months$1, days$1) { return this.$val.AddDate(years, months$1, days$1); }; + Time.prototype.AddDate = function(years, months, days) { return this.$val.AddDate(years, months, days); }; Time.ptr.prototype.date = function(full) { - var _r, _r$1, _tuple, day, full, month, t, yday, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; day = $f.day; full = $f.full; month = $f.month; t = $f.t; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r$1, _r$2, _tuple, day, full, month, t, yday, year, $s, $r, $c} = $restore(this, {full}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: year = 0; month = 0; day = 0; yday = 0; t = this; - _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = absDate(_r, full); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; + _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = absDate(_r$1, full); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; yday = _tuple[3]; - $s = -1; return [year, month, day, yday]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.date }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.day = day; $f.full = full; $f.month = month; $f.t = t; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + $24r = [year, month, day, yday]; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.date, $c: true, $r, $24r, _r$1, _r$2, _tuple, day, full, month, t, yday, year, $s};return $f; }; Time.prototype.date = function(full) { return this.$val.date(full); }; absDate = function(abs, full) { - var _q, abs, begin, d, day, end, full, month, n, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, yday, year; + var _q, abs, begin, d, day, end, full, month, n, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, yday, year; year = 0; month = 0; day = 0; @@ -7226,19 +8874,19 @@ $packages["time"] = (function() { d = $div64(abs, new $Uint64(0, 86400), false); n = $div64(d, new $Uint64(0, 146097), false); y = $mul64(new $Uint64(0, 400), n); - d = (x = $mul64(new $Uint64(0, 146097), n), new $Uint64(d.$high - x.$high, d.$low - x.$low)); + d = (x$1 = $mul64(new $Uint64(0, 146097), n), new $Uint64(d.$high - x$1.$high, d.$low - x$1.$low)); n = $div64(d, new $Uint64(0, 36524), false); - n = (x$1 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$1.$high, n.$low - x$1.$low)); - y = (x$2 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high + x$2.$high, y.$low + x$2.$low)); - d = (x$3 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high - x$3.$high, d.$low - x$3.$low)); + n = (x$2 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$2.$high, n.$low - x$2.$low)); + y = (x$3 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high + x$3.$high, y.$low + x$3.$low)); + d = (x$4 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high - x$4.$high, d.$low - x$4.$low)); n = $div64(d, new $Uint64(0, 1461), false); - y = (x$4 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high + x$4.$high, y.$low + x$4.$low)); - d = (x$5 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high - x$5.$high, d.$low - x$5.$low)); + y = (x$5 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high + x$5.$high, y.$low + x$5.$low)); + d = (x$6 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high - x$6.$high, d.$low - x$6.$low)); n = $div64(d, new $Uint64(0, 365), false); - n = (x$6 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$6.$high, n.$low - x$6.$low)); - y = (x$7 = n, new $Uint64(y.$high + x$7.$high, y.$low + x$7.$low)); - d = (x$8 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high - x$8.$high, d.$low - x$8.$low)); - year = (((x$9 = (x$10 = (new $Int64(y.$high, y.$low)), new $Int64(x$10.$high + -69, x$10.$low + 4075721025)), x$9.$low + ((x$9.$high >> 31) * 4294967296)) >> 0)); + n = (x$7 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$7.$high, n.$low - x$7.$low)); + y = (x$8 = n, new $Uint64(y.$high + x$8.$high, y.$low + x$8.$low)); + d = (x$9 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high - x$9.$high, d.$low - x$9.$low)); + year = (((x$10 = (x$11 = (new $Int64(y.$high, y.$low)), new $Int64(x$11.$high + -69, x$11.$low + 4075721025)), x$10.$low + ((x$10.$high >> 31) * 4294967296)) >> 0)); yday = ((d.$low >> 0)); if (!full) { return [year, month, day, yday]; @@ -7254,7 +8902,7 @@ $packages["time"] = (function() { } } month = (((_q = day / 31, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0)); - end = (((x$11 = month + 1 >> 0, ((x$11 < 0 || x$11 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$11])) >> 0)); + end = (((x$12 = month + 1 >> 0, ((x$12 < 0 || x$12 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$12])) >> 0)); begin = 0; if (day >= end) { month = month + (1) >> 0; @@ -7267,23 +8915,46 @@ $packages["time"] = (function() { return [year, month, day, yday]; }; daysIn = function(m, year) { - var m, x, year; + var m, x$1, year; if ((m === 2) && isLeap(year)) { return 29; } - return (((((m < 0 || m >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[m]) - (x = m - 1 >> 0, ((x < 0 || x >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x])) >> 0) >> 0)); + return (((((m < 0 || m >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[m]) - (x$1 = m - 1 >> 0, ((x$1 < 0 || x$1 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$1])) >> 0) >> 0)); + }; + daysSinceEpoch = function(year) { + var d, n, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y, year; + y = ((x$1 = (x$2 = (new $Int64(0, year)), new $Int64(x$2.$high - -69, x$2.$low - 4075721025)), new $Uint64(x$1.$high, x$1.$low))); + n = $div64(y, new $Uint64(0, 400), false); + y = (x$3 = $mul64(new $Uint64(0, 400), n), new $Uint64(y.$high - x$3.$high, y.$low - x$3.$low)); + d = $mul64(new $Uint64(0, 146097), n); + n = $div64(y, new $Uint64(0, 100), false); + y = (x$4 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high - x$4.$high, y.$low - x$4.$low)); + d = (x$5 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high + x$5.$high, d.$low + x$5.$low)); + n = $div64(y, new $Uint64(0, 4), false); + y = (x$6 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high - x$6.$high, y.$low - x$6.$low)); + d = (x$7 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high + x$7.$high, d.$low + x$7.$low)); + n = y; + d = (x$8 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high + x$8.$high, d.$low + x$8.$low)); + return d; + }; + runtimeNano = function() { + $throwRuntimeError("native function not implemented: time.runtimeNano"); }; Now = function() { - var _tuple, mono, nsec, sec, x, x$1, x$2, x$3, x$4; - _tuple = now(); + var {_r$1, _tuple, mono, nsec, sec, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = now(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; sec = _tuple[0]; nsec = _tuple[1]; mono = _tuple[2]; - sec = (x = new $Int64(0, 2682288000), new $Int64(sec.$high + x.$high, sec.$low + x.$low)); - if (!((x$1 = $shiftRightUint64((new $Uint64(sec.$high, sec.$low)), 33), (x$1.$high === 0 && x$1.$low === 0)))) { - return new Time.ptr((new $Uint64(0, nsec)), new $Int64(sec.$high + 13, sec.$low + 3618733952), $pkg.Local); + mono = (x$1 = startNano, new $Int64(mono.$high - x$1.$high, mono.$low - x$1.$low)); + sec = (x$2 = new $Int64(0, 2682288000), new $Int64(sec.$high + x$2.$high, sec.$low + x$2.$low)); + if (!((x$3 = $shiftRightUint64((new $Uint64(sec.$high, sec.$low)), 33), (x$3.$high === 0 && x$3.$low === 0)))) { + $s = -1; return new Time.ptr((new $Uint64(0, nsec)), new $Int64(sec.$high + 13, sec.$low + 3618733952), $pkg.Local); } - return new Time.ptr((x$2 = (x$3 = $shiftLeft64((new $Uint64(sec.$high, sec.$low)), 30), new $Uint64(2147483648 | x$3.$high, (0 | x$3.$low) >>> 0)), x$4 = (new $Uint64(0, nsec)), new $Uint64(x$2.$high | x$4.$high, (x$2.$low | x$4.$low) >>> 0)), mono, $pkg.Local); + $s = -1; return new Time.ptr((x$4 = (x$5 = $shiftLeft64((new $Uint64(sec.$high, sec.$low)), 30), new $Uint64(2147483648 | x$5.$high, (0 | x$5.$low) >>> 0)), x$6 = (new $Uint64(0, nsec)), new $Uint64(x$4.$high | x$6.$high, (x$4.$low | x$6.$low) >>> 0)), mono, $pkg.Local); + /* */ } return; } var $f = {$blk: Now, $c: true, $r, _r$1, _tuple, mono, nsec, sec, x$1, x$2, x$3, x$4, x$5, x$6, $s};return $f; }; $pkg.Now = Now; unixTime = function(sec, nsec) { @@ -7325,17 +8996,17 @@ $packages["time"] = (function() { }; Time.prototype.Location = function() { return this.$val.Location(); }; Time.ptr.prototype.Zone = function() { - var _r, _tuple, name, offset, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; name = $f.name; offset = $f.offset; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, name, offset, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: name = ""; offset = 0; t = this; - _r = t.loc.lookup(t.unixSec()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = t.loc.lookup(t.unixSec()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; name = _tuple[0]; offset = _tuple[1]; $s = -1; return [name, offset]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Zone }; } $f._r = _r; $f._tuple = _tuple; $f.name = name; $f.offset = offset; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Zone, $c: true, $r, _r$1, _tuple, name, offset, t, $s};return $f; }; Time.prototype.Zone = function() { return this.$val.Zone(); }; Time.ptr.prototype.Unix = function() { @@ -7344,28 +9015,43 @@ $packages["time"] = (function() { return t.unixSec(); }; Time.prototype.Unix = function() { return this.$val.Unix(); }; - Time.ptr.prototype.UnixNano = function() { - var t, x, x$1; + Time.ptr.prototype.UnixMilli = function() { + var t, x$1, x$2; t = this; - return (x = $mul64((t.unixSec()), new $Int64(0, 1000000000)), x$1 = (new $Int64(0, t.nsec())), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); + return (x$1 = $mul64(t.unixSec(), new $Int64(0, 1000)), x$2 = $div64((new $Int64(0, t.nsec())), new $Int64(0, 1000000), false), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); + }; + Time.prototype.UnixMilli = function() { return this.$val.UnixMilli(); }; + Time.ptr.prototype.UnixMicro = function() { + var t, x$1, x$2; + t = this; + return (x$1 = $mul64(t.unixSec(), new $Int64(0, 1000000)), x$2 = $div64((new $Int64(0, t.nsec())), new $Int64(0, 1000), false), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); + }; + Time.prototype.UnixMicro = function() { return this.$val.UnixMicro(); }; + Time.ptr.prototype.UnixNano = function() { + var t, x$1, x$2; + t = this; + return (x$1 = $mul64((t.unixSec()), new $Int64(0, 1000000000)), x$2 = (new $Int64(0, t.nsec())), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); }; Time.prototype.UnixNano = function() { return this.$val.UnixNano(); }; Time.ptr.prototype.MarshalBinary = function() { - var _q, _r, _r$1, _tuple, enc, nsec, offset, offsetMin, sec, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; enc = $f.enc; nsec = $f.nsec; offset = $f.offset; offsetMin = $f.offsetMin; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_q, _r$1, _r$2, _r$3, _tuple, enc, nsec, offset, offsetMin, offsetSec, sec, t, version, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; offsetMin = 0; + offsetSec = 0; + version = 1; /* */ if ($clone(t, Time).Location() === $pkg.UTC) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(t, Time).Location() === $pkg.UTC) { */ case 1: offsetMin = -1; $s = 3; continue; /* } else { */ case 2: - _r = $clone(t, Time).Zone(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $clone(t, Time).Zone(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; offset = _tuple[1]; - if (!(((_r$1 = offset % 60, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0))) { - $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalBinary: zone offset has fractional minute")]; + if (!(((_r$2 = offset % 60, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0))) { + version = 2; + offsetSec = (((_r$3 = offset % 60, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) << 24 >> 24)); } offset = (_q = offset / (60), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (offset < -32768 || (offset === -1) || offset > 32767) { @@ -7375,31 +9061,42 @@ $packages["time"] = (function() { /* } */ case 3: sec = t.sec(); nsec = t.nsec(); - enc = new sliceType$3([1, (($shiftRightInt64(sec, 56).$low << 24 >>> 24)), (($shiftRightInt64(sec, 48).$low << 24 >>> 24)), (($shiftRightInt64(sec, 40).$low << 24 >>> 24)), (($shiftRightInt64(sec, 32).$low << 24 >>> 24)), (($shiftRightInt64(sec, 24).$low << 24 >>> 24)), (($shiftRightInt64(sec, 16).$low << 24 >>> 24)), (($shiftRightInt64(sec, 8).$low << 24 >>> 24)), ((sec.$low << 24 >>> 24)), (((nsec >> 24 >> 0) << 24 >>> 24)), (((nsec >> 16 >> 0) << 24 >>> 24)), (((nsec >> 8 >> 0) << 24 >>> 24)), ((nsec << 24 >>> 24)), (((offsetMin >> 8 << 16 >> 16) << 24 >>> 24)), ((offsetMin << 24 >>> 24))]); + enc = new sliceType$3([version, (($shiftRightInt64(sec, 56).$low << 24 >>> 24)), (($shiftRightInt64(sec, 48).$low << 24 >>> 24)), (($shiftRightInt64(sec, 40).$low << 24 >>> 24)), (($shiftRightInt64(sec, 32).$low << 24 >>> 24)), (($shiftRightInt64(sec, 24).$low << 24 >>> 24)), (($shiftRightInt64(sec, 16).$low << 24 >>> 24)), (($shiftRightInt64(sec, 8).$low << 24 >>> 24)), ((sec.$low << 24 >>> 24)), (((nsec >> 24 >> 0) << 24 >>> 24)), (((nsec >> 16 >> 0) << 24 >>> 24)), (((nsec >> 8 >> 0) << 24 >>> 24)), ((nsec << 24 >>> 24)), (((offsetMin >> 8 << 16 >> 16) << 24 >>> 24)), ((offsetMin << 24 >>> 24))]); + if (version === 2) { + enc = $append(enc, ((offsetSec << 24 >>> 24))); + } $s = -1; return [enc, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalBinary }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.enc = enc; $f.nsec = nsec; $f.offset = offset; $f.offsetMin = offsetMin; $f.sec = sec; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.MarshalBinary, $c: true, $r, _q, _r$1, _r$2, _r$3, _tuple, enc, nsec, offset, offsetMin, offsetSec, sec, t, version, $s};return $f; }; Time.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; Time.ptr.prototype.UnmarshalBinary = function(data) { - var _r, _tuple, buf, data, localoff, nsec, offset, sec, t, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; data = $f.data; localoff = $f.localoff; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, buf, data, localoff, nsec, offset, sec, t, version, wantLen, x$1, x$10, x$11, x$12, x$13, x$14, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r, $c} = $restore(this, {data}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; buf = data; if (buf.$length === 0) { $s = -1; return errors.New("Time.UnmarshalBinary: no data"); } - if (!(((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) === 1))) { + version = (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]); + if (!((version === 1)) && !((version === 2))) { $s = -1; return errors.New("Time.UnmarshalBinary: unsupported version"); } - if (!((buf.$length === 15))) { + wantLen = 15; + if (version === 2) { + wantLen = wantLen + (1) >> 0; + } + if (!((buf.$length === wantLen))) { $s = -1; return errors.New("Time.UnmarshalBinary: invalid length"); } buf = $subslice(buf, 1); - sec = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Int64(0, (7 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 7]))), x$7 = $shiftLeft64((new $Int64(0, (6 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 6]))), 8), new $Int64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Int64(0, (5 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 5]))), 16), new $Int64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Int64(0, (4 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 4]))), 24), new $Int64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Int64(0, (3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]))), 32), new $Int64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Int64(0, (2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]))), 40), new $Int64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Int64(0, (1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]))), 48), new $Int64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Int64(0, (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]))), 56), new $Int64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); + sec = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (x$7 = (new $Int64(0, (7 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 7]))), x$8 = $shiftLeft64((new $Int64(0, (6 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 6]))), 8), new $Int64(x$7.$high | x$8.$high, (x$7.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Int64(0, (5 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 5]))), 16), new $Int64(x$6.$high | x$9.$high, (x$6.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Int64(0, (4 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 4]))), 24), new $Int64(x$5.$high | x$10.$high, (x$5.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Int64(0, (3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]))), 32), new $Int64(x$4.$high | x$11.$high, (x$4.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Int64(0, (2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]))), 40), new $Int64(x$3.$high | x$12.$high, (x$3.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Int64(0, (1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]))), 48), new $Int64(x$2.$high | x$13.$high, (x$2.$low | x$13.$low) >>> 0)), x$14 = $shiftLeft64((new $Int64(0, (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]))), 56), new $Int64(x$1.$high | x$14.$high, (x$1.$low | x$14.$low) >>> 0)); buf = $subslice(buf, 8); nsec = (((((3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]) >> 0)) | ((((2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]) >> 0)) << 8 >> 0)) | ((((1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]) >> 0)) << 16 >> 0)) | ((((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) >> 0)) << 24 >> 0); buf = $subslice(buf, 4); offset = $imul(((((((1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]) << 16 >> 16)) | ((((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) << 16 >> 16)) << 8 << 16 >> 16)) >> 0)), 60); + if (version === 2) { + offset = offset + ((((2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]) >> 0))) >> 0; + } Time.copy(t, new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil)); t.wall = (new $Uint64(0, nsec)); t.ext = sec; @@ -7409,8 +9106,8 @@ $packages["time"] = (function() { t.setLoc(utcLoc); $s = 3; continue; /* } else { */ case 2: - _r = $pkg.Local.lookup(t.unixSec()); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = $pkg.Local.lookup(t.unixSec()); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; localoff = _tuple[1]; if (offset === localoff) { t.setLoc($pkg.Local); @@ -7419,106 +9116,120 @@ $packages["time"] = (function() { } /* } */ case 3: $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalBinary }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.data = data; $f.localoff = localoff; $f.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.UnmarshalBinary, $c: true, $r, _r$1, _tuple, buf, data, localoff, nsec, offset, sec, t, version, wantLen, x$1, x$10, x$11, x$12, x$13, x$14, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s};return $f; }; Time.prototype.UnmarshalBinary = function(data) { return this.$val.UnmarshalBinary(data); }; Time.ptr.prototype.GobEncode = function() { - var _r, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r$1, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).MarshalBinary(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobEncode }; } $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + _r$1 = $clone(t, Time).MarshalBinary(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.GobEncode, $c: true, $r, $24r, _r$1, t, $s};return $f; }; Time.prototype.GobEncode = function() { return this.$val.GobEncode(); }; Time.ptr.prototype.GobDecode = function(data) { - var _r, data, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; data = $f.data; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r$1, data, t, $s, $r, $c} = $restore(this, {data}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = t.UnmarshalBinary(data); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobDecode }; } $f._r = _r; $f.data = data; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + _r$1 = t.UnmarshalBinary(data); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.GobDecode, $c: true, $r, $24r, _r$1, data, t, $s};return $f; }; Time.prototype.GobDecode = function(data) { return this.$val.GobDecode(data); }; Time.ptr.prototype.MarshalJSON = function() { - var _r, _r$1, b, t, y, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _r$2, b, t, y, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - y = _r; + _r$1 = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + y = _r$1; if (y < 0 || y >= 10000) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]")]; } b = $makeSlice(sliceType$3, 0, 37); b = $append(b, 34); - _r$1 = $clone(t, Time).AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - b = _r$1; + _r$2 = $clone(t, Time).AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + b = _r$2; b = $append(b, 34); $s = -1; return [b, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalJSON }; } $f._r = _r; $f._r$1 = _r$1; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.MarshalJSON, $c: true, $r, _r$1, _r$2, b, t, y, $s};return $f; }; Time.prototype.MarshalJSON = function() { return this.$val.MarshalJSON(); }; Time.ptr.prototype.UnmarshalJSON = function(data) { - var _r, _tuple, data, err, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; data = $f.data; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, data, err, t, $s, $r, $c} = $restore(this, {data}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; if (($bytesToString(data)) === "null") { $s = -1; return $ifaceNil; } err = $ifaceNil; - _r = Parse("\"2006-01-02T15:04:05Z07:00\"", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = Parse("\"2006-01-02T15:04:05Z07:00\"", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; Time.copy(t, _tuple[0]); err = _tuple[1]; $s = -1; return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalJSON }; } $f._r = _r; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.UnmarshalJSON, $c: true, $r, _r$1, _tuple, data, err, t, $s};return $f; }; Time.prototype.UnmarshalJSON = function(data) { return this.$val.UnmarshalJSON(data); }; Time.ptr.prototype.MarshalText = function() { - var _r, _r$1, b, t, y, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r$1, _r$2, b, t, y, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; - _r = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - y = _r; + _r$1 = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + y = _r$1; if (y < 0 || y >= 10000) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalText: year outside of range [0,9999]")]; } b = $makeSlice(sliceType$3, 0, 35); - _r$1 = $clone(t, Time).AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return [_r$1, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalText }; } $f._r = _r; $f._r$1 = _r$1; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; + _r$2 = $clone(t, Time).AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = [_r$2, $ifaceNil]; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.MarshalText, $c: true, $r, $24r, _r$1, _r$2, b, t, y, $s};return $f; }; Time.prototype.MarshalText = function() { return this.$val.MarshalText(); }; Time.ptr.prototype.UnmarshalText = function(data) { - var _r, _tuple, data, err, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; data = $f.data; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _tuple, data, err, t, $s, $r, $c} = $restore(this, {data}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: t = this; err = $ifaceNil; - _r = Parse("2006-01-02T15:04:05Z07:00", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; + _r$1 = Parse("2006-01-02T15:04:05Z07:00", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; Time.copy(t, _tuple[0]); err = _tuple[1]; $s = -1; return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalText }; } $f._r = _r; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.UnmarshalText, $c: true, $r, _r$1, _tuple, data, err, t, $s};return $f; }; Time.prototype.UnmarshalText = function(data) { return this.$val.UnmarshalText(data); }; Unix = function(sec, nsec) { - var n, nsec, sec, x, x$1, x$2, x$3; + var n, nsec, sec, x$1, x$2, x$3, x$4; if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0)) || (nsec.$high > 0 || (nsec.$high === 0 && nsec.$low >= 1000000000))) { n = $div64(nsec, new $Int64(0, 1000000000), false); - sec = (x = n, new $Int64(sec.$high + x.$high, sec.$low + x.$low)); - nsec = (x$1 = $mul64(n, new $Int64(0, 1000000000)), new $Int64(nsec.$high - x$1.$high, nsec.$low - x$1.$low)); + sec = (x$1 = n, new $Int64(sec.$high + x$1.$high, sec.$low + x$1.$low)); + nsec = (x$2 = $mul64(n, new $Int64(0, 1000000000)), new $Int64(nsec.$high - x$2.$high, nsec.$low - x$2.$low)); if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0))) { - nsec = (x$2 = new $Int64(0, 1000000000), new $Int64(nsec.$high + x$2.$high, nsec.$low + x$2.$low)); - sec = (x$3 = new $Int64(0, 1), new $Int64(sec.$high - x$3.$high, sec.$low - x$3.$low)); + nsec = (x$3 = new $Int64(0, 1000000000), new $Int64(nsec.$high + x$3.$high, nsec.$low + x$3.$low)); + sec = (x$4 = new $Int64(0, 1), new $Int64(sec.$high - x$4.$high, sec.$low - x$4.$low)); } } return unixTime(sec, (((nsec.$low + ((nsec.$high >> 31) * 4294967296)) >> 0))); }; $pkg.Unix = Unix; + Time.ptr.prototype.IsDST = function() { + var {_r$1, _tuple, isDST, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + _r$1 = t.loc.lookup($clone(t, Time).Unix()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + isDST = _tuple[4]; + $s = -1; return isDST; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.IsDST, $c: true, $r, _r$1, _tuple, isDST, t, $s};return $f; + }; + Time.prototype.IsDST = function() { return this.$val.IsDST(); }; isLeap = function(year) { - var _r, _r$1, _r$2, year; - return ((_r = year % 4, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0) && (!(((_r$1 = year % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0)) || ((_r$2 = year % 400, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0)); + var _r$1, _r$2, _r$3, year; + return ((_r$1 = year % 4, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0) && (!(((_r$2 = year % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0)) || ((_r$3 = year % 400, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 0)); }; norm = function(hi, lo, base) { var _q, _q$1, _tmp, _tmp$1, base, hi, lo, n, n$1, nhi, nlo; @@ -7541,8 +9252,8 @@ $packages["time"] = (function() { return [nhi, nlo]; }; Date = function(year, month, day, hour, min, sec, nsec, loc) { - var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, abs, d, day, end, hour, loc, m, min, month, n, nsec, offset, sec, start, t, unix, utc, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; abs = $f.abs; d = $f.d; day = $f.day; end = $f.end; hour = $f.hour; loc = $f.loc; m = $f.m; min = $f.min; month = $f.month; n = $f.n; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; start = $f.start; t = $f.t; unix = $f.unix; utc = $f.utc; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; y = $f.y; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r$1, _r$2, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, abs, d, day, end, hour, loc, m, min, month, nsec, offset, sec, start, t, unix, utc, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, year, $s, $r, $c} = $restore(this, {year, month, day, hour, min, sec, nsec, loc}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: if (loc === ptrType$2.nil) { $panic(new $String("time: missing Location in call to Date")); } @@ -7563,55 +9274,37 @@ $packages["time"] = (function() { _tuple$4 = norm(day, hour, 24); day = _tuple$4[0]; hour = _tuple$4[1]; - y = ((x = (x$1 = (new $Int64(0, year)), new $Int64(x$1.$high - -69, x$1.$low - 4075721025)), new $Uint64(x.$high, x.$low))); - n = $div64(y, new $Uint64(0, 400), false); - y = (x$2 = $mul64(new $Uint64(0, 400), n), new $Uint64(y.$high - x$2.$high, y.$low - x$2.$low)); - d = $mul64(new $Uint64(0, 146097), n); - n = $div64(y, new $Uint64(0, 100), false); - y = (x$3 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high - x$3.$high, y.$low - x$3.$low)); - d = (x$4 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high + x$4.$high, d.$low + x$4.$low)); - n = $div64(y, new $Uint64(0, 4), false); - y = (x$5 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high - x$5.$high, y.$low - x$5.$low)); - d = (x$6 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high + x$6.$high, d.$low + x$6.$low)); - n = y; - d = (x$7 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high + x$7.$high, d.$low + x$7.$low)); - d = (x$8 = (new $Uint64(0, (x$9 = month - 1 >> 0, ((x$9 < 0 || x$9 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$9])))), new $Uint64(d.$high + x$8.$high, d.$low + x$8.$low)); + d = daysSinceEpoch(year); + d = (x$1 = (new $Uint64(0, (x$2 = month - 1 >> 0, ((x$2 < 0 || x$2 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$2])))), new $Uint64(d.$high + x$1.$high, d.$low + x$1.$low)); if (isLeap(year) && month >= 3) { - d = (x$10 = new $Uint64(0, 1), new $Uint64(d.$high + x$10.$high, d.$low + x$10.$low)); + d = (x$3 = new $Uint64(0, 1), new $Uint64(d.$high + x$3.$high, d.$low + x$3.$low)); } - d = (x$11 = (new $Uint64(0, (day - 1 >> 0))), new $Uint64(d.$high + x$11.$high, d.$low + x$11.$low)); + d = (x$4 = (new $Uint64(0, (day - 1 >> 0))), new $Uint64(d.$high + x$4.$high, d.$low + x$4.$low)); abs = $mul64(d, new $Uint64(0, 86400)); - abs = (x$12 = (new $Uint64(0, ((($imul(hour, 3600)) + ($imul(min, 60)) >> 0) + sec >> 0))), new $Uint64(abs.$high + x$12.$high, abs.$low + x$12.$low)); - unix = (x$13 = (new $Int64(abs.$high, abs.$low)), new $Int64(x$13.$high + -2147483647, x$13.$low + 3844486912)); - _r = loc.lookup(unix); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple$5 = _r; + abs = (x$5 = (new $Uint64(0, ((($imul(hour, 3600)) + ($imul(min, 60)) >> 0) + sec >> 0))), new $Uint64(abs.$high + x$5.$high, abs.$low + x$5.$low)); + unix = (x$6 = (new $Int64(abs.$high, abs.$low)), new $Int64(x$6.$high + -2147483647, x$6.$low + 3844486912)); + _r$1 = loc.lookup(unix); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$5 = _r$1; offset = _tuple$5[1]; start = _tuple$5[2]; end = _tuple$5[3]; /* */ if (!((offset === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((offset === 0))) { */ case 2: - utc = (x$14 = (new $Int64(0, offset)), new $Int64(unix.$high - x$14.$high, unix.$low - x$14.$low)); - /* */ if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { $s = 5; continue; } - /* */ if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { */ case 5: - _r$1 = loc.lookup(new $Int64(start.$high - 0, start.$low - 1)); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$6 = _r$1; - offset = _tuple$6[1]; - $s = 7; continue; - /* } else if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { */ case 6: - _r$2 = loc.lookup(end); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$7 = _r$2; - offset = _tuple$7[1]; - /* } */ case 7: - case 4: - unix = (x$15 = (new $Int64(0, offset)), new $Int64(unix.$high - x$15.$high, unix.$low - x$15.$low)); + utc = (x$7 = (new $Int64(0, offset)), new $Int64(unix.$high - x$7.$high, unix.$low - x$7.$low)); + /* */ if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low)) || (utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low)) || (utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { */ case 4: + _r$2 = loc.lookup(utc); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$6 = _r$2; + offset = _tuple$6[1]; + /* } */ case 5: + unix = (x$8 = (new $Int64(0, offset)), new $Int64(unix.$high - x$8.$high, unix.$low - x$8.$low)); /* } */ case 3: t = $clone(unixTime(unix, ((nsec >> 0))), Time); t.setLoc(loc); $s = -1; return t; - /* */ } return; } if ($f === undefined) { $f = { $blk: Date }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f.abs = abs; $f.d = d; $f.day = day; $f.end = end; $f.hour = hour; $f.loc = loc; $f.m = m; $f.min = min; $f.month = month; $f.n = n; $f.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.start = start; $f.t = t; $f.unix = unix; $f.utc = utc; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.y = y; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Date, $c: true, $r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, abs, d, day, end, hour, loc, m, min, month, nsec, offset, sec, start, t, unix, utc, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, year, $s};return $f; }; $pkg.Date = Date; Time.ptr.prototype.Truncate = function(d) { @@ -7642,7 +9335,7 @@ $packages["time"] = (function() { }; Time.prototype.Round = function(d) { return this.$val.Round(d); }; div = function(t, d) { - var _q, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, d0, d1, d1$1, neg, nsec, qmod2, r, sec, sec$1, t, tmp, u0, u0x, u1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + var _q, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, d0, d1, d1$1, neg, nsec, qmod2, r, sec, sec$1, t, tmp, u0, u0x, u1, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; qmod2 = 0; r = new Duration(0, 0); neg = false; @@ -7654,16 +9347,16 @@ $packages["time"] = (function() { nsec = -nsec; if (nsec < 0) { nsec = nsec + (1000000000) >> 0; - sec = (x = new $Int64(0, 1), new $Int64(sec.$high - x.$high, sec.$low - x.$low)); + sec = (x$1 = new $Int64(0, 1), new $Int64(sec.$high - x$1.$high, sec.$low - x$1.$low)); } } - if ((d.$high < 0 || (d.$high === 0 && d.$low < 1000000000)) && (x$1 = $div64(new Duration(0, 1000000000), (new Duration(d.$high + d.$high, d.$low + d.$low)), true), (x$1.$high === 0 && x$1.$low === 0))) { + if ((d.$high < 0 || (d.$high === 0 && d.$low < 1000000000)) && (x$2 = $div64(new Duration(0, 1000000000), (new Duration(d.$high + d.$high, d.$low + d.$low)), true), (x$2.$high === 0 && x$2.$low === 0))) { qmod2 = (((_q = nsec / (((d.$low + ((d.$high >> 31) * 4294967296)) >> 0)), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0)) & 1; - r = (new Duration(0, (_r = nsec % (((d.$low + ((d.$high >> 31) * 4294967296)) >> 0)), _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); - } else if ((x$2 = $div64(d, new Duration(0, 1000000000), true), (x$2.$high === 0 && x$2.$low === 0))) { - d1 = ((x$3 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$3.$high, x$3.$low))); - qmod2 = (((x$4 = $div64(sec, d1, false), x$4.$low + ((x$4.$high >> 31) * 4294967296)) >> 0)) & 1; - r = (x$5 = $mul64(((x$6 = $div64(sec, d1, true), new Duration(x$6.$high, x$6.$low))), new Duration(0, 1000000000)), x$7 = (new Duration(0, nsec)), new Duration(x$5.$high + x$7.$high, x$5.$low + x$7.$low)); + r = (new Duration(0, (_r$1 = nsec % (((d.$low + ((d.$high >> 31) * 4294967296)) >> 0)), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")))); + } else if ((x$3 = $div64(d, new Duration(0, 1000000000), true), (x$3.$high === 0 && x$3.$low === 0))) { + d1 = ((x$4 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$4.$high, x$4.$low))); + qmod2 = (((x$5 = $div64(sec, d1, false), x$5.$low + ((x$5.$high >> 31) * 4294967296)) >> 0)) & 1; + r = (x$6 = $mul64(((x$7 = $div64(sec, d1, true), new Duration(x$7.$high, x$7.$low))), new Duration(0, 1000000000)), x$8 = (new Duration(0, nsec)), new Duration(x$6.$high + x$8.$high, x$6.$low + x$8.$low)); } else { sec$1 = (new $Uint64(sec.$high, sec.$low)); tmp = $mul64(($shiftRightUint64(sec$1, 32)), new $Uint64(0, 1000000000)); @@ -7675,18 +9368,18 @@ $packages["time"] = (function() { u0x = _tmp; u0 = _tmp$1; if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { - u1 = (x$8 = new $Uint64(0, 1), new $Uint64(u1.$high + x$8.$high, u1.$low + x$8.$low)); + u1 = (x$9 = new $Uint64(0, 1), new $Uint64(u1.$high + x$9.$high, u1.$low + x$9.$low)); } _tmp$2 = u0; - _tmp$3 = (x$9 = (new $Uint64(0, nsec)), new $Uint64(u0.$high + x$9.$high, u0.$low + x$9.$low)); + _tmp$3 = (x$10 = (new $Uint64(0, nsec)), new $Uint64(u0.$high + x$10.$high, u0.$low + x$10.$low)); u0x = _tmp$2; u0 = _tmp$3; if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { - u1 = (x$10 = new $Uint64(0, 1), new $Uint64(u1.$high + x$10.$high, u1.$low + x$10.$low)); + u1 = (x$11 = new $Uint64(0, 1), new $Uint64(u1.$high + x$11.$high, u1.$low + x$11.$low)); } d1$1 = (new $Uint64(d.$high, d.$low)); while (true) { - if (!(!((x$11 = $shiftRightUint64(d1$1, 63), (x$11.$high === 0 && x$11.$low === 1))))) { break; } + if (!(!((x$12 = $shiftRightUint64(d1$1, 63), (x$12.$high === 0 && x$12.$low === 1))))) { break; } d1$1 = $shiftLeft64(d1$1, (1)); } d0 = new $Uint64(0, 0); @@ -7699,15 +9392,15 @@ $packages["time"] = (function() { u0x = _tmp$4; u0 = _tmp$5; if ((u0.$high > u0x.$high || (u0.$high === u0x.$high && u0.$low > u0x.$low))) { - u1 = (x$12 = new $Uint64(0, 1), new $Uint64(u1.$high - x$12.$high, u1.$low - x$12.$low)); + u1 = (x$13 = new $Uint64(0, 1), new $Uint64(u1.$high - x$13.$high, u1.$low - x$13.$low)); } - u1 = (x$13 = d1$1, new $Uint64(u1.$high - x$13.$high, u1.$low - x$13.$low)); + u1 = (x$14 = d1$1, new $Uint64(u1.$high - x$14.$high, u1.$low - x$14.$low)); } - if ((d1$1.$high === 0 && d1$1.$low === 0) && (x$14 = (new $Uint64(d.$high, d.$low)), (d0.$high === x$14.$high && d0.$low === x$14.$low))) { + if ((d1$1.$high === 0 && d1$1.$low === 0) && (x$15 = (new $Uint64(d.$high, d.$low)), (d0.$high === x$15.$high && d0.$low === x$15.$low))) { break; } d0 = $shiftRightUint64(d0, (1)); - d0 = (x$15 = $shiftLeft64((new $Uint64(d1$1.$high & 0, (d1$1.$low & 1) >>> 0)), 63), new $Uint64(d0.$high | x$15.$high, (d0.$low | x$15.$low) >>> 0)); + d0 = (x$16 = $shiftLeft64((new $Uint64(d1$1.$high & 0, (d1$1.$low & 1) >>> 0)), 63), new $Uint64(d0.$high | x$16.$high, (d0.$low | x$16.$low) >>> 0)); d1$1 = $shiftRightUint64(d1$1, (1)); } r = (new Duration(u0.$high, u0.$low)); @@ -7718,220 +9411,1769 @@ $packages["time"] = (function() { } return [qmod2, r]; }; - Location.ptr.prototype.get = function() { - var l, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - l = this; - if (l === ptrType$2.nil) { - $s = -1; return utcLoc; - } - /* */ if (l === localLoc) { $s = 1; continue; } + when = function(d) { + var {$24r, _r$1, _r$2, d, t, x$1, x$2, $s, $r, $c} = $restore(this, {d}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* */ if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { $s = 1; continue; } /* */ $s = 2; continue; - /* if (l === localLoc) { */ case 1: - $r = localOnce.Do(initLocal); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { */ case 1: + _r$1 = runtimeNano(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1; + $s = 4; case 4: return $24r; /* } */ case 2: - $s = -1; return l; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.get }; } $f.l = l; $f.$s = $s; $f.$r = $r; return $f; - }; - Location.prototype.get = function() { return this.$val.get(); }; - Location.ptr.prototype.String = function() { - var _r, l, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - l = this; - _r = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r.name; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.String }; } $f._r = _r; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; - }; - Location.prototype.String = function() { return this.$val.String(); }; - FixedZone = function(name, offset) { - var l, name, offset, x; - l = new Location.ptr(name, new sliceType([new zone.ptr(name, offset, false)]), new sliceType$1([new zoneTrans.ptr(new $Int64(-2147483648, 0), 0, false, false)]), new $Int64(-2147483648, 0), new $Int64(2147483647, 4294967295), ptrType.nil); - l.cacheZone = (x = l.zone, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); - return l; - }; - $pkg.FixedZone = FixedZone; - Location.ptr.prototype.lookup = function(sec) { - var _q, _r, end, hi, l, lim, lo, m, name, offset, sec, start, tx, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, zone$1, zone$2, zone$3, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; end = $f.end; hi = $f.hi; l = $f.l; lim = $f.lim; lo = $f.lo; m = $f.m; name = $f.name; offset = $f.offset; sec = $f.sec; start = $f.start; tx = $f.tx; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; zone$1 = $f.zone$1; zone$2 = $f.zone$2; zone$3 = $f.zone$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - name = ""; - offset = 0; - start = new $Int64(0, 0); - end = new $Int64(0, 0); - l = this; - _r = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - l = _r; - if (l.zone.$length === 0) { - name = "UTC"; - offset = 0; - start = new $Int64(-2147483648, 0); - end = new $Int64(2147483647, 4294967295); - $s = -1; return [name, offset, start, end]; + _r$2 = runtimeNano(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + t = (x$1 = _r$2, x$2 = (new $Int64(d.$high, d.$low)), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); + if ((t.$high < 0 || (t.$high === 0 && t.$low < 0))) { + t = new $Int64(2147483647, 4294967295); } - zone$1 = l.cacheZone; - if (!(zone$1 === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { - name = zone$1.name; - offset = zone$1.offset; - start = l.cacheStart; - end = l.cacheEnd; - $s = -1; return [name, offset, start, end]; + $s = -1; return t; + /* */ } return; } var $f = {$blk: when, $c: true, $r, $24r, _r$1, _r$2, d, t, x$1, x$2, $s};return $f; + }; + Timer.ptr.prototype.Stop = function() { + var t; + t = this; + if (t.r.f === $throwNilPointerError) { + $panic(new $String("time: Stop called on uninitialized Timer")); } - if ((l.tx.$length === 0) || (x$2 = (x$3 = l.tx, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).when, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { - zone$2 = (x$4 = l.zone, x$5 = l.lookupFirstZone(), ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])); - name = zone$2.name; - offset = zone$2.offset; - start = new $Int64(-2147483648, 0); - if (l.tx.$length > 0) { - end = (x$6 = l.tx, (0 >= x$6.$length ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + 0])).when; - } else { - end = new $Int64(2147483647, 4294967295); - } - $s = -1; return [name, offset, start, end]; + return stopTimer(t.r); + }; + Timer.prototype.Stop = function() { return this.$val.Stop(); }; + Timer.ptr.prototype.Reset = function(d) { + var {$24r, _r$1, _r$2, d, t, w, $s, $r, $c} = $restore(this, {d}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if (t.r.f === $throwNilPointerError) { + $panic(new $String("time: Reset called on uninitialized Timer")); } - tx = l.tx; - end = new $Int64(2147483647, 4294967295); - lo = 0; - hi = tx.$length; + _r$1 = when(d); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + w = _r$1; + _r$2 = resetTimer(t.r, w); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Timer.ptr.prototype.Reset, $c: true, $r, $24r, _r$1, _r$2, d, t, w, $s};return $f; + }; + Timer.prototype.Reset = function(d) { return this.$val.Reset(d); }; + AfterFunc = function(d, f) { + var {_r$1, d, f, t, $s, $r, $c} = $restore(this, {d, f}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = when(d); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + t = new Timer.ptr($chanNil, new runtimeTimer.ptr(0, _r$1, new $Int64(0, 0), goFunc, new funcType(f), 0, null, false)); + $r = startTimer(t.r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return t; + /* */ } return; } var $f = {$blk: AfterFunc, $c: true, $r, _r$1, d, f, t, $s};return $f; + }; + $pkg.AfterFunc = AfterFunc; + goFunc = function(arg, seq) { + var arg, seq; + $go($assertType(arg, funcType), []); + }; + initLocal = function() { + var _q, _r$1, d, min, offset, z; + localLoc.name = "Local"; + z = new zone.ptr("", 0, false); + d = new ($global.Date)(); + offset = $imul(($parseInt(d.getTimezoneOffset()) >> 0), -1); + z.offset = $imul(offset, 60); + z.name = "UTC"; + if (offset < 0) { + z.name = z.name + ("-"); + offset = $imul(offset, (-1)); + } else { + z.name = z.name + ("+"); + } + z.name = z.name + (itoa((_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")))); + min = (_r$1 = offset % 60, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); + if (!((min === 0))) { + z.name = z.name + (":" + itoa(min)); + } + localLoc.zone = new sliceType([$clone(z, zone)]); + }; + itoa = function(i) { + var i; + if (i < 10) { + return $substring("0123456789", i, (i + 1 >> 0)); + } + return $substring("00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899", ($imul(i, 2)), (($imul(i, 2)) + 2 >> 0)); + }; + init = function() { + $unused(Unix(new $Int64(0, 0), new $Int64(0, 0))); + }; + now = function() { + var {_r$1, _tmp, _tmp$1, _tmp$2, mono, n, nsec, sec, x$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + sec = new $Int64(0, 0); + nsec = 0; + mono = new $Int64(0, 0); + _r$1 = runtimeNano(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + n = _r$1; + _tmp = $div64(n, new $Int64(0, 1000000000), false); + _tmp$1 = (((x$1 = $div64(n, new $Int64(0, 1000000000), true), x$1.$low + ((x$1.$high >> 31) * 4294967296)) >> 0)); + _tmp$2 = n; + sec = _tmp; + nsec = _tmp$1; + mono = _tmp$2; + $s = -1; return [sec, nsec, mono]; + /* */ } return; } var $f = {$blk: now, $c: true, $r, _r$1, _tmp, _tmp$1, _tmp$2, mono, n, nsec, sec, x$1, $s};return $f; + }; + Sleep = function(d) { + var {_r$1, c, d, x$1, $s, $r, $c} = $restore(this, {d}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = [c]; + c[0] = new $Chan(structType, 0); + $setTimeout((function(c) { return function() { + $close(c[0]); + }; })(c), (((x$1 = $div64(d, new Duration(0, 1000000), false), x$1.$low + ((x$1.$high >> 31) * 4294967296)) >> 0))); + _r$1 = $recv(c[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1[0]; + $s = -1; return; + /* */ } return; } var $f = {$blk: Sleep, $c: true, $r, _r$1, c, d, x$1, $s};return $f; + }; + $pkg.Sleep = Sleep; + startTimer = function(t) { + var {_r$1, diff, t, x$1, x$2, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = [t]; + t[0].active = true; + _r$1 = runtimeNano(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + diff = $div64(((x$1 = t[0].when, x$2 = _r$1, new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low))), new $Int64(0, 1000000), false); + if ((diff.$high > 0 || (diff.$high === 0 && diff.$low > 2147483647))) { + $s = -1; return; + } + if ((diff.$high < 0 || (diff.$high === 0 && diff.$low < 0))) { + diff = new $Int64(0, 0); + } + t[0].timeout = $setTimeout((function(t) { return function $b() { + var {x$3, x$4, x$5, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t[0].active = false; + /* */ if (!((x$3 = t[0].period, (x$3.$high === 0 && x$3.$low === 0)))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((x$3 = t[0].period, (x$3.$high === 0 && x$3.$low === 0)))) { */ case 1: + t[0].when = (x$4 = t[0].when, x$5 = t[0].period, new $Int64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); + $r = startTimer(t[0]); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + $go(t[0].f, [t[0].arg, 0]); + $s = -1; return; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, x$3, x$4, x$5, $s};return $f; + }; })(t), $externalize(new $Int64(diff.$high + 0, diff.$low + 1), $Int64)); + $s = -1; return; + /* */ } return; } var $f = {$blk: startTimer, $c: true, $r, _r$1, diff, t, x$1, x$2, $s};return $f; + }; + stopTimer = function(t) { + var t, wasActive; + $global.clearTimeout(t.timeout); + wasActive = t.active; + t.active = false; + return wasActive; + }; + modTimer = function(t, when$1, period, f, arg, seq) { + var {arg, f, period, seq, t, when$1, $s, $r, $c} = $restore(this, {t, when$1, period, f, arg, seq}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + stopTimer(t); + t.when = when$1; + t.period = period; + t.f = f; + t.arg = arg; + t.seq = seq; + $r = startTimer(t); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: modTimer, $c: true, $r, arg, f, period, seq, t, when$1, $s};return $f; + }; + resetTimer = function(t, when$1) { + var {t, wasActive, when$1, $s, $r, $c} = $restore(this, {t, when$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + wasActive = t.active; + $r = modTimer(t, when$1, t.period, t.f, t.arg, t.seq); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return wasActive; + /* */ } return; } var $f = {$blk: resetTimer, $c: true, $r, t, wasActive, when$1, $s};return $f; + }; + startsWithLowerCase = function(str) { + var c, str; + if (str.length === 0) { + return false; + } + c = str.charCodeAt(0); + return 97 <= c && c <= 122; + }; + nextStdChunk = function(layout) { + var _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$44, _tmp$45, _tmp$46, _tmp$47, _tmp$48, _tmp$49, _tmp$5, _tmp$50, _tmp$51, _tmp$52, _tmp$53, _tmp$54, _tmp$55, _tmp$56, _tmp$57, _tmp$58, _tmp$59, _tmp$6, _tmp$60, _tmp$61, _tmp$62, _tmp$63, _tmp$64, _tmp$65, _tmp$66, _tmp$67, _tmp$68, _tmp$69, _tmp$7, _tmp$70, _tmp$71, _tmp$72, _tmp$73, _tmp$74, _tmp$75, _tmp$76, _tmp$77, _tmp$78, _tmp$79, _tmp$8, _tmp$80, _tmp$81, _tmp$82, _tmp$83, _tmp$84, _tmp$85, _tmp$86, _tmp$87, _tmp$88, _tmp$89, _tmp$9, _tmp$90, _tmp$91, _tmp$92, c, ch, code, i, j, layout, prefix, std, std$1, suffix, x$1; + prefix = ""; + std = 0; + suffix = ""; + i = 0; while (true) { - if (!((hi - lo >> 0) > 1)) { break; } - m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - lim = ((m < 0 || m >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + m]).when; - if ((sec.$high < lim.$high || (sec.$high === lim.$high && sec.$low < lim.$low))) { - end = lim; - hi = m; - } else { - lo = m; + if (!(i < layout.length)) { break; } + c = ((layout.charCodeAt(i) >> 0)); + _1 = c; + if (_1 === (74)) { + if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "Jan") { + if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "January") { + _tmp = $substring(layout, 0, i); + _tmp$1 = 257; + _tmp$2 = $substring(layout, (i + 7 >> 0)); + prefix = _tmp; + std = _tmp$1; + suffix = _tmp$2; + return [prefix, std, suffix]; + } + if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { + _tmp$3 = $substring(layout, 0, i); + _tmp$4 = 258; + _tmp$5 = $substring(layout, (i + 3 >> 0)); + prefix = _tmp$3; + std = _tmp$4; + suffix = _tmp$5; + return [prefix, std, suffix]; + } + } + } else if (_1 === (77)) { + if (layout.length >= (i + 3 >> 0)) { + if ($substring(layout, i, (i + 3 >> 0)) === "Mon") { + if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Monday") { + _tmp$6 = $substring(layout, 0, i); + _tmp$7 = 261; + _tmp$8 = $substring(layout, (i + 6 >> 0)); + prefix = _tmp$6; + std = _tmp$7; + suffix = _tmp$8; + return [prefix, std, suffix]; + } + if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { + _tmp$9 = $substring(layout, 0, i); + _tmp$10 = 262; + _tmp$11 = $substring(layout, (i + 3 >> 0)); + prefix = _tmp$9; + std = _tmp$10; + suffix = _tmp$11; + return [prefix, std, suffix]; + } + } + if ($substring(layout, i, (i + 3 >> 0)) === "MST") { + _tmp$12 = $substring(layout, 0, i); + _tmp$13 = 23; + _tmp$14 = $substring(layout, (i + 3 >> 0)); + prefix = _tmp$12; + std = _tmp$13; + suffix = _tmp$14; + return [prefix, std, suffix]; + } + } + } else if (_1 === (48)) { + if (layout.length >= (i + 2 >> 0) && 49 <= layout.charCodeAt((i + 1 >> 0)) && layout.charCodeAt((i + 1 >> 0)) <= 54) { + _tmp$15 = $substring(layout, 0, i); + _tmp$16 = (x$1 = layout.charCodeAt((i + 1 >> 0)) - 49 << 24 >>> 24, ((x$1 < 0 || x$1 >= std0x.length) ? ($throwRuntimeError("index out of range"), undefined) : std0x[x$1])); + _tmp$17 = $substring(layout, (i + 2 >> 0)); + prefix = _tmp$15; + std = _tmp$16; + suffix = _tmp$17; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 3 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 48) && (layout.charCodeAt((i + 2 >> 0)) === 50)) { + _tmp$18 = $substring(layout, 0, i); + _tmp$19 = 267; + _tmp$20 = $substring(layout, (i + 3 >> 0)); + prefix = _tmp$18; + std = _tmp$19; + suffix = _tmp$20; + return [prefix, std, suffix]; + } + } else if (_1 === (49)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 53)) { + _tmp$21 = $substring(layout, 0, i); + _tmp$22 = 524; + _tmp$23 = $substring(layout, (i + 2 >> 0)); + prefix = _tmp$21; + std = _tmp$22; + suffix = _tmp$23; + return [prefix, std, suffix]; + } + _tmp$24 = $substring(layout, 0, i); + _tmp$25 = 259; + _tmp$26 = $substring(layout, (i + 1 >> 0)); + prefix = _tmp$24; + std = _tmp$25; + suffix = _tmp$26; + return [prefix, std, suffix]; + } else if (_1 === (50)) { + if (layout.length >= (i + 4 >> 0) && $substring(layout, i, (i + 4 >> 0)) === "2006") { + _tmp$27 = $substring(layout, 0, i); + _tmp$28 = 275; + _tmp$29 = $substring(layout, (i + 4 >> 0)); + prefix = _tmp$27; + std = _tmp$28; + suffix = _tmp$29; + return [prefix, std, suffix]; + } + _tmp$30 = $substring(layout, 0, i); + _tmp$31 = 263; + _tmp$32 = $substring(layout, (i + 1 >> 0)); + prefix = _tmp$30; + std = _tmp$31; + suffix = _tmp$32; + return [prefix, std, suffix]; + } else if (_1 === (95)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 50)) { + if (layout.length >= (i + 5 >> 0) && $substring(layout, (i + 1 >> 0), (i + 5 >> 0)) === "2006") { + _tmp$33 = $substring(layout, 0, (i + 1 >> 0)); + _tmp$34 = 275; + _tmp$35 = $substring(layout, (i + 5 >> 0)); + prefix = _tmp$33; + std = _tmp$34; + suffix = _tmp$35; + return [prefix, std, suffix]; + } + _tmp$36 = $substring(layout, 0, i); + _tmp$37 = 264; + _tmp$38 = $substring(layout, (i + 2 >> 0)); + prefix = _tmp$36; + std = _tmp$37; + suffix = _tmp$38; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 3 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 95) && (layout.charCodeAt((i + 2 >> 0)) === 50)) { + _tmp$39 = $substring(layout, 0, i); + _tmp$40 = 266; + _tmp$41 = $substring(layout, (i + 3 >> 0)); + prefix = _tmp$39; + std = _tmp$40; + suffix = _tmp$41; + return [prefix, std, suffix]; + } + } else if (_1 === (51)) { + _tmp$42 = $substring(layout, 0, i); + _tmp$43 = 525; + _tmp$44 = $substring(layout, (i + 1 >> 0)); + prefix = _tmp$42; + std = _tmp$43; + suffix = _tmp$44; + return [prefix, std, suffix]; + } else if (_1 === (52)) { + _tmp$45 = $substring(layout, 0, i); + _tmp$46 = 527; + _tmp$47 = $substring(layout, (i + 1 >> 0)); + prefix = _tmp$45; + std = _tmp$46; + suffix = _tmp$47; + return [prefix, std, suffix]; + } else if (_1 === (53)) { + _tmp$48 = $substring(layout, 0, i); + _tmp$49 = 529; + _tmp$50 = $substring(layout, (i + 1 >> 0)); + prefix = _tmp$48; + std = _tmp$49; + suffix = _tmp$50; + return [prefix, std, suffix]; + } else if (_1 === (80)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 77)) { + _tmp$51 = $substring(layout, 0, i); + _tmp$52 = 533; + _tmp$53 = $substring(layout, (i + 2 >> 0)); + prefix = _tmp$51; + std = _tmp$52; + suffix = _tmp$53; + return [prefix, std, suffix]; + } + } else if (_1 === (112)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 109)) { + _tmp$54 = $substring(layout, 0, i); + _tmp$55 = 534; + _tmp$56 = $substring(layout, (i + 2 >> 0)); + prefix = _tmp$54; + std = _tmp$55; + suffix = _tmp$56; + return [prefix, std, suffix]; + } + } else if (_1 === (45)) { + if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "-070000") { + _tmp$57 = $substring(layout, 0, i); + _tmp$58 = 30; + _tmp$59 = $substring(layout, (i + 7 >> 0)); + prefix = _tmp$57; + std = _tmp$58; + suffix = _tmp$59; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "-07:00:00") { + _tmp$60 = $substring(layout, 0, i); + _tmp$61 = 33; + _tmp$62 = $substring(layout, (i + 9 >> 0)); + prefix = _tmp$60; + std = _tmp$61; + suffix = _tmp$62; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "-0700") { + _tmp$63 = $substring(layout, 0, i); + _tmp$64 = 29; + _tmp$65 = $substring(layout, (i + 5 >> 0)); + prefix = _tmp$63; + std = _tmp$64; + suffix = _tmp$65; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "-07:00") { + _tmp$66 = $substring(layout, 0, i); + _tmp$67 = 32; + _tmp$68 = $substring(layout, (i + 6 >> 0)); + prefix = _tmp$66; + std = _tmp$67; + suffix = _tmp$68; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "-07") { + _tmp$69 = $substring(layout, 0, i); + _tmp$70 = 31; + _tmp$71 = $substring(layout, (i + 3 >> 0)); + prefix = _tmp$69; + std = _tmp$70; + suffix = _tmp$71; + return [prefix, std, suffix]; + } + } else if (_1 === (90)) { + if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "Z070000") { + _tmp$72 = $substring(layout, 0, i); + _tmp$73 = 25; + _tmp$74 = $substring(layout, (i + 7 >> 0)); + prefix = _tmp$72; + std = _tmp$73; + suffix = _tmp$74; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "Z07:00:00") { + _tmp$75 = $substring(layout, 0, i); + _tmp$76 = 28; + _tmp$77 = $substring(layout, (i + 9 >> 0)); + prefix = _tmp$75; + std = _tmp$76; + suffix = _tmp$77; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "Z0700") { + _tmp$78 = $substring(layout, 0, i); + _tmp$79 = 24; + _tmp$80 = $substring(layout, (i + 5 >> 0)); + prefix = _tmp$78; + std = _tmp$79; + suffix = _tmp$80; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Z07:00") { + _tmp$81 = $substring(layout, 0, i); + _tmp$82 = 27; + _tmp$83 = $substring(layout, (i + 6 >> 0)); + prefix = _tmp$81; + std = _tmp$82; + suffix = _tmp$83; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "Z07") { + _tmp$84 = $substring(layout, 0, i); + _tmp$85 = 26; + _tmp$86 = $substring(layout, (i + 3 >> 0)); + prefix = _tmp$84; + std = _tmp$85; + suffix = _tmp$86; + return [prefix, std, suffix]; + } + } else if ((_1 === (46)) || (_1 === (44))) { + if ((i + 1 >> 0) < layout.length && ((layout.charCodeAt((i + 1 >> 0)) === 48) || (layout.charCodeAt((i + 1 >> 0)) === 57))) { + ch = layout.charCodeAt((i + 1 >> 0)); + j = i + 1 >> 0; + while (true) { + if (!(j < layout.length && (layout.charCodeAt(j) === ch))) { break; } + j = j + (1) >> 0; + } + if (!isDigit(layout, j)) { + code = 34; + if (layout.charCodeAt((i + 1 >> 0)) === 57) { + code = 35; + } + std$1 = stdFracSecond(code, j - ((i + 1 >> 0)) >> 0, c); + _tmp$87 = $substring(layout, 0, i); + _tmp$88 = std$1; + _tmp$89 = $substring(layout, j); + prefix = _tmp$87; + std = _tmp$88; + suffix = _tmp$89; + return [prefix, std, suffix]; + } + } + } + i = i + (1) >> 0; + } + _tmp$90 = layout; + _tmp$91 = 0; + _tmp$92 = ""; + prefix = _tmp$90; + std = _tmp$91; + suffix = _tmp$92; + return [prefix, std, suffix]; + }; + match = function(s1, s2) { + var c1, c2, i, s1, s2; + i = 0; + while (true) { + if (!(i < s1.length)) { break; } + c1 = s1.charCodeAt(i); + c2 = s2.charCodeAt(i); + if (!((c1 === c2))) { + c1 = (c1 | (32)) >>> 0; + c2 = (c2 | (32)) >>> 0; + if (!((c1 === c2)) || c1 < 97 || c1 > 122) { + return false; + } + } + i = i + (1) >> 0; + } + return true; + }; + lookup = function(tab, val) { + var _i, _ref, i, tab, v, val; + _ref = tab; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + if (val.length >= v.length && match($substring(val, 0, v.length), v)) { + return [i, $substring(val, v.length), $ifaceNil]; + } + _i++; + } + return [-1, val, errBad]; + }; + appendInt = function(b, x$1, width) { + var _q, b, buf, i, q, u, w, width, x$1; + u = ((x$1 >>> 0)); + if (x$1 < 0) { + b = $append(b, 45); + u = ((-x$1 >>> 0)); + } + buf = arrayType$3.zero(); + i = 20; + while (true) { + if (!(u >= 10)) { break; } + i = i - (1) >> 0; + q = (_q = u / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((((48 + u >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24))); + u = q; + } + i = i - (1) >> 0; + ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((48 + u >>> 0) << 24 >>> 24))); + w = 20 - i >> 0; + while (true) { + if (!(w < width)) { break; } + b = $append(b, 48); + w = w + (1) >> 0; + } + return $appendSlice(b, $subslice(new sliceType$3(buf), i)); + }; + atoi = function(s) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, neg, q, rem, s, x$1; + x$1 = 0; + err = $ifaceNil; + neg = false; + if (!(s === "") && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { + neg = s.charCodeAt(0) === 45; + s = $substring(s, 1); + } + _tuple = leadingInt(s); + q = _tuple[0]; + rem = _tuple[1]; + err = _tuple[2]; + x$1 = ((q.$low >> 0)); + if (!($interfaceIsEqual(err, $ifaceNil)) || !(rem === "")) { + _tmp = 0; + _tmp$1 = atoiError; + x$1 = _tmp; + err = _tmp$1; + return [x$1, err]; + } + if (neg) { + x$1 = -x$1; + } + _tmp$2 = x$1; + _tmp$3 = $ifaceNil; + x$1 = _tmp$2; + err = _tmp$3; + return [x$1, err]; + }; + stdFracSecond = function(code, n, c) { + var c, code, n; + if (c === 46) { + return code | ((((n & 4095)) << 16 >> 0)); + } + return (code | ((((n & 4095)) << 16 >> 0))) | 268435456; + }; + digitsLen = function(std) { + var std; + return ((std >> 16 >> 0)) & 4095; + }; + separator = function(std) { + var std; + if (((std >> 28 >> 0)) === 0) { + return 46; + } + return 44; + }; + formatNano = function(b, nanosec, std) { + var _q, _r$1, b, buf, n, nanosec, separator$1, start, std, trim, u, x$1; + n = digitsLen(std); + separator$1 = separator(std); + trim = (std & 65535) === 35; + u = nanosec; + buf = arrayType$4.zero(); + start = 9; + while (true) { + if (!(start > 0)) { break; } + start = start - (1) >> 0; + ((start < 0 || start >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[start] = ((((_r$1 = u % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24))); + u = (_q = u / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + } + if (n > 9) { + n = 9; + } + if (trim) { + while (true) { + if (!(n > 0 && ((x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x$1])) === 48))) { break; } + n = n - (1) >> 0; + } + if (n === 0) { + return b; } } - zone$3 = (x$7 = l.zone, x$8 = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).index, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8])); - name = zone$3.name; - offset = zone$3.offset; - start = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).when; - $s = -1; return [name, offset, start, end]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookup }; } $f._q = _q; $f._r = _r; $f.end = end; $f.hi = hi; $f.l = l; $f.lim = lim; $f.lo = lo; $f.m = m; $f.name = name; $f.offset = offset; $f.sec = sec; $f.start = start; $f.tx = tx; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.zone$3 = zone$3; $f.$s = $s; $f.$r = $r; return $f; + b = $append(b, separator$1); + return $appendSlice(b, $subslice(new sliceType$3(buf), 0, n)); }; - Location.prototype.lookup = function(sec) { return this.$val.lookup(sec); }; - Location.ptr.prototype.lookupFirstZone = function() { - var _i, _ref, l, x, x$1, x$2, x$3, x$4, x$5, zi, zi$1; - l = this; - if (!l.firstZoneUsed()) { + Time.ptr.prototype.String = function() { + var {_r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, buf, m0, m1, m2, s, sign, t, wid, x$1, x$2, x$3, x$4, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + _r$1 = $clone(t, Time).Format("2006-01-02 15:04:05.999999999 -0700 MST"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + s = _r$1; + if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { + m2 = ((x$3 = t.ext, new $Uint64(x$3.$high, x$3.$low))); + sign = 43; + if ((x$4 = t.ext, (x$4.$high < 0 || (x$4.$high === 0 && x$4.$low < 0)))) { + sign = 45; + m2 = new $Uint64(-m2.$high, -m2.$low); + } + _tmp = $div64(m2, new $Uint64(0, 1000000000), false); + _tmp$1 = $div64(m2, new $Uint64(0, 1000000000), true); + m1 = _tmp; + m2 = _tmp$1; + _tmp$2 = $div64(m1, new $Uint64(0, 1000000000), false); + _tmp$3 = $div64(m1, new $Uint64(0, 1000000000), true); + m0 = _tmp$2; + m1 = _tmp$3; + buf = $makeSlice(sliceType$3, 0, 24); + buf = $appendSlice(buf, " m="); + buf = $append(buf, sign); + wid = 0; + if (!((m0.$high === 0 && m0.$low === 0))) { + buf = appendInt(buf, ((m0.$low >> 0)), 0); + wid = 9; + } + buf = appendInt(buf, ((m1.$low >> 0)), wid); + buf = $append(buf, 46); + buf = appendInt(buf, ((m2.$low >> 0)), 9); + s = s + (($bytesToString(buf))); + } + $s = -1; return s; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.String, $c: true, $r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, buf, m0, m1, m2, s, sign, t, wid, x$1, x$2, x$3, x$4, $s};return $f; + }; + Time.prototype.String = function() { return this.$val.String(); }; + Time.ptr.prototype.GoString = function() { + var {_1, _arg, _arg$1, _arg$10, _arg$11, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, buf, loc, month, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + buf = $makeSlice(sliceType$3, 0, 70); + buf = $appendSlice(buf, "time.Date("); + _arg = buf; + _r$1 = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _arg$1 = _r$1; + _r$2 = appendInt(_arg, _arg$1, 0); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + buf = _r$2; + _r$3 = $clone(t, Time).Month(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + month = _r$3; + /* */ if (1 <= month && month <= 12) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (1 <= month && month <= 12) { */ case 4: + buf = $appendSlice(buf, ", time."); + _arg$2 = buf; + _r$4 = $clone(t, Time).Month(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$5 = new Month(_r$4).String(); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$3 = _r$5; + buf = $appendSlice(_arg$2, _arg$3); + $s = 6; continue; + /* } else { */ case 5: + buf = appendInt(buf, ((month >> 0)), 0); + /* } */ case 6: + buf = $appendSlice(buf, ", "); + _arg$4 = buf; + _r$6 = $clone(t, Time).Day(); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _arg$5 = _r$6; + _r$7 = appendInt(_arg$4, _arg$5, 0); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + buf = _r$7; + buf = $appendSlice(buf, ", "); + _arg$6 = buf; + _r$8 = $clone(t, Time).Hour(); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + _arg$7 = _r$8; + _r$9 = appendInt(_arg$6, _arg$7, 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + buf = _r$9; + buf = $appendSlice(buf, ", "); + _arg$8 = buf; + _r$10 = $clone(t, Time).Minute(); /* */ $s = 13; case 13: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _arg$9 = _r$10; + _r$11 = appendInt(_arg$8, _arg$9, 0); /* */ $s = 14; case 14: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + buf = _r$11; + buf = $appendSlice(buf, ", "); + _arg$10 = buf; + _r$12 = $clone(t, Time).Second(); /* */ $s = 15; case 15: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + _arg$11 = _r$12; + _r$13 = appendInt(_arg$10, _arg$11, 0); /* */ $s = 16; case 16: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + buf = _r$13; + buf = $appendSlice(buf, ", "); + buf = appendInt(buf, $clone(t, Time).Nanosecond(), 0); + buf = $appendSlice(buf, ", "); + loc = $clone(t, Time).Location(); + _1 = loc; + if (_1 === ($pkg.UTC) || _1 === ptrType$2.nil) { + buf = $appendSlice(buf, "time.UTC"); + } else if (_1 === ($pkg.Local)) { + buf = $appendSlice(buf, "time.Local"); + } else { + buf = $appendSlice(buf, "time.Location("); + buf = $appendSlice(buf, (new sliceType$3($stringToBytes(quote(loc.name))))); + buf = $appendSlice(buf, ")"); + } + buf = $append(buf, 41); + $s = -1; return ($bytesToString(buf)); + /* */ } return; } var $f = {$blk: Time.ptr.prototype.GoString, $c: true, $r, _1, _arg, _arg$1, _arg$10, _arg$11, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, buf, loc, month, t, $s};return $f; + }; + Time.prototype.GoString = function() { return this.$val.GoString(); }; + Time.ptr.prototype.Format = function(layout) { + var {_r$1, b, buf, layout, max, t, $s, $r, $c} = $restore(this, {layout}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + b = sliceType$3.nil; + max = layout.length + 10 >> 0; + if (max < 64) { + buf = arrayType$5.zero(); + b = $subslice(new sliceType$3(buf), 0, 0); + } else { + b = $makeSlice(sliceType$3, 0, max); + } + _r$1 = $clone(t, Time).AppendFormat(b, layout); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + b = _r$1; + $s = -1; return ($bytesToString(b)); + /* */ } return; } var $f = {$blk: Time.ptr.prototype.Format, $c: true, $r, _r$1, b, buf, layout, max, t, $s};return $f; + }; + Time.prototype.Format = function(layout) { return this.$val.Format(layout); }; + Time.ptr.prototype.AppendFormat = function(b, layout) { + var {_1, _q, _q$1, _q$2, _q$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, _tuple$3, abs, absoffset, b, day, hour, hr, hr$1, layout, m, min, month, name, offset, prefix, s, sec, std, suffix, t, y, yday, year, zone$1, zone$2, $s, $r, $c} = $restore(this, {b, layout}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + _r$1 = $clone(t, Time).locabs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + name = _tuple[0]; + offset = _tuple[1]; + abs = _tuple[2]; + year = -1; + month = 0; + day = 0; + yday = 0; + hour = -1; + min = 0; + sec = 0; + while (true) { + if (!(!(layout === ""))) { break; } + _tuple$1 = nextStdChunk(layout); + prefix = _tuple$1[0]; + std = _tuple$1[1]; + suffix = _tuple$1[2]; + if (!(prefix === "")) { + b = $appendSlice(b, prefix); + } + if (std === 0) { + break; + } + layout = suffix; + if (year < 0 && !(((std & 256) === 0))) { + _tuple$2 = absDate(abs, true); + year = _tuple$2[0]; + month = _tuple$2[1]; + day = _tuple$2[2]; + yday = _tuple$2[3]; + yday = yday + (1) >> 0; + } + if (hour < 0 && !(((std & 512) === 0))) { + _tuple$3 = absClock(abs); + hour = _tuple$3[0]; + min = _tuple$3[1]; + sec = _tuple$3[2]; + } + switch (0) { default: + _1 = std & 65535; + if (_1 === (276)) { + y = year; + if (y < 0) { + y = -y; + } + b = appendInt(b, (_r$2 = y % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")), 2); + } else if (_1 === (275)) { + b = appendInt(b, year, 4); + } else if (_1 === (258)) { + b = $appendSlice(b, $substring(new Month(month).String(), 0, 3)); + } else if (_1 === (257)) { + m = new Month(month).String(); + b = $appendSlice(b, m); + } else if (_1 === (259)) { + b = appendInt(b, ((month >> 0)), 0); + } else if (_1 === (260)) { + b = appendInt(b, ((month >> 0)), 2); + } else if (_1 === (262)) { + b = $appendSlice(b, $substring(new Weekday(absWeekday(abs)).String(), 0, 3)); + } else if (_1 === (261)) { + s = new Weekday(absWeekday(abs)).String(); + b = $appendSlice(b, s); + } else if (_1 === (263)) { + b = appendInt(b, day, 0); + } else if (_1 === (264)) { + if (day < 10) { + b = $append(b, 32); + } + b = appendInt(b, day, 0); + } else if (_1 === (265)) { + b = appendInt(b, day, 2); + } else if (_1 === (266)) { + if (yday < 100) { + b = $append(b, 32); + if (yday < 10) { + b = $append(b, 32); + } + } + b = appendInt(b, yday, 0); + } else if (_1 === (267)) { + b = appendInt(b, yday, 3); + } else if (_1 === (524)) { + b = appendInt(b, hour, 2); + } else if (_1 === (525)) { + hr = (_r$3 = hour % 12, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); + if (hr === 0) { + hr = 12; + } + b = appendInt(b, hr, 0); + } else if (_1 === (526)) { + hr$1 = (_r$4 = hour % 12, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); + if (hr$1 === 0) { + hr$1 = 12; + } + b = appendInt(b, hr$1, 2); + } else if (_1 === (527)) { + b = appendInt(b, min, 0); + } else if (_1 === (528)) { + b = appendInt(b, min, 2); + } else if (_1 === (529)) { + b = appendInt(b, sec, 0); + } else if (_1 === (530)) { + b = appendInt(b, sec, 2); + } else if (_1 === (533)) { + if (hour >= 12) { + b = $appendSlice(b, "PM"); + } else { + b = $appendSlice(b, "AM"); + } + } else if (_1 === (534)) { + if (hour >= 12) { + b = $appendSlice(b, "pm"); + } else { + b = $appendSlice(b, "am"); + } + } else if ((_1 === (24)) || (_1 === (27)) || (_1 === (25)) || (_1 === (26)) || (_1 === (28)) || (_1 === (29)) || (_1 === (32)) || (_1 === (30)) || (_1 === (31)) || (_1 === (33))) { + if ((offset === 0) && ((std === 24) || (std === 27) || (std === 25) || (std === 26) || (std === 28))) { + b = $append(b, 90); + break; + } + zone$1 = (_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + absoffset = offset; + if (zone$1 < 0) { + b = $append(b, 45); + zone$1 = -zone$1; + absoffset = -absoffset; + } else { + b = $append(b, 43); + } + b = appendInt(b, (_q$1 = zone$1 / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 2); + if ((std === 27) || (std === 32) || (std === 28) || (std === 33)) { + b = $append(b, 58); + } + if (!((std === 31)) && !((std === 26))) { + b = appendInt(b, (_r$5 = zone$1 % 60, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")), 2); + } + if ((std === 25) || (std === 30) || (std === 33) || (std === 28)) { + if ((std === 33) || (std === 28)) { + b = $append(b, 58); + } + b = appendInt(b, (_r$6 = absoffset % 60, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")), 2); + } + } else if (_1 === (23)) { + if (!(name === "")) { + b = $appendSlice(b, name); + break; + } + zone$2 = (_q$2 = offset / 60, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")); + if (zone$2 < 0) { + b = $append(b, 45); + zone$2 = -zone$2; + } else { + b = $append(b, 43); + } + b = appendInt(b, (_q$3 = zone$2 / 60, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")), 2); + b = appendInt(b, (_r$7 = zone$2 % 60, _r$7 === _r$7 ? _r$7 : $throwRuntimeError("integer divide by zero")), 2); + } else if ((_1 === (34)) || (_1 === (35))) { + b = formatNano(b, (($clone(t, Time).Nanosecond() >>> 0)), std); + } + } + } + $s = -1; return b; + /* */ } return; } var $f = {$blk: Time.ptr.prototype.AppendFormat, $c: true, $r, _1, _q, _q$1, _q$2, _q$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, _tuple$3, abs, absoffset, b, day, hour, hr, hr$1, layout, m, min, month, name, offset, prefix, s, sec, std, suffix, t, y, yday, year, zone$1, zone$2, $s};return $f; + }; + Time.prototype.AppendFormat = function(b, layout) { return this.$val.AppendFormat(b, layout); }; + quote = function(s) { + var _i, _ref, _rune, buf, c, i, j, s, width; + buf = $makeSlice(sliceType$3, 1, (s.length + 2 >> 0)); + (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0] = 34); + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + c = _rune[0]; + if (c >= 128 || c < 32) { + width = 0; + if (c === 65533) { + width = 1; + if ((i + 2 >> 0) < s.length && $substring(s, i, (i + 3 >> 0)) === "\xEF\xBF\xBD") { + width = 3; + } + } else { + width = ($encodeRune(c)).length; + } + j = 0; + while (true) { + if (!(j < width)) { break; } + buf = $appendSlice(buf, "\\x"); + buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt((i + j >> 0)) >>> 4 << 24 >>> 24))); + buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt((i + j >> 0)) & 15) >>> 0))); + j = j + (1) >> 0; + } + } else { + if ((c === 34) || (c === 92)) { + buf = $append(buf, 92); + } + buf = $appendSlice(buf, ($encodeRune(c))); + } + _i += _rune[1]; + } + buf = $append(buf, 34); + return ($bytesToString(buf)); + }; + ParseError.ptr.prototype.Error = function() { + var e; + e = this; + if (e.Message === "") { + return "parsing time " + quote(e.Value) + " as " + quote(e.Layout) + ": cannot parse " + quote(e.ValueElem) + " as " + quote(e.LayoutElem); + } + return "parsing time " + quote(e.Value) + e.Message; + }; + ParseError.prototype.Error = function() { return this.$val.Error(); }; + isDigit = function(s, i) { + var c, i, s; + if (s.length <= i) { + return false; + } + c = s.charCodeAt(i); + return 48 <= c && c <= 57; + }; + getnum = function(s, fixed) { + var fixed, s; + if (!isDigit(s, 0)) { + return [0, s, errBad]; + } + if (!isDigit(s, 1)) { + if (fixed) { + return [0, s, errBad]; + } + return [(((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0)), $substring(s, 1), $ifaceNil]; + } + return [($imul((((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0)), 10)) + (((s.charCodeAt(1) - 48 << 24 >>> 24) >> 0)) >> 0, $substring(s, 2), $ifaceNil]; + }; + getnum3 = function(s, fixed) { + var _tmp, _tmp$1, fixed, i, n, s; + _tmp = 0; + _tmp$1 = 0; + n = _tmp; + i = _tmp$1; + i = 0; + while (true) { + if (!(i < 3 && isDigit(s, i))) { break; } + n = ($imul(n, 10)) + (((s.charCodeAt(i) - 48 << 24 >>> 24) >> 0)) >> 0; + i = i + (1) >> 0; + } + if ((i === 0) || fixed && !((i === 3))) { + return [0, s, errBad]; + } + return [n, $substring(s, i), $ifaceNil]; + }; + cutspace = function(s) { + var s; + while (true) { + if (!(s.length > 0 && (s.charCodeAt(0) === 32))) { break; } + s = $substring(s, 1); + } + return s; + }; + skip = function(value, prefix) { + var prefix, value; + while (true) { + if (!(prefix.length > 0)) { break; } + if (prefix.charCodeAt(0) === 32) { + if (value.length > 0 && !((value.charCodeAt(0) === 32))) { + return [value, errBad]; + } + prefix = cutspace(prefix); + value = cutspace(value); + continue; + } + if ((value.length === 0) || !((value.charCodeAt(0) === prefix.charCodeAt(0)))) { + return [value, errBad]; + } + prefix = $substring(prefix, 1); + value = $substring(value, 1); + } + return [value, $ifaceNil]; + }; + Parse = function(layout, value) { + var {$24r, _r$1, layout, value, $s, $r, $c} = $restore(this, {layout, value}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = parse(layout, value, $pkg.UTC, $pkg.Local); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Parse, $c: true, $r, $24r, _r$1, layout, value, $s};return $f; + }; + $pkg.Parse = Parse; + parse = function(layout, value, defaultLocation, local) { + var {$24r, $24r$1, _1, _2, _3, _4, _q, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$17, _tuple$18, _tuple$19, _tuple$2, _tuple$20, _tuple$21, _tuple$22, _tuple$23, _tuple$24, _tuple$25, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, alayout, amSet, avalue, d, day, defaultLocation, err, hold, hour, hour$1, hr, i, i$1, layout, local, m, min, min$1, mm, month, n, n$1, name, ndigit, nsec, offset, offset$1, ok, ok$1, p, pmSet, prefix, rangeErrString, sec, seconds, sign, ss, std, stdstr, suffix, t, t$1, value, x$1, x$2, x$3, yday, year, z, zoneName, zoneOffset, $s, $r, $c} = $restore(this, {layout, value, defaultLocation, local}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _tmp = layout; + _tmp$1 = value; + alayout = _tmp; + avalue = _tmp$1; + rangeErrString = ""; + amSet = false; + pmSet = false; + year = 0; + month = -1; + day = -1; + yday = -1; + hour = 0; + min = 0; + sec = 0; + nsec = 0; + z = ptrType$2.nil; + zoneOffset = -1; + zoneName = ""; + while (true) { + err = $ifaceNil; + _tuple = nextStdChunk(layout); + prefix = _tuple[0]; + std = _tuple[1]; + suffix = _tuple[2]; + stdstr = $substring(layout, prefix.length, (layout.length - suffix.length >> 0)); + _tuple$1 = skip(value, prefix); + value = _tuple$1[0]; + err = _tuple$1[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, prefix, value, "")]; + } + if (std === 0) { + if (!((value.length === 0))) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": extra text: " + quote(value))]; + } + break; + } + layout = suffix; + p = ""; + switch (0) { default: + _1 = std & 65535; + if (_1 === (276)) { + if (value.length < 2) { + err = errBad; + break; + } + hold = value; + _tmp$2 = $substring(value, 0, 2); + _tmp$3 = $substring(value, 2); + p = _tmp$2; + value = _tmp$3; + _tuple$2 = atoi(p); + year = _tuple$2[0]; + err = _tuple$2[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + value = hold; + } else if (year >= 69) { + year = year + (1900) >> 0; + } else { + year = year + (2000) >> 0; + } + } else if (_1 === (275)) { + if (value.length < 4 || !isDigit(value, 0)) { + err = errBad; + break; + } + _tmp$4 = $substring(value, 0, 4); + _tmp$5 = $substring(value, 4); + p = _tmp$4; + value = _tmp$5; + _tuple$3 = atoi(p); + year = _tuple$3[0]; + err = _tuple$3[1]; + } else if (_1 === (258)) { + _tuple$4 = lookup(shortMonthNames, value); + month = _tuple$4[0]; + value = _tuple$4[1]; + err = _tuple$4[2]; + month = month + (1) >> 0; + } else if (_1 === (257)) { + _tuple$5 = lookup(longMonthNames, value); + month = _tuple$5[0]; + value = _tuple$5[1]; + err = _tuple$5[2]; + month = month + (1) >> 0; + } else if ((_1 === (259)) || (_1 === (260))) { + _tuple$6 = getnum(value, std === 260); + month = _tuple$6[0]; + value = _tuple$6[1]; + err = _tuple$6[2]; + if ($interfaceIsEqual(err, $ifaceNil) && (month <= 0 || 12 < month)) { + rangeErrString = "month"; + } + } else if (_1 === (262)) { + _tuple$7 = lookup(shortDayNames, value); + value = _tuple$7[1]; + err = _tuple$7[2]; + } else if (_1 === (261)) { + _tuple$8 = lookup(longDayNames, value); + value = _tuple$8[1]; + err = _tuple$8[2]; + } else if ((_1 === (263)) || (_1 === (264)) || (_1 === (265))) { + if ((std === 264) && value.length > 0 && (value.charCodeAt(0) === 32)) { + value = $substring(value, 1); + } + _tuple$9 = getnum(value, std === 265); + day = _tuple$9[0]; + value = _tuple$9[1]; + err = _tuple$9[2]; + } else if ((_1 === (266)) || (_1 === (267))) { + i = 0; + while (true) { + if (!(i < 2)) { break; } + if ((std === 266) && value.length > 0 && (value.charCodeAt(0) === 32)) { + value = $substring(value, 1); + } + i = i + (1) >> 0; + } + _tuple$10 = getnum3(value, std === 267); + yday = _tuple$10[0]; + value = _tuple$10[1]; + err = _tuple$10[2]; + } else if (_1 === (524)) { + _tuple$11 = getnum(value, false); + hour = _tuple$11[0]; + value = _tuple$11[1]; + err = _tuple$11[2]; + if (hour < 0 || 24 <= hour) { + rangeErrString = "hour"; + } + } else if ((_1 === (525)) || (_1 === (526))) { + _tuple$12 = getnum(value, std === 526); + hour = _tuple$12[0]; + value = _tuple$12[1]; + err = _tuple$12[2]; + if (hour < 0 || 12 < hour) { + rangeErrString = "hour"; + } + } else if ((_1 === (527)) || (_1 === (528))) { + _tuple$13 = getnum(value, std === 528); + min = _tuple$13[0]; + value = _tuple$13[1]; + err = _tuple$13[2]; + if (min < 0 || 60 <= min) { + rangeErrString = "minute"; + } + } else if ((_1 === (529)) || (_1 === (530))) { + _tuple$14 = getnum(value, std === 530); + sec = _tuple$14[0]; + value = _tuple$14[1]; + err = _tuple$14[2]; + if (sec < 0 || 60 <= sec) { + rangeErrString = "second"; + break; + } + if (value.length >= 2 && commaOrPeriod(value.charCodeAt(0)) && isDigit(value, 1)) { + _tuple$15 = nextStdChunk(layout); + std = _tuple$15[1]; + std = std & (65535); + if ((std === 34) || (std === 35)) { + break; + } + n = 2; + while (true) { + if (!(n < value.length && isDigit(value, n))) { break; } + n = n + (1) >> 0; + } + _tuple$16 = parseNanoseconds(value, n); + nsec = _tuple$16[0]; + rangeErrString = _tuple$16[1]; + err = _tuple$16[2]; + value = $substring(value, n); + } + } else if (_1 === (533)) { + if (value.length < 2) { + err = errBad; + break; + } + _tmp$6 = $substring(value, 0, 2); + _tmp$7 = $substring(value, 2); + p = _tmp$6; + value = _tmp$7; + _2 = p; + if (_2 === ("PM")) { + pmSet = true; + } else if (_2 === ("AM")) { + amSet = true; + } else { + err = errBad; + } + } else if (_1 === (534)) { + if (value.length < 2) { + err = errBad; + break; + } + _tmp$8 = $substring(value, 0, 2); + _tmp$9 = $substring(value, 2); + p = _tmp$8; + value = _tmp$9; + _3 = p; + if (_3 === ("pm")) { + pmSet = true; + } else if (_3 === ("am")) { + amSet = true; + } else { + err = errBad; + } + } else if ((_1 === (24)) || (_1 === (27)) || (_1 === (25)) || (_1 === (26)) || (_1 === (28)) || (_1 === (29)) || (_1 === (31)) || (_1 === (32)) || (_1 === (30)) || (_1 === (33))) { + if (((std === 24) || (std === 26) || (std === 27)) && value.length >= 1 && (value.charCodeAt(0) === 90)) { + value = $substring(value, 1); + z = $pkg.UTC; + break; + } + _tmp$10 = ""; + _tmp$11 = ""; + _tmp$12 = ""; + _tmp$13 = ""; + sign = _tmp$10; + hour$1 = _tmp$11; + min$1 = _tmp$12; + seconds = _tmp$13; + if ((std === 27) || (std === 32)) { + if (value.length < 6) { + err = errBad; + break; + } + if (!((value.charCodeAt(3) === 58))) { + err = errBad; + break; + } + _tmp$14 = $substring(value, 0, 1); + _tmp$15 = $substring(value, 1, 3); + _tmp$16 = $substring(value, 4, 6); + _tmp$17 = "00"; + _tmp$18 = $substring(value, 6); + sign = _tmp$14; + hour$1 = _tmp$15; + min$1 = _tmp$16; + seconds = _tmp$17; + value = _tmp$18; + } else if ((std === 31) || (std === 26)) { + if (value.length < 3) { + err = errBad; + break; + } + _tmp$19 = $substring(value, 0, 1); + _tmp$20 = $substring(value, 1, 3); + _tmp$21 = "00"; + _tmp$22 = "00"; + _tmp$23 = $substring(value, 3); + sign = _tmp$19; + hour$1 = _tmp$20; + min$1 = _tmp$21; + seconds = _tmp$22; + value = _tmp$23; + } else if ((std === 28) || (std === 33)) { + if (value.length < 9) { + err = errBad; + break; + } + if (!((value.charCodeAt(3) === 58)) || !((value.charCodeAt(6) === 58))) { + err = errBad; + break; + } + _tmp$24 = $substring(value, 0, 1); + _tmp$25 = $substring(value, 1, 3); + _tmp$26 = $substring(value, 4, 6); + _tmp$27 = $substring(value, 7, 9); + _tmp$28 = $substring(value, 9); + sign = _tmp$24; + hour$1 = _tmp$25; + min$1 = _tmp$26; + seconds = _tmp$27; + value = _tmp$28; + } else if ((std === 25) || (std === 30)) { + if (value.length < 7) { + err = errBad; + break; + } + _tmp$29 = $substring(value, 0, 1); + _tmp$30 = $substring(value, 1, 3); + _tmp$31 = $substring(value, 3, 5); + _tmp$32 = $substring(value, 5, 7); + _tmp$33 = $substring(value, 7); + sign = _tmp$29; + hour$1 = _tmp$30; + min$1 = _tmp$31; + seconds = _tmp$32; + value = _tmp$33; + } else { + if (value.length < 5) { + err = errBad; + break; + } + _tmp$34 = $substring(value, 0, 1); + _tmp$35 = $substring(value, 1, 3); + _tmp$36 = $substring(value, 3, 5); + _tmp$37 = "00"; + _tmp$38 = $substring(value, 5); + sign = _tmp$34; + hour$1 = _tmp$35; + min$1 = _tmp$36; + seconds = _tmp$37; + value = _tmp$38; + } + _tmp$39 = 0; + _tmp$40 = 0; + _tmp$41 = 0; + hr = _tmp$39; + mm = _tmp$40; + ss = _tmp$41; + _tuple$17 = atoi(hour$1); + hr = _tuple$17[0]; + err = _tuple$17[1]; + if ($interfaceIsEqual(err, $ifaceNil)) { + _tuple$18 = atoi(min$1); + mm = _tuple$18[0]; + err = _tuple$18[1]; + } + if ($interfaceIsEqual(err, $ifaceNil)) { + _tuple$19 = atoi(seconds); + ss = _tuple$19[0]; + err = _tuple$19[1]; + } + zoneOffset = ($imul(((($imul(hr, 60)) + mm >> 0)), 60)) + ss >> 0; + _4 = sign.charCodeAt(0); + if (_4 === (43)) { + } else if (_4 === (45)) { + zoneOffset = -zoneOffset; + } else { + err = errBad; + } + } else if (_1 === (23)) { + if (value.length >= 3 && $substring(value, 0, 3) === "UTC") { + z = $pkg.UTC; + value = $substring(value, 3); + break; + } + _tuple$20 = parseTimeZone(value); + n$1 = _tuple$20[0]; + ok = _tuple$20[1]; + if (!ok) { + err = errBad; + break; + } + _tmp$42 = $substring(value, 0, n$1); + _tmp$43 = $substring(value, n$1); + zoneName = _tmp$42; + value = _tmp$43; + } else if (_1 === (34)) { + ndigit = 1 + digitsLen(std) >> 0; + if (value.length < ndigit) { + err = errBad; + break; + } + _tuple$21 = parseNanoseconds(value, ndigit); + nsec = _tuple$21[0]; + rangeErrString = _tuple$21[1]; + err = _tuple$21[2]; + value = $substring(value, ndigit); + } else if (_1 === (35)) { + if (value.length < 2 || !commaOrPeriod(value.charCodeAt(0)) || value.charCodeAt(1) < 48 || 57 < value.charCodeAt(1)) { + break; + } + i$1 = 0; + while (true) { + if (!(i$1 < 9 && (i$1 + 1 >> 0) < value.length && 48 <= value.charCodeAt((i$1 + 1 >> 0)) && value.charCodeAt((i$1 + 1 >> 0)) <= 57)) { break; } + i$1 = i$1 + (1) >> 0; + } + _tuple$22 = parseNanoseconds(value, 1 + i$1 >> 0); + nsec = _tuple$22[0]; + rangeErrString = _tuple$22[1]; + err = _tuple$22[2]; + value = $substring(value, (1 + i$1 >> 0)); + } + } + if (!(rangeErrString === "")) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, ": " + rangeErrString + " out of range")]; + } + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, "")]; + } + } + if (pmSet && hour < 12) { + hour = hour + (12) >> 0; + } else if (amSet && (hour === 12)) { + hour = 0; + } + if (yday >= 0) { + d = 0; + m = 0; + if (isLeap(year)) { + if (yday === 60) { + m = 2; + d = 29; + } else if (yday > 60) { + yday = yday - (1) >> 0; + } + } + if (yday < 1 || yday > 365) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day-of-year out of range")]; + } + if (m === 0) { + m = (_q = ((yday - 1 >> 0)) / 31, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; + if (((((m < 0 || m >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[m]) >> 0)) < yday) { + m = m + (1) >> 0; + } + d = yday - (((x$1 = m - 1 >> 0, ((x$1 < 0 || x$1 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$1])) >> 0)) >> 0; + } + if (month >= 0 && !((month === m))) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day-of-year does not match month")]; + } + month = m; + if (day >= 0 && !((day === d))) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day-of-year does not match day")]; + } + day = d; + } else { + if (month < 0) { + month = 1; + } + if (day < 0) { + day = 1; + } + } + if (day < 1 || day > daysIn(((month >> 0)), year)) { + $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day out of range")]; + } + /* */ if (!(z === ptrType$2.nil)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(z === ptrType$2.nil)) { */ case 1: + _r$1 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, z); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = [_r$1, $ifaceNil]; + $s = 4; case 4: return $24r; + /* } */ case 2: + /* */ if (!((zoneOffset === -1))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!((zoneOffset === -1))) { */ case 5: + _r$2 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + t = $clone(_r$2, Time); + t.addSec((x$2 = (new $Int64(0, zoneOffset)), new $Int64(-x$2.$high, -x$2.$low))); + _r$3 = local.lookup(t.unixSec()); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple$23 = _r$3; + name = _tuple$23[0]; + offset = _tuple$23[1]; + if ((offset === zoneOffset) && (zoneName === "" || name === zoneName)) { + t.setLoc(local); + $s = -1; return [t, $ifaceNil]; + } + t.setLoc(FixedZone(zoneName, zoneOffset)); + $s = -1; return [t, $ifaceNil]; + /* } */ case 6: + /* */ if (!(zoneName === "")) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (!(zoneName === "")) { */ case 9: + _r$4 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + t$1 = $clone(_r$4, Time); + _r$5 = local.lookupName(zoneName, t$1.unixSec()); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _tuple$24 = _r$5; + offset$1 = _tuple$24[0]; + ok$1 = _tuple$24[1]; + if (ok$1) { + t$1.addSec((x$3 = (new $Int64(0, offset$1)), new $Int64(-x$3.$high, -x$3.$low))); + t$1.setLoc(local); + $s = -1; return [t$1, $ifaceNil]; + } + if (zoneName.length > 3 && $substring(zoneName, 0, 3) === "GMT") { + _tuple$25 = atoi($substring(zoneName, 3)); + offset$1 = _tuple$25[0]; + offset$1 = $imul(offset$1, (3600)); + } + t$1.setLoc(FixedZone(zoneName, offset$1)); + $s = -1; return [t$1, $ifaceNil]; + /* } */ case 10: + _r$6 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, defaultLocation); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + $24r$1 = [_r$6, $ifaceNil]; + $s = 14; case 14: return $24r$1; + /* */ } return; } var $f = {$blk: parse, $c: true, $r, $24r, $24r$1, _1, _2, _3, _4, _q, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$17, _tuple$18, _tuple$19, _tuple$2, _tuple$20, _tuple$21, _tuple$22, _tuple$23, _tuple$24, _tuple$25, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, alayout, amSet, avalue, d, day, defaultLocation, err, hold, hour, hour$1, hr, i, i$1, layout, local, m, min, min$1, mm, month, n, n$1, name, ndigit, nsec, offset, offset$1, ok, ok$1, p, pmSet, prefix, rangeErrString, sec, seconds, sign, ss, std, stdstr, suffix, t, t$1, value, x$1, x$2, x$3, yday, year, z, zoneName, zoneOffset, $s};return $f; + }; + parseTimeZone = function(value) { + var _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c, length, nUpper, ok, ok$1, value; + length = 0; + ok = false; + if (value.length < 3) { + _tmp = 0; + _tmp$1 = false; + length = _tmp; + ok = _tmp$1; + return [length, ok]; + } + if (value.length >= 4 && ($substring(value, 0, 4) === "ChST" || $substring(value, 0, 4) === "MeST")) { + _tmp$2 = 4; + _tmp$3 = true; + length = _tmp$2; + ok = _tmp$3; + return [length, ok]; + } + if ($substring(value, 0, 3) === "GMT") { + length = parseGMT(value); + _tmp$4 = length; + _tmp$5 = true; + length = _tmp$4; + ok = _tmp$5; + return [length, ok]; + } + if ((value.charCodeAt(0) === 43) || (value.charCodeAt(0) === 45)) { + length = parseSignedOffset(value); + ok$1 = length > 0; + _tmp$6 = length; + _tmp$7 = ok$1; + length = _tmp$6; + ok = _tmp$7; + return [length, ok]; + } + nUpper = 0; + nUpper = 0; + while (true) { + if (!(nUpper < 6)) { break; } + if (nUpper >= value.length) { + break; + } + c = value.charCodeAt(nUpper); + if (c < 65 || 90 < c) { + break; + } + nUpper = nUpper + (1) >> 0; + } + _1 = nUpper; + if ((_1 === (0)) || (_1 === (1)) || (_1 === (2)) || (_1 === (6))) { + _tmp$8 = 0; + _tmp$9 = false; + length = _tmp$8; + ok = _tmp$9; + return [length, ok]; + } else if (_1 === (5)) { + if (value.charCodeAt(4) === 84) { + _tmp$10 = 5; + _tmp$11 = true; + length = _tmp$10; + ok = _tmp$11; + return [length, ok]; + } + } else if (_1 === (4)) { + if ((value.charCodeAt(3) === 84) || $substring(value, 0, 4) === "WITA") { + _tmp$12 = 4; + _tmp$13 = true; + length = _tmp$12; + ok = _tmp$13; + return [length, ok]; + } + } else if (_1 === (3)) { + _tmp$14 = 3; + _tmp$15 = true; + length = _tmp$14; + ok = _tmp$15; + return [length, ok]; + } + _tmp$16 = 0; + _tmp$17 = false; + length = _tmp$16; + ok = _tmp$17; + return [length, ok]; + }; + parseGMT = function(value) { + var value; + value = $substring(value, 3); + if (value.length === 0) { + return 3; + } + return 3 + parseSignedOffset(value) >> 0; + }; + parseSignedOffset = function(value) { + var _tuple, err, rem, sign, value, x$1; + sign = value.charCodeAt(0); + if (!((sign === 45)) && !((sign === 43))) { return 0; } - if (l.tx.$length > 0 && (x = l.zone, x$1 = (x$2 = l.tx, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0])).index, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])).isDST) { - zi = (((x$3 = l.tx, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).index >> 0)) - 1 >> 0; - while (true) { - if (!(zi >= 0)) { break; } - if (!(x$4 = l.zone, ((zi < 0 || zi >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + zi])).isDST) { - return zi; - } - zi = zi - (1) >> 0; - } + _tuple = leadingInt($substring(value, 1)); + x$1 = _tuple[0]; + rem = _tuple[1]; + err = _tuple[2]; + if (!($interfaceIsEqual(err, $ifaceNil)) || $substring(value, 1) === rem) { + return 0; } - _ref = l.zone; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - zi$1 = _i; - if (!(x$5 = l.zone, ((zi$1 < 0 || zi$1 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + zi$1])).isDST) { - return zi$1; - } - _i++; + if ((x$1.$high > 0 || (x$1.$high === 0 && x$1.$low > 23))) { + return 0; } - return 0; + return value.length - rem.length >> 0; }; - Location.prototype.lookupFirstZone = function() { return this.$val.lookupFirstZone(); }; - Location.ptr.prototype.firstZoneUsed = function() { - var _i, _ref, l, tx; - l = this; - _ref = l.tx; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - tx = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), zoneTrans); - if (tx.index === 0) { - return true; - } - _i++; - } - return false; + commaOrPeriod = function(b) { + var b; + return (b === 46) || (b === 44); }; - Location.prototype.firstZoneUsed = function() { return this.$val.firstZoneUsed(); }; - Location.ptr.prototype.lookupName = function(name, unix) { - var _i, _i$1, _r, _r$1, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, i, i$1, l, nam, name, offset, offset$1, ok, unix, x, x$1, x$2, zone$1, zone$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; i = $f.i; i$1 = $f.i$1; l = $f.l; nam = $f.nam; name = $f.name; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; unix = $f.unix; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - offset = 0; - ok = false; - l = this; - _r = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - l = _r; - _ref = l.zone; - _i = 0; - /* while (true) { */ case 2: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } - i = _i; - zone$1 = (x = l.zone, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - /* */ if (zone$1.name === name) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (zone$1.name === name) { */ case 4: - _r$1 = l.lookup((x$1 = (new $Int64(0, zone$1.offset)), new $Int64(unix.$high - x$1.$high, unix.$low - x$1.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; - nam = _tuple[0]; - offset$1 = _tuple[1]; - if (nam === zone$1.name) { - _tmp = offset$1; - _tmp$1 = true; - offset = _tmp; - ok = _tmp$1; - $s = -1; return [offset, ok]; - } - /* } */ case 5: - _i++; - /* } */ $s = 2; continue; case 3: - _ref$1 = l.zone; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - zone$2 = (x$2 = l.zone, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); - if (zone$2.name === name) { - _tmp$2 = zone$2.offset; - _tmp$3 = true; - offset = _tmp$2; - ok = _tmp$3; - $s = -1; return [offset, ok]; - } - _i$1++; + parseNanoseconds = function(value, nbytes) { + var _tuple, err, i, nbytes, ns, rangeErrString, scaleDigits, value; + ns = 0; + rangeErrString = ""; + err = $ifaceNil; + if (!commaOrPeriod(value.charCodeAt(0))) { + err = errBad; + return [ns, rangeErrString, err]; } - $s = -1; return [offset, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookupName }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.i = i; $f.i$1 = i$1; $f.l = l; $f.nam = nam; $f.name = name; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.unix = unix; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; + if (nbytes > 10) { + value = $substring(value, 0, 10); + nbytes = 10; + } + _tuple = atoi($substring(value, 1, nbytes)); + ns = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [ns, rangeErrString, err]; + } + if (ns < 0) { + rangeErrString = "fractional second"; + return [ns, rangeErrString, err]; + } + scaleDigits = 10 - nbytes >> 0; + i = 0; + while (true) { + if (!(i < scaleDigits)) { break; } + ns = $imul(ns, (10)); + i = i + (1) >> 0; + } + return [ns, rangeErrString, err]; }; - Location.prototype.lookupName = function(name, unix) { return this.$val.lookupName(name, unix); }; - ptrType$4.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$5.methods = [{prop: "Stop", name: "Stop", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([Duration], [$Bool], false)}]; - Time.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "AppendFormat", name: "AppendFormat", pkg: "", typ: $funcType([sliceType$3, $String], [sliceType$3], false)}, {prop: "After", name: "After", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Before", name: "Before", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "abs", name: "abs", pkg: "time", typ: $funcType([], [$Uint64], false)}, {prop: "locabs", name: "locabs", pkg: "time", typ: $funcType([], [$String, $Int, $Uint64], false)}, {prop: "Date", name: "Date", pkg: "", typ: $funcType([], [$Int, Month, $Int], false)}, {prop: "Year", name: "Year", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Month", name: "Month", pkg: "", typ: $funcType([], [Month], false)}, {prop: "Day", name: "Day", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Weekday", name: "Weekday", pkg: "", typ: $funcType([], [Weekday], false)}, {prop: "ISOWeek", name: "ISOWeek", pkg: "", typ: $funcType([], [$Int, $Int], false)}, {prop: "Clock", name: "Clock", pkg: "", typ: $funcType([], [$Int, $Int, $Int], false)}, {prop: "Hour", name: "Hour", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Minute", name: "Minute", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Second", name: "Second", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Nanosecond", name: "Nanosecond", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "YearDay", name: "YearDay", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([Time], [Duration], false)}, {prop: "AddDate", name: "AddDate", pkg: "", typ: $funcType([$Int, $Int, $Int], [Time], false)}, {prop: "date", name: "date", pkg: "time", typ: $funcType([$Bool], [$Int, Month, $Int, $Int], false)}, {prop: "UTC", name: "UTC", pkg: "", typ: $funcType([], [Time], false)}, {prop: "Local", name: "Local", pkg: "", typ: $funcType([], [Time], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([ptrType$2], [Time], false)}, {prop: "Location", name: "Location", pkg: "", typ: $funcType([], [ptrType$2], false)}, {prop: "Zone", name: "Zone", pkg: "", typ: $funcType([], [$String, $Int], false)}, {prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixNano", name: "UnixNano", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Time], false)}]; - ptrType$7.methods = [{prop: "nsec", name: "nsec", pkg: "time", typ: $funcType([], [$Int32], false)}, {prop: "sec", name: "sec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "unixSec", name: "unixSec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "addSec", name: "addSec", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "setLoc", name: "setLoc", pkg: "time", typ: $funcType([ptrType$2], [], false)}, {prop: "stripMono", name: "stripMono", pkg: "time", typ: $funcType([], [], false)}, {prop: "setMono", name: "setMono", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "mono", name: "mono", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType$3], [$error], false)}]; + leadingInt = function(s) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, c, err, i, rem, s, x$1, x$2, x$3, x$4; + x$1 = new $Uint64(0, 0); + rem = ""; + err = $ifaceNil; + i = 0; + while (true) { + if (!(i < s.length)) { break; } + c = s.charCodeAt(i); + if (c < 48 || c > 57) { + break; + } + if ((x$1.$high > 214748364 || (x$1.$high === 214748364 && x$1.$low > 3435973836))) { + _tmp = new $Uint64(0, 0); + _tmp$1 = ""; + _tmp$2 = errLeadingInt; + x$1 = _tmp; + rem = _tmp$1; + err = _tmp$2; + return [x$1, rem, err]; + } + x$1 = (x$2 = (x$3 = $mul64(x$1, new $Uint64(0, 10)), x$4 = (new $Uint64(0, c)), new $Uint64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)), new $Uint64(x$2.$high - 0, x$2.$low - 48)); + if ((x$1.$high > 2147483648 || (x$1.$high === 2147483648 && x$1.$low > 0))) { + _tmp$3 = new $Uint64(0, 0); + _tmp$4 = ""; + _tmp$5 = errLeadingInt; + x$1 = _tmp$3; + rem = _tmp$4; + err = _tmp$5; + return [x$1, rem, err]; + } + i = i + (1) >> 0; + } + _tmp$6 = x$1; + _tmp$7 = $substring(s, i); + _tmp$8 = $ifaceNil; + x$1 = _tmp$6; + rem = _tmp$7; + err = _tmp$8; + return [x$1, rem, err]; + }; + ptrType$2.methods = [{prop: "get", name: "get", pkg: "time", typ: $funcType([], [ptrType$2], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "lookup", name: "lookup", pkg: "time", typ: $funcType([$Int64], [$String, $Int, $Int64, $Int64, $Bool], false)}, {prop: "lookupFirstZone", name: "lookupFirstZone", pkg: "time", typ: $funcType([], [$Int], false)}, {prop: "firstZoneUsed", name: "firstZoneUsed", pkg: "time", typ: $funcType([], [$Bool], false)}, {prop: "lookupName", name: "lookupName", pkg: "time", typ: $funcType([$String, $Int64], [$Int, $Bool], false)}]; + Time.methods = [{prop: "After", name: "After", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Before", name: "Before", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "abs", name: "abs", pkg: "time", typ: $funcType([], [$Uint64], false)}, {prop: "locabs", name: "locabs", pkg: "time", typ: $funcType([], [$String, $Int, $Uint64], false)}, {prop: "Date", name: "Date", pkg: "", typ: $funcType([], [$Int, Month, $Int], false)}, {prop: "Year", name: "Year", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Month", name: "Month", pkg: "", typ: $funcType([], [Month], false)}, {prop: "Day", name: "Day", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Weekday", name: "Weekday", pkg: "", typ: $funcType([], [Weekday], false)}, {prop: "ISOWeek", name: "ISOWeek", pkg: "", typ: $funcType([], [$Int, $Int], false)}, {prop: "Clock", name: "Clock", pkg: "", typ: $funcType([], [$Int, $Int, $Int], false)}, {prop: "Hour", name: "Hour", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Minute", name: "Minute", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Second", name: "Second", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Nanosecond", name: "Nanosecond", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "YearDay", name: "YearDay", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([Time], [Duration], false)}, {prop: "AddDate", name: "AddDate", pkg: "", typ: $funcType([$Int, $Int, $Int], [Time], false)}, {prop: "date", name: "date", pkg: "time", typ: $funcType([$Bool], [$Int, Month, $Int, $Int], false)}, {prop: "UTC", name: "UTC", pkg: "", typ: $funcType([], [Time], false)}, {prop: "Local", name: "Local", pkg: "", typ: $funcType([], [Time], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([ptrType$2], [Time], false)}, {prop: "Location", name: "Location", pkg: "", typ: $funcType([], [ptrType$2], false)}, {prop: "Zone", name: "Zone", pkg: "", typ: $funcType([], [$String, $Int], false)}, {prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixMilli", name: "UnixMilli", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixMicro", name: "UnixMicro", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixNano", name: "UnixNano", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "IsDST", name: "IsDST", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "AppendFormat", name: "AppendFormat", pkg: "", typ: $funcType([sliceType$3, $String], [sliceType$3], false)}]; + ptrType$4.methods = [{prop: "nsec", name: "nsec", pkg: "time", typ: $funcType([], [$Int32], false)}, {prop: "sec", name: "sec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "unixSec", name: "unixSec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "addSec", name: "addSec", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "setLoc", name: "setLoc", pkg: "time", typ: $funcType([ptrType$2], [], false)}, {prop: "stripMono", name: "stripMono", pkg: "time", typ: $funcType([], [], false)}, {prop: "setMono", name: "setMono", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "mono", name: "mono", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType$3], [$error], false)}]; Month.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; Weekday.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - Duration.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Nanoseconds", name: "Nanoseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seconds", name: "Seconds", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Minutes", name: "Minutes", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Hours", name: "Hours", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Duration], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Duration], false)}]; - ptrType$2.methods = [{prop: "get", name: "get", pkg: "time", typ: $funcType([], [ptrType$2], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "lookup", name: "lookup", pkg: "time", typ: $funcType([$Int64], [$String, $Int, $Int64, $Int64], false)}, {prop: "lookupFirstZone", name: "lookupFirstZone", pkg: "time", typ: $funcType([], [$Int], false)}, {prop: "firstZoneUsed", name: "firstZoneUsed", pkg: "time", typ: $funcType([], [$Bool], false)}, {prop: "lookupName", name: "lookupName", pkg: "time", typ: $funcType([$String, $Int64], [$Int, $Bool], false)}]; - runtimeTimer.init("time", [{prop: "i", name: "i", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "when", name: "when", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "period", name: "period", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "f", name: "f", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "timeout", name: "timeout", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "active", name: "active", embedded: false, exported: false, typ: $Bool, tag: ""}]); - ParseError.init("", [{prop: "Layout", name: "Layout", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "LayoutElem", name: "LayoutElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ValueElem", name: "ValueElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Message", name: "Message", embedded: false, exported: true, typ: $String, tag: ""}]); - Timer.init("time", [{prop: "C", name: "C", embedded: false, exported: true, typ: chanType$1, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: runtimeTimer, tag: ""}]); - Time.init("time", [{prop: "wall", name: "wall", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "ext", name: "ext", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "loc", name: "loc", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); - Location.init("time", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "zone", name: "zone", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "tx", name: "tx", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "cacheStart", name: "cacheStart", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheEnd", name: "cacheEnd", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheZone", name: "cacheZone", embedded: false, exported: false, typ: ptrType, tag: ""}]); + Duration.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Nanoseconds", name: "Nanoseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Microseconds", name: "Microseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Milliseconds", name: "Milliseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seconds", name: "Seconds", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Minutes", name: "Minutes", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Hours", name: "Hours", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Duration], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Duration], false)}]; + ptrType$6.methods = [{prop: "Stop", name: "Stop", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([Duration], [$Bool], false)}]; + ptrType$8.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + Location.init("time", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "zone", name: "zone", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "tx", name: "tx", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "extend", name: "extend", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "cacheStart", name: "cacheStart", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheEnd", name: "cacheEnd", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheZone", name: "cacheZone", embedded: false, exported: false, typ: ptrType, tag: ""}]); zone.init("time", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "isDST", name: "isDST", embedded: false, exported: false, typ: $Bool, tag: ""}]); zoneTrans.init("time", [{prop: "when", name: "when", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "isstd", name: "isstd", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "isutc", name: "isutc", embedded: false, exported: false, typ: $Bool, tag: ""}]); + rule.init("time", [{prop: "kind", name: "kind", embedded: false, exported: false, typ: ruleKind, tag: ""}, {prop: "day", name: "day", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "week", name: "week", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "mon", name: "mon", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "time", name: "time", embedded: false, exported: false, typ: $Int, tag: ""}]); + Time.init("time", [{prop: "wall", name: "wall", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "ext", name: "ext", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "loc", name: "loc", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); + Timer.init("time", [{prop: "C", name: "C", embedded: false, exported: true, typ: chanType$1, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: runtimeTimer, tag: ""}]); + runtimeTimer.init("time", [{prop: "i", name: "i", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "when", name: "when", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "period", name: "period", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "f", name: "f", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "seq", name: "seq", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "timeout", name: "timeout", embedded: false, exported: false, typ: ptrType$7, tag: ""}, {prop: "active", name: "active", embedded: false, exported: false, typ: $Bool, tag: ""}]); + ParseError.init("", [{prop: "Layout", name: "Layout", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "LayoutElem", name: "LayoutElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ValueElem", name: "ValueElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Message", name: "Message", embedded: false, exported: true, typ: $String, tag: ""}]); + $pkg.$initLinknames = function() { + runtimeNano = $linknames["runtime.nanotime"]; +}; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js$1.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = nosync.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - localLoc = new Location.ptr("", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); + $r = js.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + localLoc = new Location.ptr("", sliceType.nil, sliceType$1.nil, "", new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); localOnce = new nosync.Once.ptr(false, false); + badData = errors.New("malformed time zone information"); + $unused(new sliceType$2(["/usr/share/zoneinfo/", "/usr/share/lib/zoneinfo/", "/usr/lib/locale/TZ/", runtime.GOROOT() + "/lib/time/zoneinfo.zip"])); + utcLoc = new Location.ptr("UTC", sliceType.nil, sliceType$1.nil, "", new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); + $pkg.UTC = utcLoc; + $pkg.Local = localLoc; + errLocation = errors.New("time: invalid location name"); + daysBefore = $toNativeArray($kindInt32, [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]); + _r = runtimeNano(); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + startNano = (x = _r, new $Int64(x.$high - 0, x.$low - 1)); zoneSources = new sliceType$2([runtime.GOROOT() + "/lib/time/zoneinfo.zip"]); - std0x = $toNativeArray($kindInt, [260, 265, 524, 526, 528, 274]); + std0x = $toNativeArray($kindInt, [260, 265, 526, 528, 530, 276]); longDayNames = new sliceType$2(["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); shortDayNames = new sliceType$2(["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]); shortMonthNames = new sliceType$2(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]); @@ -7939,2685 +11181,865 @@ $packages["time"] = (function() { atoiError = errors.New("time: invalid number"); errBad = errors.New("bad value for field"); errLeadingInt = errors.New("time: bad [0-9]*"); - months = $toNativeArray($kindString, ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]); - days = $toNativeArray($kindString, ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); - daysBefore = $toNativeArray($kindInt32, [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]); - utcLoc = new Location.ptr("UTC", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); - $pkg.UTC = utcLoc; - $pkg.Local = localLoc; - errLocation = errors.New("time: invalid location name"); - badData = errors.New("malformed time zone information"); - $unused(new sliceType$2(["/usr/share/zoneinfo/", "/usr/share/lib/zoneinfo/", "/usr/lib/locale/TZ/", runtime.GOROOT() + "/lib/time/zoneinfo.zip"])); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); -$packages["internal/poll"] = (function() { - var $pkg = {}, $init, errors, io, runtime, atomic, syscall, time, pollDesc, TimeoutError, fdMutex, FD, ptrType, chanType, sliceType, ptrType$1, ptrType$2, arrayType, sliceType$2, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, sliceType$3, ptrType$12, funcType, funcType$1, ptrType$13, ptrType$14, ptrType$15, ptrType$16, sliceType$4, ptrType$17, semWaiters, tryDupCloexec, tryDupCloexec$24ptr, runtime_Semacquire, runtime_Semrelease, errClosing, consume, DupCloseOnExec, dupCloseOnExecOld, accept; +$packages["context"] = (function() { + var $pkg = {}, $init, errors, reflectlite, sync, atomic, time, Context, deadlineExceededError, emptyCtx, CancelFunc, canceler, cancelCtx, stringer, timerCtx, valueCtx, ptrType, structType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, chanType, ptrType$5, ptrType$6, ptrType$7, chanType$1, mapType, background, todo, goroutines, goroutines$24ptr, cancelCtxKey, cancelCtxKey$24ptr, closedchan, x, Background, WithCancel, newCancelCtx, propagateCancel, parentCancelCtx, removeChild, init, contextName, WithDeadline, WithTimeout, stringify, value; errors = $packages["errors"]; - io = $packages["io"]; - runtime = $packages["runtime"]; - atomic = $packages["sync/atomic"]; - syscall = $packages["syscall"]; - time = $packages["time"]; - pollDesc = $pkg.pollDesc = $newType(0, $kindStruct, "poll.pollDesc", true, "internal/poll", false, function(closing_) { - this.$val = this; - if (arguments.length === 0) { - this.closing = false; - return; - } - this.closing = closing_; - }); - TimeoutError = $pkg.TimeoutError = $newType(0, $kindStruct, "poll.TimeoutError", true, "internal/poll", true, function() { - this.$val = this; - if (arguments.length === 0) { - return; - } - }); - fdMutex = $pkg.fdMutex = $newType(0, $kindStruct, "poll.fdMutex", true, "internal/poll", false, function(state_, rsema_, wsema_) { - this.$val = this; - if (arguments.length === 0) { - this.state = new $Uint64(0, 0); - this.rsema = 0; - this.wsema = 0; - return; - } - this.state = state_; - this.rsema = rsema_; - this.wsema = wsema_; - }); - FD = $pkg.FD = $newType(0, $kindStruct, "poll.FD", true, "internal/poll", true, function(fdmu_, Sysfd_, pd_, iovecs_, csema_, isBlocking_, IsStream_, ZeroReadIsEOF_, isFile_) { - this.$val = this; - if (arguments.length === 0) { - this.fdmu = new fdMutex.ptr(new $Uint64(0, 0), 0, 0); - this.Sysfd = 0; - this.pd = new pollDesc.ptr(false); - this.iovecs = ptrType$6.nil; - this.csema = 0; - this.isBlocking = 0; - this.IsStream = false; - this.ZeroReadIsEOF = false; - this.isFile = false; - return; - } - this.fdmu = fdmu_; - this.Sysfd = Sysfd_; - this.pd = pd_; - this.iovecs = iovecs_; - this.csema = csema_; - this.isBlocking = isBlocking_; - this.IsStream = IsStream_; - this.ZeroReadIsEOF = ZeroReadIsEOF_; - this.isFile = isFile_; - }); - ptrType = $ptrType($Uint32); - chanType = $chanType($Bool, false, false); - sliceType = $sliceType(chanType); - ptrType$1 = $ptrType($Uint64); - ptrType$2 = $ptrType($Int32); - arrayType = $arrayType($Uint8, 4); - sliceType$2 = $sliceType(syscall.Iovec); - ptrType$6 = $ptrType(sliceType$2); - ptrType$7 = $ptrType($Uint8); - ptrType$8 = $ptrType(FD); - ptrType$9 = $ptrType(pollDesc); - ptrType$10 = $ptrType(TimeoutError); - ptrType$11 = $ptrType(fdMutex); - sliceType$3 = $sliceType($Uint8); - ptrType$12 = $ptrType(syscall.Stat_t); - funcType = $funcType([$Uintptr], [], false); - funcType$1 = $funcType([$Uintptr], [$Bool], false); - ptrType$13 = $ptrType(syscall.Linger); - ptrType$14 = $ptrType(syscall.IPMreqn); - ptrType$15 = $ptrType(syscall.IPMreq); - ptrType$16 = $ptrType(syscall.IPv6Mreq); - sliceType$4 = $sliceType(sliceType$3); - ptrType$17 = $ptrType(sliceType$4); - pollDesc.ptr.prototype.init = function(fd) { - var fd, pd; - pd = this; - return $ifaceNil; - }; - pollDesc.prototype.init = function(fd) { return this.$val.init(fd); }; - pollDesc.ptr.prototype.close = function() { - var pd; - pd = this; - }; - pollDesc.prototype.close = function() { return this.$val.close(); }; - pollDesc.ptr.prototype.evict = function() { - var pd; - pd = this; - pd.closing = true; - }; - pollDesc.prototype.evict = function() { return this.$val.evict(); }; - pollDesc.ptr.prototype.prepare = function(mode, isFile) { - var isFile, mode, pd; - pd = this; - if (pd.closing) { - return errClosing(isFile); - } - return $ifaceNil; - }; - pollDesc.prototype.prepare = function(mode, isFile) { return this.$val.prepare(mode, isFile); }; - pollDesc.ptr.prototype.prepareRead = function(isFile) { - var isFile, pd; - pd = this; - return pd.prepare(114, isFile); - }; - pollDesc.prototype.prepareRead = function(isFile) { return this.$val.prepareRead(isFile); }; - pollDesc.ptr.prototype.prepareWrite = function(isFile) { - var isFile, pd; - pd = this; - return pd.prepare(119, isFile); - }; - pollDesc.prototype.prepareWrite = function(isFile) { return this.$val.prepareWrite(isFile); }; - pollDesc.ptr.prototype.wait = function(mode, isFile) { - var isFile, mode, pd; - pd = this; - if (pd.closing) { - return errClosing(isFile); - } - return $pkg.ErrTimeout; - }; - pollDesc.prototype.wait = function(mode, isFile) { return this.$val.wait(mode, isFile); }; - pollDesc.ptr.prototype.waitRead = function(isFile) { - var isFile, pd; - pd = this; - return pd.wait(114, isFile); - }; - pollDesc.prototype.waitRead = function(isFile) { return this.$val.waitRead(isFile); }; - pollDesc.ptr.prototype.waitWrite = function(isFile) { - var isFile, pd; - pd = this; - return pd.wait(119, isFile); - }; - pollDesc.prototype.waitWrite = function(isFile) { return this.$val.waitWrite(isFile); }; - pollDesc.ptr.prototype.pollable = function() { - return true; - }; - pollDesc.prototype.pollable = function() { return this.$val.pollable(); }; - FD.ptr.prototype.SetDeadline = function(t) { - var t; - return $ifaceNil; - }; - FD.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; - FD.ptr.prototype.SetReadDeadline = function(t) { - var t; - return $ifaceNil; - }; - FD.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; - FD.ptr.prototype.SetWriteDeadline = function(t) { - var t; - return $ifaceNil; - }; - FD.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; - runtime_Semacquire = function(s) { - var _entry, _key, _r, ch, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _r = $f._r; ch = $f.ch; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ if (s.$get() === 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (s.$get() === 0) { */ case 1: - ch = new $Chan($Bool, 0); - _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType.keyFor(_key)] = { k: _key, v: $append((_entry = semWaiters[ptrType.keyFor(s)], _entry !== undefined ? _entry.v : sliceType.nil), ch) }; - _r = $recv(ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r[0]; - /* } */ case 2: - s.$set(s.$get() - (1) >>> 0); - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semacquire }; } $f._entry = _entry; $f._key = _key; $f._r = _r; $f.ch = ch; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - runtime_Semrelease = function(s) { - var _entry, _key, ch, s, w, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; ch = $f.ch; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s.$set(s.$get() + (1) >>> 0); - w = (_entry = semWaiters[ptrType.keyFor(s)], _entry !== undefined ? _entry.v : sliceType.nil); - if (w.$length === 0) { - $s = -1; return; - } - ch = (0 >= w.$length ? ($throwRuntimeError("index out of range"), undefined) : w.$array[w.$offset + 0]); - w = $subslice(w, 1); - _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType.keyFor(_key)] = { k: _key, v: w }; - if (w.$length === 0) { - delete semWaiters[ptrType.keyFor(s)]; - } - $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f._entry = _entry; $f._key = _key; $f.ch = ch; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; - }; - errClosing = function(isFile) { - var isFile; - if (isFile) { - return $pkg.ErrFileClosing; - } - return $pkg.ErrNetClosing; - }; - TimeoutError.ptr.prototype.Error = function() { - var e; - e = this; - return "i/o timeout"; - }; - TimeoutError.prototype.Error = function() { return this.$val.Error(); }; - TimeoutError.ptr.prototype.Timeout = function() { - var e; - e = this; - return true; - }; - TimeoutError.prototype.Timeout = function() { return this.$val.Timeout(); }; - TimeoutError.ptr.prototype.Temporary = function() { - var e; - e = this; - return true; - }; - TimeoutError.prototype.Temporary = function() { return this.$val.Temporary(); }; - consume = function(v, n) { - var ln0, n, v, x, x$1, x$2, x$3; - while (true) { - if (!(v.$get().$length > 0)) { break; } - ln0 = (new $Int64(0, (x = v.$get(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).$length)); - if ((ln0.$high > n.$high || (ln0.$high === n.$high && ln0.$low > n.$low))) { - (x$2 = v.$get(), (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0] = $subslice((x$1 = v.$get(), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])), $flatten64(n)))); - return; - } - n = (x$3 = ln0, new $Int64(n.$high - x$3.$high, n.$low - x$3.$low)); - v.$set($subslice((v.$get()), 1)); - } - }; - fdMutex.ptr.prototype.incref = function() { - var mu, new$1, old, x, x$1; - mu = this; - while (true) { - old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); - if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { - return false; - } - new$1 = new $Uint64(old.$high + 0, old.$low + 8); - if ((x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { - $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); - } - if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { - return true; - } - } - }; - fdMutex.prototype.incref = function() { return this.$val.incref(); }; - fdMutex.ptr.prototype.increfAndClose = function() { - var mu, new$1, old, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; mu = $f.mu; new$1 = $f.new$1; old = $f.old; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - mu = this; - /* while (true) { */ case 1: - old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); - if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { - $s = -1; return false; - } - new$1 = (x$1 = new $Uint64(old.$high | 0, (old.$low | 1) >>> 0), new $Uint64(x$1.$high + 0, x$1.$low + 8)); - if ((x$2 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$2.$high === 0 && x$2.$low === 0))) { - $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); - } - new$1 = (x$3 = new $Uint64(2147483647, 4286578688), new $Uint64(new$1.$high & ~x$3.$high, (new$1.$low & ~x$3.$low) >>> 0)); - /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: - /* while (true) { */ case 5: - /* if (!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { break; } */ if(!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { $s = 6; continue; } - old = (x$5 = new $Uint64(0, 8388608), new $Uint64(old.$high - x$5.$high, old.$low - x$5.$low)); - $r = runtime_Semrelease((mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ $s = 5; continue; case 6: - /* while (true) { */ case 8: - /* if (!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { break; } */ if(!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { $s = 9; continue; } - old = (x$7 = new $Uint64(2048, 0), new $Uint64(old.$high - x$7.$high, old.$low - x$7.$low)); - $r = runtime_Semrelease((mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu)))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ $s = 8; continue; case 9: - $s = -1; return true; - /* } */ case 4: - /* } */ $s = 1; continue; case 2: - $s = -1; return false; - /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.increfAndClose }; } $f.mu = mu; $f.new$1 = new$1; $f.old = old; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; - }; - fdMutex.prototype.increfAndClose = function() { return this.$val.increfAndClose(); }; - fdMutex.ptr.prototype.decref = function() { - var mu, new$1, old, x, x$1; - mu = this; - while (true) { - old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); - if ((x = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x.$high === 0 && x.$low === 0))) { - $panic(new $String("inconsistent poll.fdMutex")); - } - new$1 = new $Uint64(old.$high - 0, old.$low - 8); - if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { - return (x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$1.$high === 0 && x$1.$low === 1)); - } - } - }; - fdMutex.prototype.decref = function() { return this.$val.decref(); }; - fdMutex.ptr.prototype.rwlock = function(read) { - var _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; mu = $f.mu; mutexBit = $f.mutexBit; mutexMask = $f.mutexMask; mutexSema = $f.mutexSema; mutexWait = $f.mutexWait; new$1 = $f.new$1; old = $f.old; read = $f.read; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - mu = this; - _tmp = new $Uint64(0, 0); - _tmp$1 = new $Uint64(0, 0); - _tmp$2 = new $Uint64(0, 0); - mutexBit = _tmp; - mutexWait = _tmp$1; - mutexMask = _tmp$2; - mutexSema = ptrType.nil; - if (read) { - mutexBit = new $Uint64(0, 2); - mutexWait = new $Uint64(0, 8388608); - mutexMask = new $Uint64(2047, 4286578688); - mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); - } else { - mutexBit = new $Uint64(0, 4); - mutexWait = new $Uint64(2048, 0); - mutexMask = new $Uint64(2147481600, 0); - mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); - } - /* while (true) { */ case 1: - old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); - if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { - $s = -1; return false; - } - new$1 = new $Uint64(0, 0); - if ((x$1 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { - new$1 = (x$2 = new $Uint64(old.$high | mutexBit.$high, (old.$low | mutexBit.$low) >>> 0), new $Uint64(x$2.$high + 0, x$2.$low + 8)); - if ((x$3 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$3.$high === 0 && x$3.$low === 0))) { - $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); - } - } else { - new$1 = new $Uint64(old.$high + mutexWait.$high, old.$low + mutexWait.$low); - if ((x$4 = new $Uint64(new$1.$high & mutexMask.$high, (new$1.$low & mutexMask.$low) >>> 0), (x$4.$high === 0 && x$4.$low === 0))) { - $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); - } - } - /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: - if ((x$5 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0))) { - $s = -1; return true; - } - $r = runtime_Semacquire(mutexSema); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 4: - /* } */ $s = 1; continue; case 2: - $s = -1; return false; - /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.rwlock }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.mu = mu; $f.mutexBit = mutexBit; $f.mutexMask = mutexMask; $f.mutexSema = mutexSema; $f.mutexWait = mutexWait; $f.new$1 = new$1; $f.old = old; $f.read = read; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; - }; - fdMutex.prototype.rwlock = function(read) { return this.$val.rwlock(read); }; - fdMutex.ptr.prototype.rwunlock = function(read) { - var _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; mu = $f.mu; mutexBit = $f.mutexBit; mutexMask = $f.mutexMask; mutexSema = $f.mutexSema; mutexWait = $f.mutexWait; new$1 = $f.new$1; old = $f.old; read = $f.read; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - mu = this; - _tmp = new $Uint64(0, 0); - _tmp$1 = new $Uint64(0, 0); - _tmp$2 = new $Uint64(0, 0); - mutexBit = _tmp; - mutexWait = _tmp$1; - mutexMask = _tmp$2; - mutexSema = ptrType.nil; - if (read) { - mutexBit = new $Uint64(0, 2); - mutexWait = new $Uint64(0, 8388608); - mutexMask = new $Uint64(2047, 4286578688); - mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); - } else { - mutexBit = new $Uint64(0, 4); - mutexWait = new $Uint64(2048, 0); - mutexMask = new $Uint64(2147481600, 0); - mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); - } - /* while (true) { */ case 1: - old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); - if ((x = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x.$high === 0 && x.$low === 0)) || (x$1 = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { - $panic(new $String("inconsistent poll.fdMutex")); - } - new$1 = (x$2 = new $Uint64(old.$high & ~mutexBit.$high, (old.$low & ~mutexBit.$low) >>> 0), new $Uint64(x$2.$high - 0, x$2.$low - 8)); - if (!((x$3 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$3.$high === 0 && x$3.$low === 0)))) { - new$1 = (x$4 = mutexWait, new $Uint64(new$1.$high - x$4.$high, new$1.$low - x$4.$low)); - } - /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: - /* */ if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { */ case 5: - $r = runtime_Semrelease(mutexSema); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 6: - $s = -1; return (x$6 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$6.$high === 0 && x$6.$low === 1)); - /* } */ case 4: - /* } */ $s = 1; continue; case 2: - $s = -1; return false; - /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.rwunlock }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.mu = mu; $f.mutexBit = mutexBit; $f.mutexMask = mutexMask; $f.mutexSema = mutexSema; $f.mutexWait = mutexWait; $f.new$1 = new$1; $f.old = old; $f.read = read; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; - }; - fdMutex.prototype.rwunlock = function(read) { return this.$val.rwunlock(read); }; - FD.ptr.prototype.incref = function() { - var fd; - fd = this; - if (!fd.fdmu.incref()) { - return errClosing(fd.isFile); - } - return $ifaceNil; - }; - FD.prototype.incref = function() { return this.$val.incref(); }; - FD.ptr.prototype.decref = function() { - var _r, fd, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - /* */ if (fd.fdmu.decref()) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (fd.fdmu.decref()) { */ case 1: - _r = fd.destroy(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } */ case 2: - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.decref }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.decref = function() { return this.$val.decref(); }; - FD.ptr.prototype.readLock = function() { - var _r, fd, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - _r = fd.fdmu.rwlock(true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!_r) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!_r) { */ case 1: - $s = -1; return errClosing(fd.isFile); - /* } */ case 2: - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.readLock }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.readLock = function() { return this.$val.readLock(); }; - FD.ptr.prototype.readUnlock = function() { - var _r, _r$1, fd, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - _r = fd.fdmu.rwunlock(true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (_r) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r) { */ case 1: - _r$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - /* } */ case 2: - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.readUnlock }; } $f._r = _r; $f._r$1 = _r$1; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.readUnlock = function() { return this.$val.readUnlock(); }; - FD.ptr.prototype.writeLock = function() { - var _r, fd, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - _r = fd.fdmu.rwlock(false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!_r) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!_r) { */ case 1: - $s = -1; return errClosing(fd.isFile); - /* } */ case 2: - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.writeLock }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.writeLock = function() { return this.$val.writeLock(); }; - FD.ptr.prototype.writeUnlock = function() { - var _r, _r$1, fd, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - _r = fd.fdmu.rwunlock(false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (_r) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r) { */ case 1: - _r$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - /* } */ case 2: - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.writeUnlock }; } $f._r = _r; $f._r$1 = _r$1; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.writeUnlock = function() { return this.$val.writeUnlock(); }; - FD.ptr.prototype.eofError = function(n, err) { - var err, fd, n; - fd = this; - if ((n === 0) && $interfaceIsEqual(err, $ifaceNil) && fd.ZeroReadIsEOF) { - return io.EOF; - } - return err; - }; - FD.prototype.eofError = function(n, err) { return this.$val.eofError(n, err); }; - FD.ptr.prototype.Fchmod = function(mode) { - var err, fd, mode, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; mode = $f.mode; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Fchmod(fd.Sysfd, mode); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchmod }; } $f.err = err; $f.fd = fd; $f.mode = mode; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Fchmod = function(mode) { return this.$val.Fchmod(mode); }; - FD.ptr.prototype.Fchown = function(uid, gid) { - var err, fd, gid, uid, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; gid = $f.gid; uid = $f.uid; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Fchown(fd.Sysfd, uid, gid); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchown }; } $f.err = err; $f.fd = fd; $f.gid = gid; $f.uid = uid; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Fchown = function(uid, gid) { return this.$val.Fchown(uid, gid); }; - FD.ptr.prototype.Ftruncate = function(size) { - var err, fd, size, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; size = $f.size; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Ftruncate(fd.Sysfd, size); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Ftruncate }; } $f.err = err; $f.fd = fd; $f.size = size; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Ftruncate = function(size) { return this.$val.Ftruncate(size); }; - FD.ptr.prototype.Fsync = function() { - var err, fd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Fsync(fd.Sysfd); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fsync }; } $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Fsync = function() { return this.$val.Fsync(); }; - FD.ptr.prototype.Init = function(net, pollable) { - var err, fd, net, pollable; - fd = this; - if (net === "file") { - fd.isFile = true; - } - if (!pollable) { - fd.isBlocking = 1; - return $ifaceNil; - } - err = fd.pd.init(fd); - if (!($interfaceIsEqual(err, $ifaceNil))) { - fd.isBlocking = 1; - } - return err; - }; - FD.prototype.Init = function(net, pollable) { return this.$val.Init(net, pollable); }; - FD.ptr.prototype.destroy = function() { - var _r, err, fd, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - fd.pd.close(); - _r = $pkg.CloseFunc(fd.Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - fd.Sysfd = -1; - $r = runtime_Semrelease((fd.$ptr_csema || (fd.$ptr_csema = new ptrType(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.destroy }; } $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.destroy = function() { return this.$val.destroy(); }; - FD.ptr.prototype.Close = function() { - var _r, _r$1, err, fd, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - _r = fd.fdmu.increfAndClose(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!_r) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!_r) { */ case 1: - $s = -1; return errClosing(fd.isFile); - /* } */ case 2: - fd.pd.evict(); - _r$1 = fd.decref(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - err = _r$1; - /* */ if (fd.isBlocking === 0) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (fd.isBlocking === 0) { */ case 5: - $r = runtime_Semacquire((fd.$ptr_csema || (fd.$ptr_csema = new ptrType(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 6: - $s = -1; return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Close }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.Close = function() { return this.$val.Close(); }; - FD.ptr.prototype.Shutdown = function(how) { - var err, fd, how, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; how = $f.how; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Shutdown(fd.Sysfd, how); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Shutdown }; } $f.err = err; $f.fd = fd; $f.how = how; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Shutdown = function(how) { return this.$val.Shutdown(how); }; - FD.ptr.prototype.SetBlocking = function() { - var err, fd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - atomic.StoreUint32((fd.$ptr_isBlocking || (fd.$ptr_isBlocking = new ptrType(function() { return this.$target.isBlocking; }, function($v) { this.$target.isBlocking = $v; }, fd))), 1); - $s = -1; return syscall.SetNonblock(fd.Sysfd, false); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetBlocking }; } $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetBlocking = function() { return this.$val.SetBlocking(); }; - FD.ptr.prototype.Read = function(p) { - var _r, _tuple, err, err$1, err$2, fd, n, p, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, err]; - } - $deferred.push([$methodVal(fd, "readUnlock"), []]); - if (p.$length === 0) { - $s = -1; return [0, $ifaceNil]; - } - err$1 = fd.pd.prepareRead(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [0, err$1]; - } - if (fd.IsStream && p.$length > 1073741824) { - p = $subslice(p, 0, 1073741824); - } - while (true) { - _tuple = syscall.Read(fd.Sysfd, p); - n = _tuple[0]; - err$2 = _tuple[1]; - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - n = 0; - if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { - err$2 = fd.pd.waitRead(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - continue; - } - } - if (false && $interfaceIsEqual(err$2, new syscall.Errno(4))) { - continue; - } - } - err$2 = fd.eofError(n, err$2); - $s = -1; return [n, err$2]; - } - $s = -1; return [0, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Read }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Read = function(p) { return this.$val.Read(p); }; - FD.ptr.prototype.Pread = function(p, off) { - var _r, _tuple, err, err$1, fd, n, off, p, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; fd = $f.fd; n = $f.n; off = $f.off; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, err]; - } - if (fd.IsStream && p.$length > 1073741824) { - p = $subslice(p, 0, 1073741824); - } - _tuple = syscall.Pread(fd.Sysfd, p, off); - n = _tuple[0]; - err$1 = _tuple[1]; - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - n = 0; - } - _r = fd.decref(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - err$1 = fd.eofError(n, err$1); - $s = -1; return [n, err$1]; - /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Pread }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.n = n; $f.off = off; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.prototype.Pread = function(p, off) { return this.$val.Pread(p, off); }; - FD.ptr.prototype.ReadFrom = function(p) { - var _r, _tuple, err, err$1, err$2, fd, n, p, sa, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, $ifaceNil, err]; - } - $deferred.push([$methodVal(fd, "readUnlock"), []]); - err$1 = fd.pd.prepareRead(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [0, $ifaceNil, err$1]; - } - while (true) { - _tuple = syscall.Recvfrom(fd.Sysfd, p, 0); - n = _tuple[0]; - sa = _tuple[1]; - err$2 = _tuple[2]; - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - n = 0; - if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { - err$2 = fd.pd.waitRead(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - continue; - } - } - } - err$2 = fd.eofError(n, err$2); - $s = -1; return [n, sa, err$2]; - } - $s = -1; return [0, $ifaceNil, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadFrom }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.ReadFrom = function(p) { return this.$val.ReadFrom(p); }; - FD.ptr.prototype.ReadMsg = function(p, oob) { - var _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, 0, 0, $ifaceNil, err]; - } - $deferred.push([$methodVal(fd, "readUnlock"), []]); - err$1 = fd.pd.prepareRead(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [0, 0, 0, $ifaceNil, err$1]; - } - while (true) { - _tuple = syscall.Recvmsg(fd.Sysfd, p, oob, 0); - n = _tuple[0]; - oobn = _tuple[1]; - flags = _tuple[2]; - sa = _tuple[3]; - err$2 = _tuple[4]; - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { - err$2 = fd.pd.waitRead(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - continue; - } - } - } - err$2 = fd.eofError(n, err$2); - $s = -1; return [n, oobn, flags, sa, err$2]; - } - $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadMsg }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.ReadMsg = function(p, oob) { return this.$val.ReadMsg(p, oob); }; - FD.ptr.prototype.Write = function(p) { - var _r, _tuple, err, err$1, err$2, fd, max, n, nn, p, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; max = $f.max; n = $f.n; nn = $f.nn; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, err]; - } - $deferred.push([$methodVal(fd, "writeUnlock"), []]); - err$1 = fd.pd.prepareWrite(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [0, err$1]; - } - nn = 0; - while (true) { - max = p.$length; - if (fd.IsStream && (max - nn >> 0) > 1073741824) { - max = nn + 1073741824 >> 0; - } - _tuple = syscall.Write(fd.Sysfd, $subslice(p, nn, max)); - n = _tuple[0]; - err$2 = _tuple[1]; - if (n > 0) { - nn = nn + (n) >> 0; - } - if (nn === p.$length) { - $s = -1; return [nn, err$2]; - } - if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { - err$2 = fd.pd.waitWrite(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - continue; - } - } - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - $s = -1; return [nn, err$2]; - } - if (n === 0) { - $s = -1; return [nn, io.ErrUnexpectedEOF]; - } - } - $s = -1; return [0, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Write }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.max = max; $f.n = n; $f.nn = nn; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Write = function(p) { return this.$val.Write(p); }; - FD.ptr.prototype.Pwrite = function(p, off) { - var _tuple, err, err$1, fd, max, n, nn, off, p, x, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; fd = $f.fd; max = $f.max; n = $f.n; nn = $f.nn; off = $f.off; p = $f.p; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, err]; - } - $deferred.push([$methodVal(fd, "decref"), []]); - nn = 0; - while (true) { - max = p.$length; - if (fd.IsStream && (max - nn >> 0) > 1073741824) { - max = nn + 1073741824 >> 0; - } - _tuple = syscall.Pwrite(fd.Sysfd, $subslice(p, nn, max), (x = (new $Int64(0, nn)), new $Int64(off.$high + x.$high, off.$low + x.$low))); - n = _tuple[0]; - err$1 = _tuple[1]; - if (n > 0) { - nn = nn + (n) >> 0; - } - if (nn === p.$length) { - $s = -1; return [nn, err$1]; - } - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [nn, err$1]; - } - if (n === 0) { - $s = -1; return [nn, io.ErrUnexpectedEOF]; - } - } - $s = -1; return [0, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Pwrite }; } $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.max = max; $f.n = n; $f.nn = nn; $f.off = off; $f.p = p; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Pwrite = function(p, off) { return this.$val.Pwrite(p, off); }; - FD.ptr.prototype.WriteTo = function(p, sa) { - var _r, _r$1, err, err$1, err$2, fd, p, sa, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, err]; - } - $deferred.push([$methodVal(fd, "writeUnlock"), []]); - err$1 = fd.pd.prepareWrite(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [0, err$1]; - } - /* while (true) { */ case 2: - _r$1 = syscall.Sendto(fd.Sysfd, p, 0, sa); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - err$2 = _r$1; - if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { - err$2 = fd.pd.waitWrite(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - /* continue; */ $s = 2; continue; - } - } - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - $s = -1; return [0, err$2]; - } - $s = -1; return [p.$length, $ifaceNil]; - /* } */ $s = 2; continue; case 3: - $s = -1; return [0, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteTo }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.WriteTo = function(p, sa) { return this.$val.WriteTo(p, sa); }; - FD.ptr.prototype.WriteMsg = function(p, oob, sa) { - var _r, _r$1, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; oob = $f.oob; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, 0, err]; - } - $deferred.push([$methodVal(fd, "writeUnlock"), []]); - err$1 = fd.pd.prepareWrite(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [0, 0, err$1]; - } - /* while (true) { */ case 2: - _r$1 = syscall.SendmsgN(fd.Sysfd, p, oob, sa, 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; - n = _tuple[0]; - err$2 = _tuple[1]; - if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { - err$2 = fd.pd.waitWrite(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - /* continue; */ $s = 2; continue; - } - } - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - $s = -1; return [n, 0, err$2]; - } - $s = -1; return [n, oob.$length, err$2]; - /* } */ $s = 2; continue; case 3: - $s = -1; return [0, 0, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteMsg }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.oob = oob; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.WriteMsg = function(p, oob, sa) { return this.$val.WriteMsg(p, oob, sa); }; - FD.ptr.prototype.Accept = function() { - var _1, _r, _r$1, _tuple, err, err$1, err$2, errcall, fd, rsa, s, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; errcall = $f.errcall; fd = $f.fd; rsa = $f.rsa; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [-1, $ifaceNil, "", err]; - } - $deferred.push([$methodVal(fd, "readUnlock"), []]); - err$1 = fd.pd.prepareRead(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [-1, $ifaceNil, "", err$1]; - } - /* while (true) { */ case 2: - _r$1 = accept(fd.Sysfd); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; - s = _tuple[0]; - rsa = _tuple[1]; - errcall = _tuple[2]; - err$2 = _tuple[3]; - if ($interfaceIsEqual(err$2, $ifaceNil)) { - $s = -1; return [s, rsa, "", err$2]; - } - _1 = err$2; - if ($interfaceIsEqual(_1, new syscall.Errno((11)))) { - if (fd.pd.pollable()) { - err$2 = fd.pd.waitRead(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - /* continue; */ $s = 2; continue; - } - } - } else if ($interfaceIsEqual(_1, new syscall.Errno((103)))) { - /* continue; */ $s = 2; continue; - } - $s = -1; return [-1, $ifaceNil, errcall, err$2]; - /* } */ $s = 2; continue; case 3: - $s = -1; return [0, $ifaceNil, "", $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Accept }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.errcall = errcall; $f.fd = fd; $f.rsa = rsa; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Accept = function() { return this.$val.Accept(); }; - FD.ptr.prototype.Seek = function(offset, whence) { - var err, fd, offset, whence, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; offset = $f.offset; whence = $f.whence; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [new $Int64(0, 0), err]; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Seek(fd.Sysfd, offset, whence); - /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Seek }; } $f.err = err; $f.fd = fd; $f.offset = offset; $f.whence = whence; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; - FD.ptr.prototype.ReadDirent = function(buf) { - var _tuple, buf, err, err$1, fd, n, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; buf = $f.buf; err = $f.err; err$1 = $f.err$1; fd = $f.fd; n = $f.n; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, err]; - } - $deferred.push([$methodVal(fd, "decref"), []]); - while (true) { - _tuple = syscall.ReadDirent(fd.Sysfd, buf); - n = _tuple[0]; - err$1 = _tuple[1]; - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - n = 0; - if ($interfaceIsEqual(err$1, new syscall.Errno(11)) && fd.pd.pollable()) { - err$1 = fd.pd.waitRead(fd.isFile); - if ($interfaceIsEqual(err$1, $ifaceNil)) { - continue; - } - } - } - $s = -1; return [n, err$1]; - } - $s = -1; return [0, $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadDirent }; } $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.n = n; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.ReadDirent = function(buf) { return this.$val.ReadDirent(buf); }; - FD.ptr.prototype.Fchdir = function() { - var err, fd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Fchdir(fd.Sysfd); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchdir }; } $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Fchdir = function() { return this.$val.Fchdir(); }; - FD.ptr.prototype.Fstat = function(s) { - var err, fd, s, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.Fstat(fd.Sysfd, s); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fstat }; } $f.err = err; $f.fd = fd; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Fstat = function(s) { return this.$val.Fstat(s); }; - DupCloseOnExec = function(fd) { - var _1, _r, _tuple, e1, fd, r0, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; fd = $f.fd; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if (atomic.LoadInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$2(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; })))) === 1) { - _tuple = syscall.Syscall(72, ((fd >>> 0)), 1030, 0); - r0 = _tuple[0]; - e1 = _tuple[2]; - _1 = e1; - if (_1 === (0)) { - $s = -1; return [((r0 >> 0)), "", $ifaceNil]; - } else if ((_1 === (22)) || (_1 === (38))) { - atomic.StoreInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$2(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; }))), 0); - } else { - $s = -1; return [-1, "fcntl", new syscall.Errno(e1)]; - } - } - _r = dupCloseOnExecOld(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: DupCloseOnExec }; } $f._1 = _1; $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.fd = fd; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.DupCloseOnExec = DupCloseOnExec; - dupCloseOnExecOld = function(fd) { - var _tuple, err, fd, newfd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; err = $f.err; fd = $f.fd; newfd = $f.newfd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - $r = syscall.ForkLock.RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(syscall.ForkLock, "RUnlock"), []]); - _tuple = syscall.Dup(fd); - newfd = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [-1, "dup", err]; - } - syscall.CloseOnExec(newfd); - $s = -1; return [newfd, "", $ifaceNil]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: dupCloseOnExecOld }; } $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.newfd = newfd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.ptr.prototype.Dup = function() { - var _r, err, fd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [-1, "", err]; - } - $deferred.push([$methodVal(fd, "decref"), []]); - _r = DupCloseOnExec(fd.Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Dup }; } $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Dup = function() { return this.$val.Dup(); }; - FD.ptr.prototype.WaitWrite = function() { - var fd; - fd = this; - return fd.pd.waitWrite(fd.isFile); - }; - FD.prototype.WaitWrite = function() { return this.$val.WaitWrite(); }; - FD.ptr.prototype.WriteOnce = function(p) { - var _r, err, fd, p, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fd = $f.fd; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [0, err]; - } - $deferred.push([$methodVal(fd, "writeUnlock"), []]); - $s = -1; return syscall.Write(fd.Sysfd, p); - /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteOnce }; } $f._r = _r; $f.err = err; $f.fd = fd; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.WriteOnce = function(p) { return this.$val.WriteOnce(p); }; - FD.ptr.prototype.RawControl = function(f) { - var err, f, fd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $r = f(((fd.Sysfd >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return $ifaceNil; - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawControl }; } $f.err = err; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.RawControl = function(f) { return this.$val.RawControl(f); }; - FD.ptr.prototype.RawRead = function(f) { - var _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "readUnlock"), []]); - err$1 = fd.pd.prepareRead(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return err$1; - } - /* while (true) { */ case 2: - _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (_r$1) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_r$1) { */ case 4: - $s = -1; return $ifaceNil; - /* } */ case 5: - err$2 = fd.pd.waitRead(fd.isFile); - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - $s = -1; return err$2; - } - /* } */ $s = 2; continue; case 3: - $s = -1; return $ifaceNil; - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawRead }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.RawRead = function(f) { return this.$val.RawRead(f); }; - FD.ptr.prototype.RawWrite = function(f) { - var _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "writeUnlock"), []]); - err$1 = fd.pd.prepareWrite(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return err$1; - } - /* while (true) { */ case 2: - _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (_r$1) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_r$1) { */ case 4: - $s = -1; return $ifaceNil; - /* } */ case 5: - err$2 = fd.pd.waitWrite(fd.isFile); - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - $s = -1; return err$2; - } - /* } */ $s = 2; continue; case 3: - $s = -1; return $ifaceNil; - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawWrite }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.RawWrite = function(f) { return this.$val.RawWrite(f); }; - accept = function(s) { - var _1, _r, _r$1, _r$2, _tuple, _tuple$1, err, ns, s, sa, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; ns = $f.ns; s = $f.s; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = $pkg.Accept4Func(s, 526336); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - ns = _tuple[0]; - sa = _tuple[1]; - err = _tuple[2]; - _1 = err; - if ($interfaceIsEqual(_1, $ifaceNil)) { - $s = -1; return [ns, sa, "", $ifaceNil]; - } else if ($interfaceIsEqual(_1, new syscall.Errno((38)))) { - } else if ($interfaceIsEqual(_1, new syscall.Errno((22)))) { - } else if ($interfaceIsEqual(_1, new syscall.Errno((13)))) { - } else if ($interfaceIsEqual(_1, new syscall.Errno((14)))) { - } else { - $s = -1; return [-1, sa, "accept4", err]; - } - _r$1 = $pkg.AcceptFunc(s); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - ns = _tuple$1[0]; - sa = _tuple$1[1]; - err = _tuple$1[2]; - if ($interfaceIsEqual(err, $ifaceNil)) { - syscall.CloseOnExec(ns); - } - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [-1, $ifaceNil, "accept", err]; - } - err = syscall.SetNonblock(ns, true); - /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: - _r$2 = $pkg.CloseFunc(ns); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$2; - $s = -1; return [-1, $ifaceNil, "setnonblock", err]; - /* } */ case 4: - $s = -1; return [ns, sa, "", $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: accept }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.ns = ns; $f.s = s; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; - }; - FD.ptr.prototype.SetsockoptInt = function(level, name, arg) { - var arg, err, fd, level, name, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.SetsockoptInt(fd.Sysfd, level, name, arg); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptInt }; } $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetsockoptInt = function(level, name, arg) { return this.$val.SetsockoptInt(level, name, arg); }; - FD.ptr.prototype.SetsockoptInet4Addr = function(level, name, arg) { - var arg, err, fd, level, name, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.SetsockoptInet4Addr(fd.Sysfd, level, name, $clone(arg, arrayType)); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptInet4Addr }; } $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetsockoptInet4Addr = function(level, name, arg) { return this.$val.SetsockoptInet4Addr(level, name, arg); }; - FD.ptr.prototype.SetsockoptLinger = function(level, name, l) { - var err, fd, l, level, name, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; l = $f.l; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.SetsockoptLinger(fd.Sysfd, level, name, l); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptLinger }; } $f.err = err; $f.fd = fd; $f.l = l; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetsockoptLinger = function(level, name, l) { return this.$val.SetsockoptLinger(level, name, l); }; - FD.ptr.prototype.SetsockoptIPMreqn = function(level, name, mreq) { - var err, fd, level, mreq, name, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.SetsockoptIPMreqn(fd.Sysfd, level, name, mreq); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPMreqn }; } $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetsockoptIPMreqn = function(level, name, mreq) { return this.$val.SetsockoptIPMreqn(level, name, mreq); }; - FD.ptr.prototype.SetsockoptByte = function(level, name, arg) { - var arg, err, fd, level, name, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.SetsockoptByte(fd.Sysfd, level, name, arg); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptByte }; } $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetsockoptByte = function(level, name, arg) { return this.$val.SetsockoptByte(level, name, arg); }; - FD.ptr.prototype.SetsockoptIPMreq = function(level, name, mreq) { - var err, fd, level, mreq, name, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.SetsockoptIPMreq(fd.Sysfd, level, name, mreq); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPMreq }; } $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetsockoptIPMreq = function(level, name, mreq) { return this.$val.SetsockoptIPMreq(level, name, mreq); }; - FD.ptr.prototype.SetsockoptIPv6Mreq = function(level, name, mreq) { - var err, fd, level, mreq, name, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - fd = this; - err = fd.incref(); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - $deferred.push([$methodVal(fd, "decref"), []]); - $s = -1; return syscall.SetsockoptIPv6Mreq(fd.Sysfd, level, name, mreq); - /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPv6Mreq }; } $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.SetsockoptIPv6Mreq = function(level, name, mreq) { return this.$val.SetsockoptIPv6Mreq(level, name, mreq); }; - FD.ptr.prototype.Writev = function(v) { - var _i, _r, _ref, _tuple, chunk, e0, err, err$1, err$2, fd, iovecs, maxVec, n, v, wrote, x, x$1, x$2, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; chunk = $f.chunk; e0 = $f.e0; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; iovecs = $f.iovecs; maxVec = $f.maxVec; n = $f.n; v = $f.v; wrote = $f.wrote; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - iovecs = [iovecs]; - fd = this; - _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [new $Int64(0, 0), err]; - } - $deferred.push([$methodVal(fd, "writeUnlock"), []]); - err$1 = fd.pd.prepareWrite(fd.isFile); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - $s = -1; return [new $Int64(0, 0), err$1]; - } - iovecs[0] = sliceType$2.nil; - if (!(fd.iovecs === ptrType$6.nil)) { - iovecs[0] = fd.iovecs.$get(); - } - maxVec = 1024; - n = new $Int64(0, 0); - err$2 = $ifaceNil; - /* while (true) { */ case 2: - /* if (!(v.$get().$length > 0)) { break; } */ if(!(v.$get().$length > 0)) { $s = 3; continue; } - iovecs[0] = $subslice(iovecs[0], 0, 0); - _ref = v.$get(); - _i = 0; - /* while (true) { */ case 4: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } - chunk = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - if (chunk.$length === 0) { - _i++; - /* continue; */ $s = 4; continue; - } - iovecs[0] = $append(iovecs[0], new syscall.Iovec.ptr($indexPtr(chunk.$array, chunk.$offset + 0, ptrType$7), new $Uint64(0, 0))); - if (fd.IsStream && chunk.$length > 1073741824) { - (x = iovecs[0].$length - 1 >> 0, ((x < 0 || x >= iovecs[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : iovecs[0].$array[iovecs[0].$offset + x])).SetLen(1073741824); - /* break; */ $s = 5; continue; - } - (x$1 = iovecs[0].$length - 1 >> 0, ((x$1 < 0 || x$1 >= iovecs[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : iovecs[0].$array[iovecs[0].$offset + x$1])).SetLen(chunk.$length); - if (iovecs[0].$length === maxVec) { - /* break; */ $s = 5; continue; - } - _i++; - /* } */ $s = 4; continue; case 5: - if (iovecs[0].$length === 0) { - /* break; */ $s = 3; continue; - } - fd.iovecs = (iovecs.$ptr || (iovecs.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, iovecs))); - _tuple = syscall.Syscall(20, ((fd.Sysfd >>> 0)), (($sliceToArray(iovecs[0]))), ((iovecs[0].$length >>> 0))); - wrote = _tuple[0]; - e0 = _tuple[2]; - if (wrote === 4294967295) { - wrote = 0; - } - $r = $pkg.TestHookDidWritev(((wrote >> 0))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - n = (x$2 = (new $Int64(0, wrote.constructor === Number ? wrote : 1)), new $Int64(n.$high + x$2.$high, n.$low + x$2.$low)); - consume(v, (new $Int64(0, wrote.constructor === Number ? wrote : 1))); - if (e0 === 11) { - err$2 = fd.pd.waitWrite(fd.isFile); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - /* continue; */ $s = 2; continue; - } - } else if (!((e0 === 0))) { - err$2 = new syscall.Errno((e0)); - } - if (!($interfaceIsEqual(err$2, $ifaceNil))) { - /* break; */ $s = 3; continue; - } - if ((n.$high === 0 && n.$low === 0)) { - err$2 = io.ErrUnexpectedEOF; - /* break; */ $s = 3; continue; - } - /* } */ $s = 2; continue; case 3: - $s = -1; return [n, err$2]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Writev }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f.chunk = chunk; $f.e0 = e0; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.iovecs = iovecs; $f.maxVec = maxVec; $f.n = n; $f.v = v; $f.wrote = wrote; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - FD.prototype.Writev = function(v) { return this.$val.Writev(v); }; - ptrType$9.methods = [{prop: "init", name: "init", pkg: "internal/poll", typ: $funcType([ptrType$8], [$error], false)}, {prop: "close", name: "close", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "evict", name: "evict", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "prepare", name: "prepare", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "prepareRead", name: "prepareRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "prepareWrite", name: "prepareWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "wait", name: "wait", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "waitRead", name: "waitRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitWrite", name: "waitWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitCanceled", name: "waitCanceled", pkg: "internal/poll", typ: $funcType([$Int], [], false)}, {prop: "pollable", name: "pollable", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}]; - ptrType$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; - ptrType$11.methods = [{prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "increfAndClose", name: "increfAndClose", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "rwlock", name: "rwlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}, {prop: "rwunlock", name: "rwunlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}]; - ptrType$8.methods = [{prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readLock", name: "readLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readUnlock", name: "readUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "writeLock", name: "writeLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "writeUnlock", name: "writeUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "eofError", name: "eofError", pkg: "internal/poll", typ: $funcType([$Int, $error], [$error], false)}, {prop: "Fchmod", name: "Fchmod", pkg: "", typ: $funcType([$Uint32], [$error], false)}, {prop: "Fchown", name: "Fchown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Ftruncate", name: "Ftruncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "Fsync", name: "Fsync", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Init", name: "Init", pkg: "", typ: $funcType([$String, $Bool], [$error], false)}, {prop: "destroy", name: "destroy", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Shutdown", name: "Shutdown", pkg: "", typ: $funcType([$Int], [$error], false)}, {prop: "SetBlocking", name: "SetBlocking", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Pread", name: "Pread", pkg: "", typ: $funcType([sliceType$3, $Int64], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$3], [$Int, syscall.Sockaddr, $error], false)}, {prop: "ReadMsg", name: "ReadMsg", pkg: "", typ: $funcType([sliceType$3, sliceType$3], [$Int, $Int, $Int, syscall.Sockaddr, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Pwrite", name: "Pwrite", pkg: "", typ: $funcType([sliceType$3, $Int64], [$Int, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$3, syscall.Sockaddr], [$Int, $error], false)}, {prop: "WriteMsg", name: "WriteMsg", pkg: "", typ: $funcType([sliceType$3, sliceType$3, syscall.Sockaddr], [$Int, $Int, $error], false)}, {prop: "Accept", name: "Accept", pkg: "", typ: $funcType([], [$Int, syscall.Sockaddr, $String, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "ReadDirent", name: "ReadDirent", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Fchdir", name: "Fchdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Fstat", name: "Fstat", pkg: "", typ: $funcType([ptrType$12], [$error], false)}, {prop: "Dup", name: "Dup", pkg: "", typ: $funcType([], [$Int, $String, $error], false)}, {prop: "WaitWrite", name: "WaitWrite", pkg: "", typ: $funcType([], [$error], false)}, {prop: "WriteOnce", name: "WriteOnce", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "RawControl", name: "RawControl", pkg: "", typ: $funcType([funcType], [$error], false)}, {prop: "RawRead", name: "RawRead", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "RawWrite", name: "RawWrite", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "SetsockoptInt", name: "SetsockoptInt", pkg: "", typ: $funcType([$Int, $Int, $Int], [$error], false)}, {prop: "SetsockoptInet4Addr", name: "SetsockoptInet4Addr", pkg: "", typ: $funcType([$Int, $Int, arrayType], [$error], false)}, {prop: "SetsockoptLinger", name: "SetsockoptLinger", pkg: "", typ: $funcType([$Int, $Int, ptrType$13], [$error], false)}, {prop: "SetsockoptIPMreqn", name: "SetsockoptIPMreqn", pkg: "", typ: $funcType([$Int, $Int, ptrType$14], [$error], false)}, {prop: "SetsockoptByte", name: "SetsockoptByte", pkg: "", typ: $funcType([$Int, $Int, $Uint8], [$error], false)}, {prop: "SetsockoptIPMreq", name: "SetsockoptIPMreq", pkg: "", typ: $funcType([$Int, $Int, ptrType$15], [$error], false)}, {prop: "SetsockoptIPv6Mreq", name: "SetsockoptIPv6Mreq", pkg: "", typ: $funcType([$Int, $Int, ptrType$16], [$error], false)}, {prop: "Writev", name: "Writev", pkg: "", typ: $funcType([ptrType$17], [$Int64, $error], false)}]; - pollDesc.init("internal/poll", [{prop: "closing", name: "closing", embedded: false, exported: false, typ: $Bool, tag: ""}]); - TimeoutError.init("", []); - fdMutex.init("internal/poll", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "rsema", name: "rsema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "wsema", name: "wsema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); - FD.init("internal/poll", [{prop: "fdmu", name: "fdmu", embedded: false, exported: false, typ: fdMutex, tag: ""}, {prop: "Sysfd", name: "Sysfd", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "pd", name: "pd", embedded: false, exported: false, typ: pollDesc, tag: ""}, {prop: "iovecs", name: "iovecs", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "csema", name: "csema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "isBlocking", name: "isBlocking", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "IsStream", name: "IsStream", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ZeroReadIsEOF", name: "ZeroReadIsEOF", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "isFile", name: "isFile", embedded: false, exported: false, typ: $Bool, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = syscall.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - semWaiters = {}; - $pkg.ErrNetClosing = errors.New("use of closed network connection"); - $pkg.ErrFileClosing = errors.New("use of closed file"); - $pkg.ErrNoDeadline = errors.New("file type does not support deadline"); - $pkg.ErrTimeout = new TimeoutError.ptr(); - $pkg.TestHookDidWritev = (function(wrote) { - var wrote; - }); - tryDupCloexec = 1; - $pkg.Accept4Func = syscall.Accept4; - $pkg.CloseFunc = syscall.Close; - $pkg.AcceptFunc = syscall.Accept; - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["internal/syscall/unix"] = (function() { - var $pkg = {}, $init, atomic, syscall, IsNonblock; - atomic = $packages["sync/atomic"]; - syscall = $packages["syscall"]; - IsNonblock = function(fd) { - var _tmp, _tmp$1, err, fd, nonblocking; - nonblocking = false; - err = $ifaceNil; - _tmp = false; - _tmp$1 = $ifaceNil; - nonblocking = _tmp; - err = _tmp$1; - return [nonblocking, err]; - }; - $pkg.IsNonblock = IsNonblock; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = atomic.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = syscall.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["internal/testlog"] = (function() { - var $pkg = {}, $init, atomic, Interface, ptrType, logger, Logger, Stat; - atomic = $packages["sync/atomic"]; - Interface = $pkg.Interface = $newType(8, $kindInterface, "testlog.Interface", true, "internal/testlog", true, null); - ptrType = $ptrType(Interface); - Logger = function() { - var impl; - impl = logger.Load(); - if ($interfaceIsEqual(impl, $ifaceNil)) { - return $ifaceNil; - } - return $assertType(impl, ptrType).$get(); - }; - $pkg.Logger = Logger; - Stat = function(name) { - var log, name, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; log = $f.log; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - log = Logger(); - /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: - $r = log.Stat(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Stat }; } $f.log = log; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Stat = Stat; - Interface.init([{prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Getenv", name: "Getenv", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([$String], [], false)}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = atomic.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - logger = new atomic.Value.ptr($ifaceNil); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["os"] = (function() { - var $pkg = {}, $init, errors, js, poll, unix, testlog, io, runtime, sync, atomic, syscall, time, timeout, PathError, SyscallError, LinkError, file, dirInfo, File, FileInfo, FileMode, fileStat, sliceType, ptrType, sliceType$1, ptrType$1, sliceType$2, ptrType$2, ptrType$3, ptrType$4, sliceType$5, ptrType$12, arrayType$1, ptrType$13, funcType$1, ptrType$15, arrayType$6, ptrType$16, errFinished, lstat, runtime_args, init, NewSyscallError, IsNotExist, underlyingError, wrapSyscallError, isNotExist, sigpipe, syscallMode, NewFile, newFile, epipecheck, IsPathSeparator, basename, init$1, Lstat, fillFileStatFromSys, timespecToTime, lstatNolog; - errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - poll = $packages["internal/poll"]; - unix = $packages["internal/syscall/unix"]; - testlog = $packages["internal/testlog"]; - io = $packages["io"]; - runtime = $packages["runtime"]; + reflectlite = $packages["internal/reflectlite"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; - syscall = $packages["syscall"]; time = $packages["time"]; - timeout = $pkg.timeout = $newType(8, $kindInterface, "os.timeout", true, "os", false, null); - PathError = $pkg.PathError = $newType(0, $kindStruct, "os.PathError", true, "os", true, function(Op_, Path_, Err_) { + Context = $pkg.Context = $newType(8, $kindInterface, "context.Context", true, "context", true, null); + deadlineExceededError = $pkg.deadlineExceededError = $newType(0, $kindStruct, "context.deadlineExceededError", true, "context", false, function() { this.$val = this; if (arguments.length === 0) { - this.Op = ""; - this.Path = ""; - this.Err = $ifaceNil; return; } - this.Op = Op_; - this.Path = Path_; - this.Err = Err_; }); - SyscallError = $pkg.SyscallError = $newType(0, $kindStruct, "os.SyscallError", true, "os", true, function(Syscall_, Err_) { + emptyCtx = $pkg.emptyCtx = $newType(4, $kindInt, "context.emptyCtx", true, "context", false, null); + CancelFunc = $pkg.CancelFunc = $newType(4, $kindFunc, "context.CancelFunc", true, "context", true, null); + canceler = $pkg.canceler = $newType(8, $kindInterface, "context.canceler", true, "context", false, null); + cancelCtx = $pkg.cancelCtx = $newType(0, $kindStruct, "context.cancelCtx", true, "context", false, function(Context_, mu_, done_, children_, err_) { this.$val = this; if (arguments.length === 0) { - this.Syscall = ""; - this.Err = $ifaceNil; + this.Context = $ifaceNil; + this.mu = new sync.Mutex.ptr(0, 0); + this.done = new atomic.Value.ptr($ifaceNil); + this.children = false; + this.err = $ifaceNil; return; } - this.Syscall = Syscall_; - this.Err = Err_; + this.Context = Context_; + this.mu = mu_; + this.done = done_; + this.children = children_; + this.err = err_; }); - LinkError = $pkg.LinkError = $newType(0, $kindStruct, "os.LinkError", true, "os", true, function(Op_, Old_, New_, Err_) { + stringer = $pkg.stringer = $newType(8, $kindInterface, "context.stringer", true, "context", false, null); + timerCtx = $pkg.timerCtx = $newType(0, $kindStruct, "context.timerCtx", true, "context", false, function(cancelCtx_, timer_, deadline_) { this.$val = this; if (arguments.length === 0) { - this.Op = ""; - this.Old = ""; - this.New = ""; - this.Err = $ifaceNil; + this.cancelCtx = new cancelCtx.ptr($ifaceNil, new sync.Mutex.ptr(0, 0), new atomic.Value.ptr($ifaceNil), false, $ifaceNil); + this.timer = ptrType$5.nil; + this.deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); return; } - this.Op = Op_; - this.Old = Old_; - this.New = New_; - this.Err = Err_; + this.cancelCtx = cancelCtx_; + this.timer = timer_; + this.deadline = deadline_; }); - file = $pkg.file = $newType(0, $kindStruct, "os.file", true, "os", false, function(pfd_, name_, dirinfo_, nonblock_, stdoutOrErr_) { + valueCtx = $pkg.valueCtx = $newType(0, $kindStruct, "context.valueCtx", true, "context", false, function(Context_, key_, val_) { this.$val = this; if (arguments.length === 0) { - this.pfd = new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), 0, new poll.pollDesc.ptr(false), ptrType$12.nil, 0, 0, false, false, false); - this.name = ""; - this.dirinfo = ptrType$1.nil; - this.nonblock = false; - this.stdoutOrErr = false; + this.Context = $ifaceNil; + this.key = $ifaceNil; + this.val = $ifaceNil; return; } - this.pfd = pfd_; - this.name = name_; - this.dirinfo = dirinfo_; - this.nonblock = nonblock_; - this.stdoutOrErr = stdoutOrErr_; + this.Context = Context_; + this.key = key_; + this.val = val_; }); - dirInfo = $pkg.dirInfo = $newType(0, $kindStruct, "os.dirInfo", true, "os", false, function(buf_, nbuf_, bufp_) { - this.$val = this; - if (arguments.length === 0) { - this.buf = sliceType$2.nil; - this.nbuf = 0; - this.bufp = 0; - return; - } - this.buf = buf_; - this.nbuf = nbuf_; - this.bufp = bufp_; - }); - File = $pkg.File = $newType(0, $kindStruct, "os.File", true, "os", true, function(file_) { - this.$val = this; - if (arguments.length === 0) { - this.file = ptrType$13.nil; - return; - } - this.file = file_; - }); - FileInfo = $pkg.FileInfo = $newType(8, $kindInterface, "os.FileInfo", true, "os", true, null); - FileMode = $pkg.FileMode = $newType(4, $kindUint32, "os.FileMode", true, "os", true, null); - fileStat = $pkg.fileStat = $newType(0, $kindStruct, "os.fileStat", true, "os", false, function(name_, size_, mode_, modTime_, sys_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ""; - this.size = new $Int64(0, 0); - this.mode = 0; - this.modTime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$15.nil); - this.sys = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero()); - return; - } - this.name = name_; - this.size = size_; - this.mode = mode_; - this.modTime = modTime_; - this.sys = sys_; - }); - sliceType = $sliceType($String); - ptrType = $ptrType(File); - sliceType$1 = $sliceType(FileInfo); - ptrType$1 = $ptrType(dirInfo); - sliceType$2 = $sliceType($Uint8); - ptrType$2 = $ptrType(PathError); - ptrType$3 = $ptrType(LinkError); - ptrType$4 = $ptrType(SyscallError); - sliceType$5 = $sliceType(syscall.Iovec); - ptrType$12 = $ptrType(sliceType$5); - arrayType$1 = $arrayType($Int64, 3); - ptrType$13 = $ptrType(file); - funcType$1 = $funcType([ptrType$13], [$error], false); - ptrType$15 = $ptrType(time.Location); - arrayType$6 = $arrayType($Uint8, 32); - ptrType$16 = $ptrType(fileStat); - runtime_args = function() { - return $pkg.Args; + ptrType = $ptrType(emptyCtx); + structType = $structType("", []); + ptrType$1 = $ptrType(time.Location); + ptrType$2 = $ptrType($Int32); + ptrType$3 = $ptrType(cancelCtx); + ptrType$4 = $ptrType($Int); + chanType = $chanType(structType, false, false); + ptrType$5 = $ptrType(time.Timer); + ptrType$6 = $ptrType(valueCtx); + ptrType$7 = $ptrType(timerCtx); + chanType$1 = $chanType(structType, false, true); + mapType = $mapType(canceler, structType); + deadlineExceededError.ptr.prototype.Error = function() { + return "context deadline exceeded"; }; - init = function() { - var argv, i, process; - process = $global.process; - if (!(process === undefined)) { - argv = process.argv; - $pkg.Args = $makeSlice(sliceType, ($parseInt(argv.length) - 1 >> 0)); - i = 0; - while (true) { - if (!(i < ($parseInt(argv.length) - 1 >> 0))) { break; } - ((i < 0 || i >= $pkg.Args.$length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.Args.$array[$pkg.Args.$offset + i] = $internalize(argv[(i + 1 >> 0)], $String)); - i = i + (1) >> 0; - } - } - if ($pkg.Args.$length === 0) { - $pkg.Args = new sliceType(["?"]); - } + deadlineExceededError.prototype.Error = function() { return this.$val.Error(); }; + deadlineExceededError.ptr.prototype.Timeout = function() { + return true; }; - File.ptr.prototype.Readdir = function(n) { - var _r, f, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - if (f === ptrType.nil) { - $s = -1; return [sliceType$1.nil, $pkg.ErrInvalid]; - } - _r = f.readdir(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdir }; } $f._r = _r; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; + deadlineExceededError.prototype.Timeout = function() { return this.$val.Timeout(); }; + deadlineExceededError.ptr.prototype.Temporary = function() { + return true; }; - File.prototype.Readdir = function(n) { return this.$val.Readdir(n); }; - File.ptr.prototype.Readdirnames = function(n) { - var _r, _tmp, _tmp$1, _tuple, err, f, n, names, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; f = $f.f; n = $f.n; names = $f.names; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - names = sliceType.nil; - err = $ifaceNil; - f = this; - if (f === ptrType.nil) { - _tmp = sliceType.nil; - _tmp$1 = $pkg.ErrInvalid; - names = _tmp; - err = _tmp$1; - $s = -1; return [names, err]; - } - _r = f.readdirnames(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - names = _tuple[0]; - err = _tuple[1]; - $s = -1; return [names, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdirnames }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.n = n; $f.names = names; $f.$s = $s; $f.$r = $r; return $f; + deadlineExceededError.prototype.Temporary = function() { return this.$val.Temporary(); }; + $ptrType(emptyCtx).prototype.Deadline = function() { + var deadline, ok; + deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); + ok = false; + return [deadline, ok]; }; - File.prototype.Readdirnames = function(n) { return this.$val.Readdirnames(n); }; - File.ptr.prototype.readdir = function(n) { - var _i, _r, _r$1, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, dirname, err, f, fi, filename, fip, lerr, n, names, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dirname = $f.dirname; err = $f.err; f = $f.f; fi = $f.fi; filename = $f.filename; fip = $f.fip; lerr = $f.lerr; n = $f.n; names = $f.names; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fi = sliceType$1.nil; - err = $ifaceNil; - f = this; - dirname = f.file.name; - if (dirname === "") { - dirname = "."; - } - _r = f.Readdirnames(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - names = _tuple[0]; - err = _tuple[1]; - fi = $makeSlice(sliceType$1, 0, names.$length); - _ref = names; - _i = 0; - /* while (true) { */ case 2: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } - filename = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - _r$1 = lstat(dirname + "/" + filename); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - fip = _tuple$1[0]; - lerr = _tuple$1[1]; - if (IsNotExist(lerr)) { - _i++; - /* continue; */ $s = 2; continue; - } - if (!($interfaceIsEqual(lerr, $ifaceNil))) { - _tmp = fi; - _tmp$1 = lerr; - fi = _tmp; - err = _tmp$1; - $s = -1; return [fi, err]; - } - fi = $append(fi, fip); - _i++; - /* } */ $s = 2; continue; case 3: - if ((fi.$length === 0) && $interfaceIsEqual(err, $ifaceNil) && n > 0) { - err = io.EOF; - } - _tmp$2 = fi; - _tmp$3 = err; - fi = _tmp$2; - err = _tmp$3; - $s = -1; return [fi, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readdir }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dirname = dirname; $f.err = err; $f.f = f; $f.fi = fi; $f.filename = filename; $f.fip = fip; $f.lerr = lerr; $f.n = n; $f.names = names; $f.$s = $s; $f.$r = $r; return $f; + $ptrType(emptyCtx).prototype.Done = function() { + return $chanNil; }; - File.prototype.readdir = function(n) { return this.$val.readdir(n); }; - File.ptr.prototype.readdirnames = function(n) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, d, err, errno, f, n, names, nb, nc, size, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; d = $f.d; err = $f.err; errno = $f.errno; f = $f.f; n = $f.n; names = $f.names; nb = $f.nb; nc = $f.nc; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - names = sliceType.nil; - err = $ifaceNil; - f = this; - if (f.file.dirinfo === ptrType$1.nil) { - f.file.dirinfo = new dirInfo.ptr(sliceType$2.nil, 0, 0); - f.file.dirinfo.buf = $makeSlice(sliceType$2, 8192); - } - d = f.file.dirinfo; - size = n; - if (size <= 0) { - size = 100; - n = -1; - } - names = $makeSlice(sliceType, 0, size); - /* while (true) { */ case 1: - /* if (!(!((n === 0)))) { break; } */ if(!(!((n === 0)))) { $s = 2; continue; } - /* */ if (d.bufp >= d.nbuf) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (d.bufp >= d.nbuf) { */ case 3: - d.bufp = 0; - errno = $ifaceNil; - _r = f.file.pfd.ReadDirent(d.buf); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - d.nbuf = _tuple[0]; - errno = _tuple[1]; - runtime.KeepAlive(f); - if (!($interfaceIsEqual(errno, $ifaceNil))) { - _tmp = names; - _tmp$1 = wrapSyscallError("readdirent", errno); - names = _tmp; - err = _tmp$1; - $s = -1; return [names, err]; - } - if (d.nbuf <= 0) { - /* break; */ $s = 2; continue; - } - /* } */ case 4: - _tmp$2 = 0; - _tmp$3 = 0; - nb = _tmp$2; - nc = _tmp$3; - _tuple$1 = syscall.ParseDirent($subslice(d.buf, d.bufp, d.nbuf), n, names); - nb = _tuple$1[0]; - nc = _tuple$1[1]; - names = _tuple$1[2]; - d.bufp = d.bufp + (nb) >> 0; - n = n - (nc) >> 0; - /* } */ $s = 1; continue; case 2: - if (n >= 0 && (names.$length === 0)) { - _tmp$4 = names; - _tmp$5 = io.EOF; - names = _tmp$4; - err = _tmp$5; - $s = -1; return [names, err]; - } - _tmp$6 = names; - _tmp$7 = $ifaceNil; - names = _tmp$6; - err = _tmp$7; - $s = -1; return [names, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readdirnames }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.d = d; $f.err = err; $f.errno = errno; $f.f = f; $f.n = n; $f.names = names; $f.nb = nb; $f.nc = nc; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.readdirnames = function(n) { return this.$val.readdirnames(n); }; - PathError.ptr.prototype.Error = function() { - var _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return e.Op + " " + e.Path + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - PathError.prototype.Error = function() { return this.$val.Error(); }; - PathError.ptr.prototype.Timeout = function() { - var _r, _tuple, _v, e, ok, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _tuple = $assertType(e.Err, timeout, true); - t = _tuple[0]; - ok = _tuple[1]; - if (!(ok)) { _v = false; $s = 1; continue s; } - _r = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r; case 1: - $s = -1; return _v; - /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Timeout }; } $f._r = _r; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - PathError.prototype.Timeout = function() { return this.$val.Timeout(); }; - SyscallError.ptr.prototype.Error = function() { - var _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return e.Syscall + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - SyscallError.prototype.Error = function() { return this.$val.Error(); }; - SyscallError.ptr.prototype.Timeout = function() { - var _r, _tuple, _v, e, ok, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _tuple = $assertType(e.Err, timeout, true); - t = _tuple[0]; - ok = _tuple[1]; - if (!(ok)) { _v = false; $s = 1; continue s; } - _r = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r; case 1: - $s = -1; return _v; - /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Timeout }; } $f._r = _r; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - SyscallError.prototype.Timeout = function() { return this.$val.Timeout(); }; - NewSyscallError = function(syscall$1, err) { - var err, syscall$1; - if ($interfaceIsEqual(err, $ifaceNil)) { - return $ifaceNil; - } - return new SyscallError.ptr(syscall$1, err); - }; - $pkg.NewSyscallError = NewSyscallError; - IsNotExist = function(err) { - var err; - return isNotExist(err); - }; - $pkg.IsNotExist = IsNotExist; - underlyingError = function(err) { - var _ref, err, err$1, err$2, err$3; - _ref = err; - if ($assertType(_ref, ptrType$2, true)[1]) { - err$1 = _ref.$val; - return err$1.Err; - } else if ($assertType(_ref, ptrType$3, true)[1]) { - err$2 = _ref.$val; - return err$2.Err; - } else if ($assertType(_ref, ptrType$4, true)[1]) { - err$3 = _ref.$val; - return err$3.Err; - } - return err; - }; - wrapSyscallError = function(name, err) { - var _tuple, err, name, ok; - _tuple = $assertType(err, syscall.Errno, true); - ok = _tuple[1]; - if (ok) { - err = NewSyscallError(name, err); - } - return err; - }; - isNotExist = function(err) { - var err; - err = underlyingError(err); - return $interfaceIsEqual(err, new syscall.Errno(2)) || $interfaceIsEqual(err, $pkg.ErrNotExist); - }; - File.ptr.prototype.Name = function() { - var f; - f = this; - return f.file.name; - }; - File.prototype.Name = function() { return this.$val.Name(); }; - LinkError.ptr.prototype.Error = function() { - var _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return e.Op + " " + e.Old + " " + e.New + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: LinkError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - LinkError.prototype.Error = function() { return this.$val.Error(); }; - File.ptr.prototype.Read = function(b) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - err$1 = f.checkValid("read"); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - _tmp = 0; - _tmp$1 = err$1; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - } - _r = f.read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - e = _tuple[1]; - _tmp$2 = n; - _tmp$3 = f.wrapErr("read", e); - n = _tmp$2; - err = _tmp$3; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Read = function(b) { return this.$val.Read(b); }; - File.ptr.prototype.ReadAt = function(b, off) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; m = $f.m; n = $f.n; off = $f.off; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - err$1 = f.checkValid("read"); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - _tmp = 0; - _tmp$1 = err$1; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - } - if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { - _tmp$2 = 0; - _tmp$3 = new PathError.ptr("readat", f.file.name, errors.New("negative offset")); - n = _tmp$2; - err = _tmp$3; - $s = -1; return [n, err]; - } - /* while (true) { */ case 1: - /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } - _r = f.pread(b, off); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - m = _tuple[0]; - e = _tuple[1]; - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = f.wrapErr("read", e); - /* break; */ $s = 2; continue; - } - n = n + (m) >> 0; - b = $subslice(b, m); - off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); - /* } */ $s = 1; continue; case 2: - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.ReadAt }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.m = m; $f.n = n; $f.off = off; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; - File.ptr.prototype.Write = function(b) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - err$1 = f.checkValid("write"); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - _tmp = 0; - _tmp$1 = err$1; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - } - _r = f.write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - e = _tuple[1]; - if (n < 0) { - n = 0; - } - if (!((n === b.$length))) { - err = io.ErrShortWrite; - } - epipecheck(f, e); - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = f.wrapErr("write", e); - } - _tmp$2 = n; - _tmp$3 = err; - n = _tmp$2; - err = _tmp$3; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Write }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Write = function(b) { return this.$val.Write(b); }; - File.ptr.prototype.WriteAt = function(b, off) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; m = $f.m; n = $f.n; off = $f.off; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - err$1 = f.checkValid("write"); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - _tmp = 0; - _tmp$1 = err$1; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - } - if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { - _tmp$2 = 0; - _tmp$3 = new PathError.ptr("writeat", f.file.name, errors.New("negative offset")); - n = _tmp$2; - err = _tmp$3; - $s = -1; return [n, err]; - } - /* while (true) { */ case 1: - /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } - _r = f.pwrite(b, off); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - m = _tuple[0]; - e = _tuple[1]; - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = f.wrapErr("write", e); - /* break; */ $s = 2; continue; - } - n = n + (m) >> 0; - b = $subslice(b, m); - off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); - /* } */ $s = 1; continue; case 2: - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.WriteAt }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.m = m; $f.n = n; $f.off = off; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.WriteAt = function(b, off) { return this.$val.WriteAt(b, off); }; - File.ptr.prototype.Seek = function(offset, whence) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, err, err$1, f, offset, r, ret, whence, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; offset = $f.offset; r = $f.r; ret = $f.ret; whence = $f.whence; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - ret = new $Int64(0, 0); - err = $ifaceNil; - f = this; - err$1 = f.checkValid("seek"); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - _tmp = new $Int64(0, 0); - _tmp$1 = err$1; - ret = _tmp; - err = _tmp$1; - $s = -1; return [ret, err]; - } - _r = f.seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - r = _tuple[0]; - e = _tuple[1]; - if ($interfaceIsEqual(e, $ifaceNil) && !(f.file.dirinfo === ptrType$1.nil) && !((r.$high === 0 && r.$low === 0))) { - e = new syscall.Errno(21); - } - if (!($interfaceIsEqual(e, $ifaceNil))) { - _tmp$2 = new $Int64(0, 0); - _tmp$3 = f.wrapErr("seek", e); - ret = _tmp$2; - err = _tmp$3; - $s = -1; return [ret, err]; - } - _tmp$4 = r; - _tmp$5 = $ifaceNil; - ret = _tmp$4; - err = _tmp$5; - $s = -1; return [ret, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Seek }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.offset = offset; $f.r = r; $f.ret = ret; $f.whence = whence; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; - File.ptr.prototype.WriteString = function(s) { - var _r, _tuple, err, f, n, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; f = $f.f; n = $f.n; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - _r = f.Write((new sliceType$2($stringToBytes(s)))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - err = _tuple[1]; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.WriteString }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.n = n; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; - File.ptr.prototype.wrapErr = function(op, err) { - var err, f, op; - f = this; - if ($interfaceIsEqual(err, $ifaceNil) || $interfaceIsEqual(err, io.EOF)) { - return err; - } - if ($interfaceIsEqual(err, poll.ErrFileClosing)) { - err = $pkg.ErrClosed; - } - return new PathError.ptr(op, f.file.name, err); - }; - File.prototype.wrapErr = function(op, err) { return this.$val.wrapErr(op, err); }; - File.ptr.prototype.Chmod = function(mode) { - var _r, f, mode, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; mode = $f.mode; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - _r = f.chmod(mode); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chmod }; } $f._r = _r; $f.f = f; $f.mode = mode; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Chmod = function(mode) { return this.$val.Chmod(mode); }; - File.ptr.prototype.SetDeadline = function(t) { - var f, t; - f = this; - return f.setDeadline($clone(t, time.Time)); - }; - File.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; - File.ptr.prototype.SetReadDeadline = function(t) { - var f, t; - f = this; - return f.setReadDeadline($clone(t, time.Time)); - }; - File.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; - File.ptr.prototype.SetWriteDeadline = function(t) { - var f, t; - f = this; - return f.setWriteDeadline($clone(t, time.Time)); - }; - File.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; - sigpipe = function() { - $throwRuntimeError("native function not implemented: os.sigpipe"); - }; - syscallMode = function(i) { - var i, o; - o = 0; - o = (o | (((new FileMode(i).Perm() >>> 0)))) >>> 0; - if (!((((i & 8388608) >>> 0) === 0))) { - o = (o | (2048)) >>> 0; - } - if (!((((i & 4194304) >>> 0) === 0))) { - o = (o | (1024)) >>> 0; - } - if (!((((i & 1048576) >>> 0) === 0))) { - o = (o | (512)) >>> 0; - } - return o; - }; - File.ptr.prototype.chmod = function(mode) { - var _r, e, err, f, mode, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; mode = $f.mode; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - err = f.checkValid("chmod"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - _r = f.file.pfd.Fchmod(syscallMode(mode)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - e = _r; - if (!($interfaceIsEqual(e, $ifaceNil))) { - $s = -1; return f.wrapErr("chmod", e); - } - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.chmod }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.mode = mode; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.chmod = function(mode) { return this.$val.chmod(mode); }; - File.ptr.prototype.Chown = function(uid, gid) { - var _r, e, err, f, gid, uid, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; gid = $f.gid; uid = $f.uid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - err = f.checkValid("chown"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - _r = f.file.pfd.Fchown(uid, gid); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - e = _r; - if (!($interfaceIsEqual(e, $ifaceNil))) { - $s = -1; return f.wrapErr("chown", e); - } - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chown }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.gid = gid; $f.uid = uid; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Chown = function(uid, gid) { return this.$val.Chown(uid, gid); }; - File.ptr.prototype.Truncate = function(size) { - var _r, e, err, f, size, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - err = f.checkValid("truncate"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - _r = f.file.pfd.Ftruncate(size); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - e = _r; - if (!($interfaceIsEqual(e, $ifaceNil))) { - $s = -1; return f.wrapErr("truncate", e); - } - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Truncate }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Truncate = function(size) { return this.$val.Truncate(size); }; - File.ptr.prototype.Sync = function() { - var _r, e, err, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - err = f.checkValid("sync"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - _r = f.file.pfd.Fsync(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - e = _r; - if (!($interfaceIsEqual(e, $ifaceNil))) { - $s = -1; return f.wrapErr("sync", e); - } - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Sync }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Sync = function() { return this.$val.Sync(); }; - File.ptr.prototype.Chdir = function() { - var _r, e, err, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - err = f.checkValid("chdir"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return err; - } - _r = f.file.pfd.Fchdir(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - e = _r; - if (!($interfaceIsEqual(e, $ifaceNil))) { - $s = -1; return f.wrapErr("chdir", e); - } - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chdir }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Chdir = function() { return this.$val.Chdir(); }; - File.ptr.prototype.setDeadline = function(t) { - var err, f, t; - f = this; - err = f.checkValid("SetDeadline"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - return err; - } - return f.file.pfd.SetDeadline($clone(t, time.Time)); - }; - File.prototype.setDeadline = function(t) { return this.$val.setDeadline(t); }; - File.ptr.prototype.setReadDeadline = function(t) { - var err, f, t; - f = this; - err = f.checkValid("SetReadDeadline"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - return err; - } - return f.file.pfd.SetReadDeadline($clone(t, time.Time)); - }; - File.prototype.setReadDeadline = function(t) { return this.$val.setReadDeadline(t); }; - File.ptr.prototype.setWriteDeadline = function(t) { - var err, f, t; - f = this; - err = f.checkValid("SetWriteDeadline"); - if (!($interfaceIsEqual(err, $ifaceNil))) { - return err; - } - return f.file.pfd.SetWriteDeadline($clone(t, time.Time)); - }; - File.prototype.setWriteDeadline = function(t) { return this.$val.setWriteDeadline(t); }; - File.ptr.prototype.checkValid = function(op) { - var f, op; - f = this; - if (f === ptrType.nil) { - return $pkg.ErrInvalid; - } + $ptrType(emptyCtx).prototype.Err = function() { return $ifaceNil; }; - File.prototype.checkValid = function(op) { return this.$val.checkValid(op); }; - File.ptr.prototype.Fd = function() { - var _r, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - if (f === ptrType.nil) { - $s = -1; return 4294967295; + $ptrType(emptyCtx).prototype.Value = function(key) { + var key; + return $ifaceNil; + }; + $ptrType(emptyCtx).prototype.String = function() { + var _1, e; + e = this; + _1 = e; + if (_1 === (background)) { + return "context.Background"; + } else if (_1 === (todo)) { + return "context.TODO"; } - /* */ if (f.file.nonblock) { $s = 1; continue; } + return "unknown empty Context"; + }; + Background = function() { + return background; + }; + $pkg.Background = Background; + WithCancel = function(parent) { + var {_tmp, _tmp$1, c, cancel, ctx, parent, $s, $r, $c} = $restore(this, {parent}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = [c]; + ctx = $ifaceNil; + cancel = $throwNilPointerError; + if ($interfaceIsEqual(parent, $ifaceNil)) { + $panic(new $String("cannot create context from nil parent")); + } + c[0] = $clone(newCancelCtx(parent), cancelCtx); + $r = propagateCancel(parent, c[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _tmp = c[0]; + _tmp$1 = (function(c) { return function $b() { + var {$s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $s};return $f; + }; })(c); + ctx = _tmp; + cancel = _tmp$1; + $s = -1; return [ctx, cancel]; + /* */ } return; } var $f = {$blk: WithCancel, $c: true, $r, _tmp, _tmp$1, c, cancel, ctx, parent, $s};return $f; + }; + $pkg.WithCancel = WithCancel; + newCancelCtx = function(parent) { + var parent; + return new cancelCtx.ptr(parent, new sync.Mutex.ptr(0, 0), new atomic.Value.ptr($ifaceNil), false, $ifaceNil); + }; + propagateCancel = function(parent, child) { + var {_arg, _key, _r, _r$1, _r$2, _selection, _tuple, child, done, ok, p, parent, $s, $r, $c} = $restore(this, {parent, child}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + child = [child]; + parent = [parent]; + _r = parent[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + done = _r; + if (done === $chanNil) { + $s = -1; return; + } + _selection = $select([[done], []]); + /* */ if (_selection[0] === 0) { $s = 2; continue; } + /* */ if (_selection[0] === 1) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (_selection[0] === 0) { */ case 2: + _r$1 = parent[0].Err(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _arg = _r$1; + $r = child[0].cancel(false, _arg); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* } else if (_selection[0] === 1) { */ case 3: + /* } */ case 4: + _r$2 = parentCancelCtx(parent[0]); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; + p = _tuple[0]; + ok = _tuple[1]; + /* */ if (ok) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (ok) { */ case 8: + $r = p.mu.Lock(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ if (!($interfaceIsEqual(p.err, $ifaceNil))) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if (!($interfaceIsEqual(p.err, $ifaceNil))) { */ case 12: + $r = child[0].cancel(false, p.err); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 14; continue; + /* } else { */ case 13: + if (p.children === false) { + p.children = new $global.Map(); + } + _key = child[0]; (p.children || $throwRuntimeError("assignment to entry in nil map")).set(canceler.keyFor(_key), { k: _key, v: new structType.ptr() }); + /* } */ case 14: + $r = p.mu.Unlock(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 10; continue; + /* } else { */ case 9: + atomic.AddInt32((goroutines$24ptr || (goroutines$24ptr = new ptrType$2(function() { return goroutines; }, function($v) { goroutines = $v; }))), 1); + $go((function(child, parent) { return function $b() { + var {_arg$1, _r$3, _r$4, _r$5, _r$6, _selection$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$3 = parent[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$4 = child[0].Done(); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$5 = $select([[_r$3], [_r$4]]); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _selection$1 = _r$5; + /* */ if (_selection$1[0] === 0) { $s = 4; continue; } + /* */ if (_selection$1[0] === 1) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_selection$1[0] === 0) { */ case 4: + _r$6 = parent[0].Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _arg$1 = _r$6; + $r = child[0].cancel(false, _arg$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 6; continue; + /* } else if (_selection$1[0] === 1) { */ case 5: + /* } */ case 6: + $s = -1; return; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, _arg$1, _r$3, _r$4, _r$5, _r$6, _selection$1, $s};return $f; + }; })(child, parent), []); + /* } */ case 10: + $s = -1; return; + /* */ } return; } var $f = {$blk: propagateCancel, $c: true, $r, _arg, _key, _r, _r$1, _r$2, _selection, _tuple, child, done, ok, p, parent, $s};return $f; + }; + parentCancelCtx = function(parent) { + var {_r, _r$1, _tuple, _tuple$1, done, ok, p, parent, pdone, $s, $r, $c} = $restore(this, {parent}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = parent.Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + done = _r; + if (done === closedchan || done === $chanNil) { + $s = -1; return [ptrType$3.nil, false]; + } + _r$1 = parent.Value((cancelCtxKey$24ptr || (cancelCtxKey$24ptr = new ptrType$4(function() { return cancelCtxKey; }, function($v) { cancelCtxKey = $v; })))); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = $assertType(_r$1, ptrType$3, true); + p = _tuple[0]; + ok = _tuple[1]; + if (!ok) { + $s = -1; return [ptrType$3.nil, false]; + } + _tuple$1 = $assertType(p.done.Load(), chanType, true); + pdone = _tuple$1[0]; + if (!(pdone === done)) { + $s = -1; return [ptrType$3.nil, false]; + } + $s = -1; return [p, true]; + /* */ } return; } var $f = {$blk: parentCancelCtx, $c: true, $r, _r, _r$1, _tuple, _tuple$1, done, ok, p, parent, pdone, $s};return $f; + }; + removeChild = function(parent, child) { + var {_r, _tuple, child, ok, p, parent, $s, $r, $c} = $restore(this, {parent, child}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = parentCancelCtx(parent); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + p = _tuple[0]; + ok = _tuple[1]; + if (!ok) { + $s = -1; return; + } + $r = p.mu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (!(p.children === false)) { + $mapDelete(p.children, canceler.keyFor(child)); + } + $r = p.mu.Unlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: removeChild, $c: true, $r, _r, _tuple, child, ok, p, parent, $s};return $f; + }; + init = function() { + $close(closedchan); + }; + cancelCtx.ptr.prototype.Value = function(key) { + var {$24r, _r, c, key, $s, $r, $c} = $restore(this, {key}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + if ($interfaceIsEqual(key, (cancelCtxKey$24ptr || (cancelCtxKey$24ptr = new ptrType$4(function() { return cancelCtxKey; }, function($v) { cancelCtxKey = $v; }))))) { + $s = -1; return c; + } + _r = value(c.Context, key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cancelCtx.ptr.prototype.Value, $c: true, $r, $24r, _r, c, key, $s};return $f; + }; + cancelCtx.prototype.Value = function(key) { return this.$val.Value(key); }; + cancelCtx.ptr.prototype.Done = function() { + var {$24r, $24r$1, c, d, $s, $deferred, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + c = this; + d = c.done.Load(); + /* */ if (!($interfaceIsEqual(d, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; - /* if (f.file.nonblock) { */ case 1: - _r = f.file.pfd.SetBlocking(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; + /* if (!($interfaceIsEqual(d, $ifaceNil))) { */ case 1: + $24r = $assertType(d, chanType); + $s = 3; case 3: return $24r; /* } */ case 2: - $s = -1; return ((f.file.pfd.Sysfd >>> 0)); - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Fd }; } $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; + $r = c.mu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $deferred.push([$methodVal(c.mu, "Unlock"), []]); + d = c.done.Load(); + if ($interfaceIsEqual(d, $ifaceNil)) { + d = new chanType(new $Chan(structType, 0)); + c.done.Store(d); + } + $24r$1 = $assertType(d, chanType); + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $chanNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: cancelCtx.ptr.prototype.Done, $c: true, $r, $24r, $24r$1, c, d, $s, $deferred};return $f; } } }; - File.prototype.Fd = function() { return this.$val.Fd(); }; - NewFile = function(fd, name) { - var _tuple, err, fd, kind, name, nb; - kind = 0; - _tuple = unix.IsNonblock(((fd >> 0))); - nb = _tuple[0]; - err = _tuple[1]; - if ($interfaceIsEqual(err, $ifaceNil) && nb) { - kind = 3; - } - return newFile(fd, name, kind); - }; - $pkg.NewFile = NewFile; - newFile = function(fd, name, kind) { - var err, err$1, err$2, f, fd, fdi, kind, name, pollable, st; - fdi = ((fd >> 0)); - if (fdi < 0) { - return ptrType.nil; - } - f = new File.ptr(new file.ptr(new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), fdi, new poll.pollDesc.ptr(false), ptrType$12.nil, 0, 0, true, true, false), name, ptrType$1.nil, false, (fdi === 1) || (fdi === 2))); - pollable = (kind === 1) || (kind === 2) || (kind === 3); - if (false && (kind === 1)) { - pollable = false; - } - if (false && (kind === 1)) { - st = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero()); - err = syscall.Fstat(fdi, st); - if ($interfaceIsEqual(err, $ifaceNil) && (((st.Mode & 61440) >>> 0) === 4096)) { - pollable = false; - } - } - err$1 = f.file.pfd.Init("file", pollable); - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - } else if (pollable) { - err$2 = syscall.SetNonblock(fdi, true); - if ($interfaceIsEqual(err$2, $ifaceNil)) { - f.file.nonblock = true; - } - } - runtime.SetFinalizer(f.file, new funcType$1($methodExpr(ptrType$13, "close"))); - return f; - }; - epipecheck = function(file$1, e) { - var e, file$1; - if ($interfaceIsEqual(e, new syscall.Errno(32)) && file$1.file.stdoutOrErr) { - sigpipe(); - } - }; - File.ptr.prototype.Close = function() { - var _r, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - if (f === ptrType.nil) { - $s = -1; return $pkg.ErrInvalid; - } - _r = f.file.close(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Close }; } $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Close = function() { return this.$val.Close(); }; - file.ptr.prototype.close = function() { - var _r, e, err, file$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; file$1 = $f.file$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - file$1 = this; - if (file$1 === ptrType$13.nil) { - $s = -1; return new syscall.Errno(22); - } - err = $ifaceNil; - _r = file$1.pfd.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - e = _r; - if (!($interfaceIsEqual(e, $ifaceNil))) { - if ($interfaceIsEqual(e, poll.ErrFileClosing)) { - e = $pkg.ErrClosed; - } - err = new PathError.ptr("close", file$1.name, e); - } - runtime.SetFinalizer(file$1, $ifaceNil); + cancelCtx.prototype.Done = function() { return this.$val.Done(); }; + cancelCtx.ptr.prototype.Err = function() { + var {c, err, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + err = c.err; + $r = c.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: file.ptr.prototype.close }; } $f._r = _r; $f.e = e; $f.err = err; $f.file$1 = file$1; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: cancelCtx.ptr.prototype.Err, $c: true, $r, c, err, $s};return $f; }; - file.prototype.close = function() { return this.$val.close(); }; - File.ptr.prototype.read = function(b) { - var _r, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - _r = f.file.pfd.Read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - err = _tuple[1]; - runtime.KeepAlive(f); - _tmp = n; - _tmp$1 = err; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; + cancelCtx.prototype.Err = function() { return this.$val.Err(); }; + contextName = function(c) { + var {$24r, $24r$1, _r, _r$1, _tuple, c, ok, s, $s, $r, $c} = $restore(this, {c}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _tuple = $assertType(c, stringer, true); + s = _tuple[0]; + ok = _tuple[1]; + /* */ if (ok) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (ok) { */ case 1: + _r = s.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 4; case 4: return $24r; + /* } */ case 2: + _r$1 = reflectlite.TypeOf(c).String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r$1 = _r$1; + $s = 6; case 6: return $24r$1; + /* */ } return; } var $f = {$blk: contextName, $c: true, $r, $24r, $24r$1, _r, _r$1, _tuple, c, ok, s, $s};return $f; }; - File.prototype.read = function(b) { return this.$val.read(b); }; - File.ptr.prototype.pread = function(b, off) { - var _r, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; off = $f.off; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - _r = f.file.pfd.Pread(b, off); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - err = _tuple[1]; - runtime.KeepAlive(f); - _tmp = n; - _tmp$1 = err; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.pread }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.off = off; $f.$s = $s; $f.$r = $r; return $f; + cancelCtx.ptr.prototype.String = function() { + var {$24r, _r, c, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + _r = contextName(c.Context); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r + ".WithCancel"; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cancelCtx.ptr.prototype.String, $c: true, $r, $24r, _r, c, $s};return $f; }; - File.prototype.pread = function(b, off) { return this.$val.pread(b, off); }; - File.ptr.prototype.write = function(b) { - var _r, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - _r = f.file.pfd.Write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - err = _tuple[1]; - runtime.KeepAlive(f); - _tmp = n; - _tmp$1 = err; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.write }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.write = function(b) { return this.$val.write(b); }; - File.ptr.prototype.pwrite = function(b, off) { - var _r, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; off = $f.off; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - f = this; - _r = f.file.pfd.Pwrite(b, off); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - err = _tuple[1]; - runtime.KeepAlive(f); - _tmp = n; - _tmp$1 = err; - n = _tmp; - err = _tmp$1; - $s = -1; return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.pwrite }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.off = off; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.pwrite = function(b, off) { return this.$val.pwrite(b, off); }; - File.ptr.prototype.seek = function(offset, whence) { - var _r, _tmp, _tmp$1, _tuple, err, f, offset, ret, whence, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; f = $f.f; offset = $f.offset; ret = $f.ret; whence = $f.whence; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - ret = new $Int64(0, 0); - err = $ifaceNil; - f = this; - _r = f.file.pfd.Seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - ret = _tuple[0]; - err = _tuple[1]; - runtime.KeepAlive(f); - _tmp = ret; - _tmp$1 = err; - ret = _tmp; - err = _tmp$1; - $s = -1; return [ret, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.seek }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.offset = offset; $f.ret = ret; $f.whence = whence; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.seek = function(offset, whence) { return this.$val.seek(offset, whence); }; - IsPathSeparator = function(c) { - var c; - return 47 === c; - }; - $pkg.IsPathSeparator = IsPathSeparator; - basename = function(name) { - var i, name; - i = name.length - 1 >> 0; - while (true) { - if (!(i > 0 && (name.charCodeAt(i) === 47))) { break; } - name = $substring(name, 0, i); - i = i - (1) >> 0; + cancelCtx.prototype.String = function() { return this.$val.String(); }; + cancelCtx.ptr.prototype.cancel = function(removeFromParent, err) { + var {_entry, _i, _key, _keys, _ref, _size, _tuple, c, child, d, err, removeFromParent, $s, $r, $c} = $restore(this, {removeFromParent, err}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + if ($interfaceIsEqual(err, $ifaceNil)) { + $panic(new $String("context: internal error: missing cancel error")); } - i = i - (1) >> 0; - while (true) { - if (!(i >= 0)) { break; } - if (name.charCodeAt(i) === 47) { - name = $substring(name, (i + 1 >> 0)); - break; - } - i = i - (1) >> 0; + $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ if (!($interfaceIsEqual(c.err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(c.err, $ifaceNil))) { */ case 2: + $r = c.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* } */ case 3: + c.err = err; + _tuple = $assertType(c.done.Load(), chanType, true); + d = _tuple[0]; + if (d === $chanNil) { + c.done.Store(new chanType(closedchan)); + } else { + $close(d); } - return name; - }; - init$1 = function() { - if (false) { - return; - } - $pkg.Args = runtime_args(); - }; - Lstat = function(name) { - var name, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = testlog.Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return lstatNolog(name); - /* */ } return; } if ($f === undefined) { $f = { $blk: Lstat }; } $f.name = name; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Lstat = Lstat; - fillFileStatFromSys = function(fs, name) { - var _1, fs, name; - fs.name = basename(name); - fs.size = fs.sys.Size; - time.Time.copy(fs.modTime, timespecToTime($clone(fs.sys.Mtim, syscall.Timespec))); - fs.mode = ((((fs.sys.Mode & 511) >>> 0) >>> 0)); - _1 = (fs.sys.Mode & 61440) >>> 0; - if (_1 === (24576)) { - fs.mode = (fs.mode | (67108864)) >>> 0; - } else if (_1 === (8192)) { - fs.mode = (fs.mode | (69206016)) >>> 0; - } else if (_1 === (16384)) { - fs.mode = (fs.mode | (2147483648)) >>> 0; - } else if (_1 === (4096)) { - fs.mode = (fs.mode | (33554432)) >>> 0; - } else if (_1 === (40960)) { - fs.mode = (fs.mode | (134217728)) >>> 0; - } else if (_1 === (32768)) { - } else if (_1 === (49152)) { - fs.mode = (fs.mode | (16777216)) >>> 0; - } - if (!((((fs.sys.Mode & 1024) >>> 0) === 0))) { - fs.mode = (fs.mode | (4194304)) >>> 0; - } - if (!((((fs.sys.Mode & 2048) >>> 0) === 0))) { - fs.mode = (fs.mode | (8388608)) >>> 0; - } - if (!((((fs.sys.Mode & 512) >>> 0) === 0))) { - fs.mode = (fs.mode | (1048576)) >>> 0; - } - }; - timespecToTime = function(ts) { - var ts; - return time.Unix((ts.Sec), (ts.Nsec)); - }; - File.ptr.prototype.Stat = function() { - var _r, err, f, fs, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; f = $f.f; fs = $f.fs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fs = [fs]; - f = this; - if (f === ptrType.nil) { - $s = -1; return [$ifaceNil, $pkg.ErrInvalid]; - } - fs[0] = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$15.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); - _r = f.file.pfd.Fstat(fs[0].sys); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $s = -1; return [$ifaceNil, new PathError.ptr("stat", f.file.name, err)]; - } - fillFileStatFromSys(fs[0], f.file.name); - $s = -1; return [fs[0], $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Stat }; } $f._r = _r; $f.err = err; $f.f = f; $f.fs = fs; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Stat = function() { return this.$val.Stat(); }; - lstatNolog = function(name) { - var err, fs, name; - fs = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$15.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); - err = syscall.Lstat(name, fs.sys); - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [$ifaceNil, new PathError.ptr("lstat", name, err)]; - } - fillFileStatFromSys(fs, name); - return [fs, $ifaceNil]; - }; - FileMode.prototype.String = function() { - var _i, _i$1, _ref, _ref$1, _rune, _rune$1, buf, c, c$1, i, i$1, m, w, y, y$1; - m = this.$val; - buf = arrayType$6.zero(); - w = 0; - _ref = "dalTLDpSugct?"; + _ref = c.children; _i = 0; - while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - i = _i; - c = _rune[0]; - if (!((((m & (((y = (((31 - i >> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0) === 0))) { - ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = ((c << 24 >>> 24))); - w = w + (1) >> 0; + _keys = _ref ? _ref.keys() : undefined; + _size = _ref ? _ref.size : 0; + /* while (true) { */ case 5: + /* if (!(_i < _size)) { break; } */ if(!(_i < _size)) { $s = 6; continue; } + _key = _keys.next().value; + _entry = _ref.get(_key); + if (_entry === undefined) { + _i++; + /* continue; */ $s = 5; continue; } - _i += _rune[1]; + child = _entry.k; + $r = child.cancel(false, err); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _i++; + $s = 5; continue; + case 6: + c.children = false; + $r = c.mu.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ if (removeFromParent) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (removeFromParent) { */ case 9: + $r = removeChild(c.Context, c); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 10: + $s = -1; return; + /* */ } return; } var $f = {$blk: cancelCtx.ptr.prototype.cancel, $c: true, $r, _entry, _i, _key, _keys, _ref, _size, _tuple, c, child, d, err, removeFromParent, $s};return $f; + }; + cancelCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; + WithDeadline = function(parent, d) { + var {$24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _tuple, c, cur, d, dur, ok, parent, $s, $deferred, $r, $c} = $restore(this, {parent, d}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + c = [c]; + if ($interfaceIsEqual(parent, $ifaceNil)) { + $panic(new $String("cannot create context from nil parent")); } - if (w === 0) { - ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); - w = w + (1) >> 0; + _r = parent.Deadline(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + cur = $clone(_tuple[0], time.Time); + ok = _tuple[1]; + /* */ if (ok && $clone(cur, time.Time).Before($clone(d, time.Time))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (ok && $clone(cur, time.Time).Before($clone(d, time.Time))) { */ case 2: + _r$1 = WithCancel(parent); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1; + $s = 5; case 5: return $24r; + /* } */ case 3: + c[0] = new timerCtx.ptr($clone(newCancelCtx(parent), cancelCtx), ptrType$5.nil, $clone(d, time.Time)); + $r = propagateCancel(parent, c[0]); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$2 = time.Until($clone(d, time.Time)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + dur = _r$2; + /* */ if ((dur.$high < 0 || (dur.$high === 0 && dur.$low <= 0))) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if ((dur.$high < 0 || (dur.$high === 0 && dur.$low <= 0))) { */ case 8: + $r = c[0].cancel(true, $pkg.DeadlineExceeded); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $24r$1 = [c[0], (function(c) { return function $b() { + var {$s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = c[0].cancel(false, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $s};return $f; + }; })(c)]; + $s = 11; case 11: return $24r$1; + /* } */ case 9: + $r = c[0].cancelCtx.mu.Lock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $deferred.push([$methodVal(c[0].cancelCtx.mu, "Unlock"), []]); + /* */ if ($interfaceIsEqual(c[0].cancelCtx.err, $ifaceNil)) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if ($interfaceIsEqual(c[0].cancelCtx.err, $ifaceNil)) { */ case 13: + _r$3 = time.AfterFunc(dur, (function(c) { return function $b() { + var {$s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = c[0].cancel(true, $pkg.DeadlineExceeded); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $s};return $f; + }; })(c)); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + c[0].timer = _r$3; + /* } */ case 14: + $24r$2 = [c[0], (function(c) { return function $b() { + var {$s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $s};return $f; + }; })(c)]; + $s = 16; case 16: return $24r$2; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $throwNilPointerError]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: WithDeadline, $c: true, $r, $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _tuple, c, cur, d, dur, ok, parent, $s, $deferred};return $f; } } + }; + $pkg.WithDeadline = WithDeadline; + timerCtx.ptr.prototype.Deadline = function() { + var _tmp, _tmp$1, c, deadline, ok; + deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); + ok = false; + c = this; + _tmp = $clone(c.deadline, time.Time); + _tmp$1 = true; + time.Time.copy(deadline, _tmp); + ok = _tmp$1; + return [deadline, ok]; + }; + timerCtx.prototype.Deadline = function() { return this.$val.Deadline(); }; + timerCtx.ptr.prototype.String = function() { + var {$24r, _r, _r$1, _r$2, _r$3, c, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + _r = contextName(c.cancelCtx.Context); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = $clone(c.deadline, time.Time).String(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = time.Until($clone(c.deadline, time.Time)); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = _r$2.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r + ".WithDeadline(" + _r$1 + " [" + _r$3 + "])"; + $s = 5; case 5: return $24r; + /* */ } return; } var $f = {$blk: timerCtx.ptr.prototype.String, $c: true, $r, $24r, _r, _r$1, _r$2, _r$3, c, $s};return $f; + }; + timerCtx.prototype.String = function() { return this.$val.String(); }; + timerCtx.ptr.prototype.cancel = function(removeFromParent, err) { + var {c, err, removeFromParent, $s, $r, $c} = $restore(this, {removeFromParent, err}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + $r = c.cancelCtx.cancel(false, err); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ if (removeFromParent) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (removeFromParent) { */ case 2: + $r = removeChild(c.cancelCtx.Context, c); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 3: + $r = c.cancelCtx.mu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (!(c.timer === ptrType$5.nil)) { + c.timer.Stop(); + c.timer = ptrType$5.nil; } - _ref$1 = "rwxrwxrwx"; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.length)) { break; } - _rune$1 = $decodeRune(_ref$1, _i$1); - i$1 = _i$1; - c$1 = _rune$1[0]; - if (!((((m & (((y$1 = (((8 - i$1 >> 0) >>> 0)), y$1 < 32 ? (1 << y$1) : 0) >>> 0))) >>> 0) === 0))) { - ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = ((c$1 << 24 >>> 24))); - } else { - ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); - } - w = w + (1) >> 0; - _i$1 += _rune$1[1]; + $r = c.cancelCtx.mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: timerCtx.ptr.prototype.cancel, $c: true, $r, c, err, removeFromParent, $s};return $f; + }; + timerCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; + WithTimeout = function(parent, timeout) { + var {$24r, _arg, _arg$1, _r, _r$1, _r$2, parent, timeout, $s, $r, $c} = $restore(this, {parent, timeout}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _arg = parent; + _r = time.Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = $clone(_r, time.Time).Add(timeout); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _arg$1 = $clone(_r$1, time.Time); + _r$2 = WithDeadline(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2; + $s = 4; case 4: return $24r; + /* */ } return; } var $f = {$blk: WithTimeout, $c: true, $r, $24r, _arg, _arg$1, _r, _r$1, _r$2, parent, timeout, $s};return $f; + }; + $pkg.WithTimeout = WithTimeout; + stringify = function(v) { + var {$24r, _r, _ref, s, s$1, v, $s, $r, $c} = $restore(this, {v}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _ref = v; + /* */ if ($assertType(_ref, stringer, true)[1]) { $s = 1; continue; } + /* */ if ($assertType(_ref, $String, true)[1]) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if ($assertType(_ref, stringer, true)[1]) { */ case 1: + s = _ref; + _r = s.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 5; case 5: return $24r; + /* } else if ($assertType(_ref, $String, true)[1]) { */ case 2: + s$1 = _ref.$val; + $s = -1; return s$1; + /* } */ case 3: + $s = -1; return ""; + /* */ } return; } var $f = {$blk: stringify, $c: true, $r, $24r, _r, _ref, s, s$1, v, $s};return $f; + }; + valueCtx.ptr.prototype.String = function() { + var {$24r, _r, _r$1, _r$2, c, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + _r = contextName(c.Context); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = reflectlite.TypeOf(c.key).String(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = stringify(c.val); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r + ".WithValue(type " + _r$1 + ", val " + _r$2 + ")"; + $s = 4; case 4: return $24r; + /* */ } return; } var $f = {$blk: valueCtx.ptr.prototype.String, $c: true, $r, $24r, _r, _r$1, _r$2, c, $s};return $f; + }; + valueCtx.prototype.String = function() { return this.$val.String(); }; + valueCtx.ptr.prototype.Value = function(key) { + var {$24r, _r, c, key, $s, $r, $c} = $restore(this, {key}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + if ($interfaceIsEqual(c.key, key)) { + $s = -1; return c.val; } - return ($bytesToString($subslice(new sliceType$2(buf), 0, w))); + _r = value(c.Context, key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: valueCtx.ptr.prototype.Value, $c: true, $r, $24r, _r, c, key, $s};return $f; }; - $ptrType(FileMode).prototype.String = function() { return new FileMode(this.$get()).String(); }; - FileMode.prototype.IsDir = function() { - var m; - m = this.$val; - return !((((m & 2147483648) >>> 0) === 0)); + valueCtx.prototype.Value = function(key) { return this.$val.Value(key); }; + value = function(c, key) { + var {$24r, _r, _ref, c, ctx, ctx$1, ctx$2, ctx$3, ctx$4, key, $s, $r, $c} = $restore(this, {c, key}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* while (true) { */ case 1: + _ref = c; + /* */ if ($assertType(_ref, ptrType$6, true)[1]) { $s = 3; continue; } + /* */ if ($assertType(_ref, ptrType$3, true)[1]) { $s = 4; continue; } + /* */ if ($assertType(_ref, ptrType$7, true)[1]) { $s = 5; continue; } + /* */ if ($assertType(_ref, ptrType, true)[1]) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if ($assertType(_ref, ptrType$6, true)[1]) { */ case 3: + ctx = _ref.$val; + if ($interfaceIsEqual(key, ctx.key)) { + $s = -1; return ctx.val; + } + c = ctx.Context; + $s = 8; continue; + /* } else if ($assertType(_ref, ptrType$3, true)[1]) { */ case 4: + ctx$1 = _ref.$val; + if ($interfaceIsEqual(key, (cancelCtxKey$24ptr || (cancelCtxKey$24ptr = new ptrType$4(function() { return cancelCtxKey; }, function($v) { cancelCtxKey = $v; }))))) { + $s = -1; return c; + } + c = ctx$1.Context; + $s = 8; continue; + /* } else if ($assertType(_ref, ptrType$7, true)[1]) { */ case 5: + ctx$2 = _ref.$val; + if ($interfaceIsEqual(key, (cancelCtxKey$24ptr || (cancelCtxKey$24ptr = new ptrType$4(function() { return cancelCtxKey; }, function($v) { cancelCtxKey = $v; }))))) { + $s = -1; return ctx$2.cancelCtx; + } + c = ctx$2.cancelCtx.Context; + $s = 8; continue; + /* } else if ($assertType(_ref, ptrType, true)[1]) { */ case 6: + ctx$3 = _ref.$val; + $s = -1; return $ifaceNil; + /* } else { */ case 7: + ctx$4 = _ref; + _r = c.Value(key); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 10; case 10: return $24r; + /* } */ case 8: + $s = 1; continue; + case 2: + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: value, $c: true, $r, $24r, _r, _ref, c, ctx, ctx$1, ctx$2, ctx$3, ctx$4, key, $s};return $f; }; - $ptrType(FileMode).prototype.IsDir = function() { return new FileMode(this.$get()).IsDir(); }; - FileMode.prototype.IsRegular = function() { - var m; - m = this.$val; - return ((m & 2399666176) >>> 0) === 0; - }; - $ptrType(FileMode).prototype.IsRegular = function() { return new FileMode(this.$get()).IsRegular(); }; - FileMode.prototype.Perm = function() { - var m; - m = this.$val; - return (m & 511) >>> 0; - }; - $ptrType(FileMode).prototype.Perm = function() { return new FileMode(this.$get()).Perm(); }; - fileStat.ptr.prototype.Name = function() { - var fs; - fs = this; - return fs.name; - }; - fileStat.prototype.Name = function() { return this.$val.Name(); }; - fileStat.ptr.prototype.IsDir = function() { - var fs; - fs = this; - return new FileMode(fs.Mode()).IsDir(); - }; - fileStat.prototype.IsDir = function() { return this.$val.IsDir(); }; - fileStat.ptr.prototype.Size = function() { - var fs; - fs = this; - return fs.size; - }; - fileStat.prototype.Size = function() { return this.$val.Size(); }; - fileStat.ptr.prototype.Mode = function() { - var fs; - fs = this; - return fs.mode; - }; - fileStat.prototype.Mode = function() { return this.$val.Mode(); }; - fileStat.ptr.prototype.ModTime = function() { - var fs; - fs = this; - return fs.modTime; - }; - fileStat.prototype.ModTime = function() { return this.$val.ModTime(); }; - fileStat.ptr.prototype.Sys = function() { - var fs; - fs = this; - return fs.sys; - }; - fileStat.prototype.Sys = function() { return this.$val.Sys(); }; - ptrType$2.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; - ptrType$4.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; - ptrType$3.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$13.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [$error], false)}]; - ptrType.methods = [{prop: "Readdir", name: "Readdir", pkg: "", typ: $funcType([$Int], [sliceType$1, $error], false)}, {prop: "Readdirnames", name: "Readdirnames", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "readdir", name: "readdir", pkg: "os", typ: $funcType([$Int], [sliceType$1, $error], false)}, {prop: "readdirnames", name: "readdirnames", pkg: "os", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteAt", name: "WriteAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "wrapErr", name: "wrapErr", pkg: "os", typ: $funcType([$String, $error], [$error], false)}, {prop: "Chmod", name: "Chmod", pkg: "", typ: $funcType([FileMode], [$error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "chmod", name: "chmod", pkg: "os", typ: $funcType([FileMode], [$error], false)}, {prop: "Chown", name: "Chown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "Sync", name: "Sync", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "setDeadline", name: "setDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setReadDeadline", name: "setReadDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setWriteDeadline", name: "setWriteDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "checkValid", name: "checkValid", pkg: "os", typ: $funcType([$String], [$error], false)}, {prop: "Fd", name: "Fd", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "read", name: "read", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pread", name: "pread", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pwrite", name: "pwrite", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "seek", name: "seek", pkg: "os", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([], [FileInfo, $error], false)}]; - FileMode.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsRegular", name: "IsRegular", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([], [FileMode], false)}]; - ptrType$16.methods = [{prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]; - timeout.init([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); - PathError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); - SyscallError.init("", [{prop: "Syscall", name: "Syscall", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); - LinkError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Old", name: "Old", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); - file.init("os", [{prop: "pfd", name: "pfd", embedded: false, exported: false, typ: poll.FD, tag: ""}, {prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "dirinfo", name: "dirinfo", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "nonblock", name: "nonblock", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "stdoutOrErr", name: "stdoutOrErr", embedded: false, exported: false, typ: $Bool, tag: ""}]); - dirInfo.init("os", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "nbuf", name: "nbuf", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bufp", name: "bufp", embedded: false, exported: false, typ: $Int, tag: ""}]); - File.init("os", [{prop: "file", name: "file", embedded: true, exported: false, typ: ptrType$13, tag: ""}]); - FileInfo.init([{prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]); - fileStat.init("os", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "mode", name: "mode", embedded: false, exported: false, typ: FileMode, tag: ""}, {prop: "modTime", name: "modTime", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "sys", name: "sys", embedded: false, exported: false, typ: syscall.Stat_t, tag: ""}]); + deadlineExceededError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; + ptrType.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$3.methods = [{prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; + ptrType$7.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; + ptrType$6.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]; + Context.init([{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]); + deadlineExceededError.init("", []); + CancelFunc.init([], [], false); + canceler.init([{prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]); + cancelCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: atomic.Value, tag: ""}, {prop: "children", name: "children", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); + stringer.init([{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); + timerCtx.init("context", [{prop: "cancelCtx", name: "cancelCtx", embedded: true, exported: false, typ: cancelCtx, tag: ""}, {prop: "timer", name: "timer", embedded: false, exported: false, typ: ptrType$5, tag: ""}, {prop: "deadline", name: "deadline", embedded: false, exported: false, typ: time.Time, tag: ""}]); + valueCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "val", name: "val", embedded: false, exported: false, typ: $emptyInterface, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = poll.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = unix.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = testlog.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = atomic.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = syscall.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.Args = sliceType.nil; - $pkg.ErrInvalid = errors.New("invalid argument"); - $pkg.ErrPermission = errors.New("permission denied"); - $pkg.ErrExist = errors.New("file already exists"); - $pkg.ErrNotExist = errors.New("file does not exist"); - $pkg.ErrClosed = errors.New("file already closed"); - errFinished = errors.New("os: process already finished"); - $pkg.Stdin = NewFile(((syscall.Stdin >>> 0)), "/dev/stdin"); - $pkg.Stdout = NewFile(((syscall.Stdout >>> 0)), "/dev/stdout"); - $pkg.Stderr = NewFile(((syscall.Stderr >>> 0)), "/dev/stderr"); - lstat = Lstat; + $r = reflectlite.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + goroutines = 0; + cancelCtxKey = 0; + $pkg.Canceled = errors.New("context canceled"); + $pkg.DeadlineExceeded = (x = new deadlineExceededError.ptr(), new x.constructor.elem(x)); + background = $newDataPointer(0, ptrType); + todo = $newDataPointer(0, ptrType); + closedchan = new $Chan(structType, 0); init(); - init$1(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["io"] = (function() { + var $pkg = {}, $init, errors, sync, Reader, Writer, ReaderFrom, WriterTo, RuneScanner, LimitedReader, sliceType, sliceType$1, ptrType$1, ptrType$3, errInvalidWrite, errWhence, errOffset, blackHolePool, Copy, copyBuffer; + errors = $packages["errors"]; + sync = $packages["sync"]; + Reader = $pkg.Reader = $newType(8, $kindInterface, "io.Reader", true, "io", true, null); + Writer = $pkg.Writer = $newType(8, $kindInterface, "io.Writer", true, "io", true, null); + ReaderFrom = $pkg.ReaderFrom = $newType(8, $kindInterface, "io.ReaderFrom", true, "io", true, null); + WriterTo = $pkg.WriterTo = $newType(8, $kindInterface, "io.WriterTo", true, "io", true, null); + RuneScanner = $pkg.RuneScanner = $newType(8, $kindInterface, "io.RuneScanner", true, "io", true, null); + LimitedReader = $pkg.LimitedReader = $newType(0, $kindStruct, "io.LimitedReader", true, "io", true, function(R_, N_) { + this.$val = this; + if (arguments.length === 0) { + this.R = $ifaceNil; + this.N = new $Int64(0, 0); + return; + } + this.R = R_; + this.N = N_; + }); + sliceType = $sliceType($emptyInterface); + sliceType$1 = $sliceType($Uint8); + ptrType$1 = $ptrType(sliceType$1); + ptrType$3 = $ptrType(LimitedReader); + Copy = function(dst, src) { + var {$24r, _r, _tuple, dst, err, src, written, $s, $r, $c} = $restore(this, {dst, src}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + written = new $Int64(0, 0); + err = $ifaceNil; + _r = copyBuffer(dst, src, sliceType$1.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + written = _tuple[0]; + err = _tuple[1]; + $24r = [written, err]; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Copy, $c: true, $r, $24r, _r, _tuple, dst, err, src, written, $s};return $f; + }; + $pkg.Copy = Copy; + copyBuffer = function(dst, src, buf) { + var {$24r, $24r$1, _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, buf, dst, er, err, ew, l, nr, nw, ok, ok$1, ok$2, rt, size, src, written, wt, x$2, x$3, x$4, x$5, x$6, $s, $r, $c} = $restore(this, {dst, src, buf}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + written = new $Int64(0, 0); + err = $ifaceNil; + _tuple = $assertType(src, WriterTo, true); + wt = _tuple[0]; + ok = _tuple[1]; + /* */ if (ok) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (ok) { */ case 1: + _r = wt.WriteTo(dst); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple$1 = _r; + written = _tuple$1[0]; + err = _tuple$1[1]; + $24r = [written, err]; + $s = 4; case 4: return $24r; + /* } */ case 2: + _tuple$2 = $assertType(dst, ReaderFrom, true); + rt = _tuple$2[0]; + ok$1 = _tuple$2[1]; + /* */ if (ok$1) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (ok$1) { */ case 5: + _r$1 = rt.ReadFrom(src); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$3 = _r$1; + written = _tuple$3[0]; + err = _tuple$3[1]; + $24r$1 = [written, err]; + $s = 8; case 8: return $24r$1; + /* } */ case 6: + if (buf === sliceType$1.nil) { + size = 32768; + _tuple$4 = $assertType(src, ptrType$3, true); + l = _tuple$4[0]; + ok$2 = _tuple$4[1]; + if (ok$2 && (x$2 = (new $Int64(0, size)), x$3 = l.N, (x$2.$high > x$3.$high || (x$2.$high === x$3.$high && x$2.$low > x$3.$low)))) { + if ((x$4 = l.N, (x$4.$high < 0 || (x$4.$high === 0 && x$4.$low < 1)))) { + size = 1; + } else { + size = (((x$5 = l.N, x$5.$low + ((x$5.$high >> 31) * 4294967296)) >> 0)); + } + } + buf = $makeSlice(sliceType$1, size); + } + /* while (true) { */ case 9: + _r$2 = src.Read(buf); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$5 = _r$2; + nr = _tuple$5[0]; + er = _tuple$5[1]; + /* */ if (nr > 0) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if (nr > 0) { */ case 12: + _r$3 = dst.Write($subslice(buf, 0, nr)); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple$6 = _r$3; + nw = _tuple$6[0]; + ew = _tuple$6[1]; + if (nw < 0 || nr < nw) { + nw = 0; + if ($interfaceIsEqual(ew, $ifaceNil)) { + ew = errInvalidWrite; + } + } + written = (x$6 = (new $Int64(0, nw)), new $Int64(written.$high + x$6.$high, written.$low + x$6.$low)); + if (!($interfaceIsEqual(ew, $ifaceNil))) { + err = ew; + /* break; */ $s = 10; continue; + } + if (!((nr === nw))) { + err = $pkg.ErrShortWrite; + /* break; */ $s = 10; continue; + } + /* } */ case 13: + if (!($interfaceIsEqual(er, $ifaceNil))) { + if (!($interfaceIsEqual(er, $pkg.EOF))) { + err = er; + } + /* break; */ $s = 10; continue; + } + $s = 9; continue; + case 10: + _tmp = written; + _tmp$1 = err; + written = _tmp; + err = _tmp$1; + $s = -1; return [written, err]; + /* */ } return; } var $f = {$blk: copyBuffer, $c: true, $r, $24r, $24r$1, _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, buf, dst, er, err, ew, l, nr, nw, ok, ok$1, ok$2, rt, size, src, written, wt, x$2, x$3, x$4, x$5, x$6, $s};return $f; + }; + LimitedReader.ptr.prototype.Read = function(p) { + var {_r, _tmp, _tmp$1, _tuple, err, l, n, p, x$2, x$3, x$4, x$5, x$6, $s, $r, $c} = $restore(this, {p}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + l = this; + if ((x$2 = l.N, (x$2.$high < 0 || (x$2.$high === 0 && x$2.$low <= 0)))) { + _tmp = 0; + _tmp$1 = $pkg.EOF; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + } + if ((x$3 = (new $Int64(0, p.$length)), x$4 = l.N, (x$3.$high > x$4.$high || (x$3.$high === x$4.$high && x$3.$low > x$4.$low)))) { + p = $subslice(p, 0, $flatten64(l.N)); + } + _r = l.R.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + n = _tuple[0]; + err = _tuple[1]; + l.N = (x$5 = l.N, x$6 = (new $Int64(0, n)), new $Int64(x$5.$high - x$6.$high, x$5.$low - x$6.$low)); + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: LimitedReader.ptr.prototype.Read, $c: true, $r, _r, _tmp, _tmp$1, _tuple, err, l, n, p, x$2, x$3, x$4, x$5, x$6, $s};return $f; + }; + LimitedReader.prototype.Read = function(p) { return this.$val.Read(p); }; + ptrType$3.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; + Reader.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); + Writer.init([{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); + ReaderFrom.init([{prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([Reader], [$Int64, $error], false)}]); + WriterTo.init([{prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([Writer], [$Int64, $error], false)}]); + RuneScanner.init([{prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]); + LimitedReader.init("", [{prop: "R", name: "R", embedded: false, exported: true, typ: Reader, tag: ""}, {prop: "N", name: "N", embedded: false, exported: true, typ: $Int64, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.ErrClosedPipe = errors.New("io: read/write on closed pipe"); + $pkg.ErrShortWrite = errors.New("short write"); + errInvalidWrite = errors.New("invalid write result"); + $pkg.ErrShortBuffer = errors.New("short buffer"); + $pkg.EOF = errors.New("EOF"); + $pkg.ErrUnexpectedEOF = errors.New("unexpected EOF"); + $pkg.ErrNoProgress = errors.New("multiple Read calls return no data or error"); + errWhence = errors.New("Seek: invalid whence"); + errOffset = errors.New("Seek: invalid offset"); + blackHolePool = new sync.Pool.ptr(sliceType.nil, (function() { + var b, b$24ptr; + b = $makeSlice(sliceType$1, 8192); + return (b$24ptr || (b$24ptr = new ptrType$1(function() { return b; }, function($v) { b = $convertSliceType($v, sliceType$1); }))); + })); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["hash"] = (function() { + var $pkg = {}, $init, io, Hash, sliceType; + io = $packages["io"]; + Hash = $pkg.Hash = $newType(8, $kindInterface, "hash.Hash", true, "hash", true, null); + sliceType = $sliceType($Uint8); + Hash.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/cpu"] = (function() { + var $pkg = {}, $init; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/bytealg"] = (function() { + var $pkg = {}, $init, cpu, IndexByteString; + cpu = $packages["internal/cpu"]; + IndexByteString = function(s, c) { + var c, i, s; + i = 0; + while (true) { + if (!(i < s.length)) { break; } + if (s.charCodeAt(i) === c) { + return i; + } + i = i + (1) >> 0; + } + return -1; + }; + $pkg.IndexByteString = IndexByteString; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = cpu.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["math/bits"] = (function() { - var $pkg = {}, $init, deBruijn32tab, deBruijn64tab, len8tab, LeadingZeros64, TrailingZeros, TrailingZeros32, TrailingZeros64, Len64; - LeadingZeros64 = function(x) { - var x; - return 64 - Len64(x) >> 0; - }; - $pkg.LeadingZeros64 = LeadingZeros64; + var $pkg = {}, $init, deBruijn32tab, deBruijn64tab, TrailingZeros, TrailingZeros32, TrailingZeros64, RotateLeft32, Len32, Len64, Add64, Mul64; TrailingZeros = function(x) { var x; if (true) { @@ -10642,6 +12064,27 @@ $packages["math/bits"] = (function() { return (((x$1 = $shiftRightUint64($mul64(((x$2 = new $Uint64(-x.$high, -x.$low), new $Uint64(x.$high & x$2.$high, (x.$low & x$2.$low) >>> 0))), new $Uint64(66559345, 3033172745)), 58), (($flatten64(x$1) < 0 || $flatten64(x$1) >= deBruijn64tab.length) ? ($throwRuntimeError("index out of range"), undefined) : deBruijn64tab[$flatten64(x$1)])) >> 0)); }; $pkg.TrailingZeros64 = TrailingZeros64; + RotateLeft32 = function(x, k) { + var k, s, x, y, y$1; + s = (((k >>> 0)) & 31) >>> 0; + return (((y = s, y < 32 ? (x << y) : 0) >>> 0) | ((y$1 = ((32 - s >>> 0)), y$1 < 32 ? (x >>> y$1) : 0) >>> 0)) >>> 0; + }; + $pkg.RotateLeft32 = RotateLeft32; + Len32 = function(x) { + var n, x, y, y$1; + n = 0; + if (x >= 65536) { + x = (y = (16), y < 32 ? (x >>> y) : 0) >>> 0; + n = 16; + } + if (x >= 256) { + x = (y$1 = (8), y$1 < 32 ? (x >>> y$1) : 0) >>> 0; + n = n + (8) >> 0; + } + n = n + (("\x00\x01\x02\x02\x03\x03\x03\x03\x04\x04\x04\x04\x04\x04\x04\x04\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b".charCodeAt(x) >> 0)) >> 0; + return n; + }; + $pkg.Len32 = Len32; Len64 = function(x) { var n, x; n = 0; @@ -10657,23 +12100,90 @@ $packages["math/bits"] = (function() { x = $shiftRightUint64(x, (8)); n = n + (8) >> 0; } - n = n + (((($flatten64(x) < 0 || $flatten64(x) >= len8tab.length) ? ($throwRuntimeError("index out of range"), undefined) : len8tab[$flatten64(x)]) >> 0)) >> 0; + n = n + (("\x00\x01\x02\x02\x03\x03\x03\x03\x04\x04\x04\x04\x04\x04\x04\x04\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b".charCodeAt($flatten64(x)) >> 0)) >> 0; return n; }; $pkg.Len64 = Len64; + Add64 = function(x, y, carry) { + var carry, carryOut, sum, x, x$1, x$2, x$3, x$4, y; + sum = new $Uint64(0, 0); + carryOut = new $Uint64(0, 0); + sum = (x$1 = new $Uint64(x.$high + y.$high, x.$low + y.$low), new $Uint64(x$1.$high + carry.$high, x$1.$low + carry.$low)); + carryOut = $shiftRightUint64(((x$2 = new $Uint64(x.$high & y.$high, (x.$low & y.$low) >>> 0), x$3 = (x$4 = new $Uint64(x.$high | y.$high, (x.$low | y.$low) >>> 0), new $Uint64(x$4.$high & ~sum.$high, (x$4.$low & ~sum.$low) >>> 0)), new $Uint64(x$2.$high | x$3.$high, (x$2.$low | x$3.$low) >>> 0))), 63); + return [sum, carryOut]; + }; + $pkg.Add64 = Add64; + Mul64 = function(x, y) { + var hi, lo, t, w0, w1, w2, x, x$1, x$2, x$3, x$4, x$5, x$6, x0, x1, y, y0, y1; + hi = new $Uint64(0, 0); + lo = new $Uint64(0, 0); + x0 = new $Uint64(x.$high & 0, (x.$low & 4294967295) >>> 0); + x1 = $shiftRightUint64(x, 32); + y0 = new $Uint64(y.$high & 0, (y.$low & 4294967295) >>> 0); + y1 = $shiftRightUint64(y, 32); + w0 = $mul64(x0, y0); + t = (x$1 = $mul64(x1, y0), x$2 = $shiftRightUint64(w0, 32), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); + w1 = new $Uint64(t.$high & 0, (t.$low & 4294967295) >>> 0); + w2 = $shiftRightUint64(t, 32); + w1 = (x$3 = $mul64(x0, y1), new $Uint64(w1.$high + x$3.$high, w1.$low + x$3.$low)); + hi = (x$4 = (x$5 = $mul64(x1, y1), new $Uint64(x$5.$high + w2.$high, x$5.$low + w2.$low)), x$6 = $shiftRightUint64(w1, 32), new $Uint64(x$4.$high + x$6.$high, x$4.$low + x$6.$low)); + lo = $mul64(x, y); + return [hi, lo]; + }; + $pkg.Mul64 = Mul64; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: deBruijn32tab = $toNativeArray($kindUint8, [0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9]); deBruijn64tab = $toNativeArray($kindUint8, [0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6]); - len8tab = $toNativeArray($kindUint8, [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8]); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["math"] = (function() { + var $pkg = {}, $init, js, bits, arrayType, arrayType$1, arrayType$2, structType, math, nan, buf, init, Float32bits, Float64bits; + js = $packages["github.com/gopherjs/gopherjs/js"]; + bits = $packages["math/bits"]; + arrayType = $arrayType($Uint32, 2); + arrayType$1 = $arrayType($Float32, 2); + arrayType$2 = $arrayType($Float64, 1); + structType = $structType("math", [{prop: "uint32array", name: "uint32array", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "float32array", name: "float32array", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "float64array", name: "float64array", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); + init = function() { + var ab; + ab = new ($global.ArrayBuffer)(8); + buf.uint32array = new ($global.Uint32Array)(ab); + buf.float32array = new ($global.Float32Array)(ab); + buf.float64array = new ($global.Float64Array)(ab); + }; + Float32bits = function(f) { + var f; + buf.float32array[0] = f; + return buf.uint32array[0]; + }; + $pkg.Float32bits = Float32bits; + Float64bits = function(f) { + var f, x, x$1; + buf.float64array[0] = f; + return (x = $shiftLeft64((new $Uint64(0, buf.uint32array[1])), 32), x$1 = (new $Uint64(0, buf.uint32array[0])), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); + }; + $pkg.Float64bits = Float64bits; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = bits.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + buf = new structType.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$2.zero()); + math = $global.Math; + nan = $parseFloat($NaN); + init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["unicode/utf8"] = (function() { - var $pkg = {}, $init, acceptRange, first, acceptRanges, DecodeRuneInString, RuneLen, EncodeRune, RuneCount, RuneCountInString, ValidString, ValidRune; + var $pkg = {}, $init, acceptRange, first, acceptRanges, DecodeRune, DecodeRuneInString, RuneLen, EncodeRune, RuneCount, RuneCountInString, ValidString, ValidRune; acceptRange = $pkg.acceptRange = $newType(0, $kindStruct, "utf8.acceptRange", true, "unicode/utf8", false, function(lo_, hi_) { this.$val = this; if (arguments.length === 0) { @@ -10684,6 +12194,82 @@ $packages["unicode/utf8"] = (function() { this.lo = lo_; this.hi = hi_; }); + DecodeRune = function(p) { + var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, b1, b2, b3, mask, n, p, p0, r, size, sz, x, x$1; + r = 0; + size = 0; + n = p.$length; + if (n < 1) { + _tmp = 65533; + _tmp$1 = 0; + r = _tmp; + size = _tmp$1; + return [r, size]; + } + p0 = (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]); + x = ((p0 < 0 || p0 >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[p0]); + if (x >= 240) { + mask = (((x >> 0)) << 31 >> 0) >> 31 >> 0; + _tmp$2 = (((((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]) >> 0)) & ~mask) >> 0) | (65533 & mask); + _tmp$3 = 1; + r = _tmp$2; + size = _tmp$3; + return [r, size]; + } + sz = ((((x & 7) >>> 0) >> 0)); + accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); + if (n < sz) { + _tmp$4 = 65533; + _tmp$5 = 1; + r = _tmp$4; + size = _tmp$5; + return [r, size]; + } + b1 = (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]); + if (b1 < accept.lo || accept.hi < b1) { + _tmp$6 = 65533; + _tmp$7 = 1; + r = _tmp$6; + size = _tmp$7; + return [r, size]; + } + if (sz <= 2) { + _tmp$8 = (((((p0 & 31) >>> 0) >> 0)) << 6 >> 0) | ((((b1 & 63) >>> 0) >> 0)); + _tmp$9 = 2; + r = _tmp$8; + size = _tmp$9; + return [r, size]; + } + b2 = (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]); + if (b2 < 128 || 191 < b2) { + _tmp$10 = 65533; + _tmp$11 = 1; + r = _tmp$10; + size = _tmp$11; + return [r, size]; + } + if (sz <= 3) { + _tmp$12 = ((((((p0 & 15) >>> 0) >> 0)) << 12 >> 0) | (((((b1 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((b2 & 63) >>> 0) >> 0)); + _tmp$13 = 3; + r = _tmp$12; + size = _tmp$13; + return [r, size]; + } + b3 = (3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3]); + if (b3 < 128 || 191 < b3) { + _tmp$14 = 65533; + _tmp$15 = 1; + r = _tmp$14; + size = _tmp$15; + return [r, size]; + } + _tmp$16 = (((((((p0 & 7) >>> 0) >> 0)) << 18 >> 0) | (((((b1 & 63) >>> 0) >> 0)) << 12 >> 0)) | (((((b2 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((b3 & 63) >>> 0) >> 0)); + _tmp$17 = 4; + r = _tmp$16; + size = _tmp$17; + return [r, size]; + }; + $pkg.DecodeRune = DecodeRune; DecodeRuneInString = function(s) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, mask, n, r, s, s0, s1, s2, s3, size, sz, x, x$1; r = 0; @@ -10706,9 +12292,9 @@ $packages["unicode/utf8"] = (function() { size = _tmp$3; return [r, size]; } - sz = (x & 7) >>> 0; + sz = ((((x & 7) >>> 0) >> 0)); accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); - if (n < ((sz >> 0))) { + if (n < sz) { _tmp$4 = 65533; _tmp$5 = 1; r = _tmp$4; @@ -10723,7 +12309,7 @@ $packages["unicode/utf8"] = (function() { size = _tmp$7; return [r, size]; } - if (sz === 2) { + if (sz <= 2) { _tmp$8 = (((((s0 & 31) >>> 0) >> 0)) << 6 >> 0) | ((((s1 & 63) >>> 0) >> 0)); _tmp$9 = 2; r = _tmp$8; @@ -10738,7 +12324,7 @@ $packages["unicode/utf8"] = (function() { size = _tmp$11; return [r, size]; } - if (sz === 3) { + if (sz <= 3) { _tmp$12 = ((((((s0 & 15) >>> 0) >> 0)) << 12 >> 0) | (((((s1 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((s2 & 63) >>> 0) >> 0)); _tmp$13 = 3; r = _tmp$12; @@ -10907,7 +12493,16 @@ $packages["unicode/utf8"] = (function() { }; $pkg.RuneCountInString = RuneCountInString; ValidString = function(s) { - var accept, c, c$1, c$2, i, n, s, si, size, x, x$1; + var accept, c, c$1, c$2, first32, i, n, s, second32, si, size, x, x$1; + while (true) { + if (!(s.length >= 8)) { break; } + first32 = (((((((s.charCodeAt(0) >>> 0)) | (((s.charCodeAt(1) >>> 0)) << 8 >>> 0)) >>> 0) | (((s.charCodeAt(2) >>> 0)) << 16 >>> 0)) >>> 0) | (((s.charCodeAt(3) >>> 0)) << 24 >>> 0)) >>> 0; + second32 = (((((((s.charCodeAt(4) >>> 0)) | (((s.charCodeAt(5) >>> 0)) << 8 >>> 0)) >>> 0) | (((s.charCodeAt(6) >>> 0)) << 16 >>> 0)) >>> 0) | (((s.charCodeAt(7) >>> 0)) << 24 >>> 0)) >>> 0; + if (!(((((((first32 | second32) >>> 0)) & 2155905152) >>> 0) === 0))) { + break; + } + s = $substring(s, 8); + } n = s.length; i = 0; while (true) { @@ -10962,68 +12557,20 @@ $packages["unicode/utf8"] = (function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: first = $toNativeArray($kindUint8, [240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 19, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 35, 3, 3, 52, 4, 4, 4, 68, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241]); - acceptRanges = $toNativeArray($kindStruct, [new acceptRange.ptr(128, 191), new acceptRange.ptr(160, 191), new acceptRange.ptr(128, 159), new acceptRange.ptr(144, 191), new acceptRange.ptr(128, 143)]); + acceptRanges = $toNativeArray($kindStruct, [new acceptRange.ptr(128, 191), new acceptRange.ptr(160, 191), new acceptRange.ptr(128, 159), new acceptRange.ptr(144, 191), new acceptRange.ptr(128, 143), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0)]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["strconv"] = (function() { - var $pkg = {}, $init, errors, math, bits, utf8, NumError, decimal, leftCheat, extFloat, floatInfo, decimalSlice, sliceType$3, sliceType$4, sliceType$5, arrayType, sliceType$6, ptrType, arrayType$1, arrayType$2, ptrType$1, arrayType$3, arrayType$4, ptrType$2, ptrType$3, ptrType$4, optimize, leftcheats, smallPowersOfTen, powersOfTen, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, syntaxError, rangeError, baseError, bitSizeError, ParseUint, ParseInt, Atoi, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, frexp10Many, adjustLastDigitFixed, adjustLastDigit, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, min, max, FormatInt, Itoa, small, formatBits, isPowerOfTwo, quoteWith, appendQuotedWith, appendQuotedRuneWith, appendEscapedRune, Quote, AppendQuote, AppendQuoteToASCII, AppendQuoteRune, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, contains, bsearch16, bsearch32, IsPrint, isInGraphicList; + var $pkg = {}, $init, errors, js, bytealg, math, bits, utf8, floatInfo, decimalSlice, decimal, leftCheat, NumError, sliceType, sliceType$1, arrayType, sliceType$2, sliceType$6, arrayType$1, arrayType$2, ptrType, arrayType$3, arrayType$4, arrayType$5, ptrType$1, ptrType$2, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, detailedPowersOfTen, leftcheats, optimize, contains, quoteWith, appendQuotedWith, appendQuotedRuneWith, appendEscapedRune, Quote, AppendQuote, AppendQuoteToASCII, AppendQuoteRune, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, unquote, bsearch16, bsearch32, IsPrint, isInGraphicList, FormatInt, small, formatBits, isPowerOfTwo, Itoa, Atoi, ryuFtoaFixed32, ryuFtoaFixed64, formatDecimal, ryuFtoaShortest, mulByLog2Log10, mulByLog10Log2, computeBounds, ryuDigits, ryuDigits32, mult64bitPow10, mult128bitPow10, divisibleByPower5, divmod1e9, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, fmtX, min, max, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, index, lower, syntaxError, rangeError, baseError, bitSizeError, ParseUint, underscoreOK; errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + bytealg = $packages["internal/bytealg"]; math = $packages["math"]; bits = $packages["math/bits"]; utf8 = $packages["unicode/utf8"]; - NumError = $pkg.NumError = $newType(0, $kindStruct, "strconv.NumError", true, "strconv", true, function(Func_, Num_, Err_) { - this.$val = this; - if (arguments.length === 0) { - this.Func = ""; - this.Num = ""; - this.Err = $ifaceNil; - return; - } - this.Func = Func_; - this.Num = Num_; - this.Err = Err_; - }); - decimal = $pkg.decimal = $newType(0, $kindStruct, "strconv.decimal", true, "strconv", false, function(d_, nd_, dp_, neg_, trunc_) { - this.$val = this; - if (arguments.length === 0) { - this.d = arrayType.zero(); - this.nd = 0; - this.dp = 0; - this.neg = false; - this.trunc = false; - return; - } - this.d = d_; - this.nd = nd_; - this.dp = dp_; - this.neg = neg_; - this.trunc = trunc_; - }); - leftCheat = $pkg.leftCheat = $newType(0, $kindStruct, "strconv.leftCheat", true, "strconv", false, function(delta_, cutoff_) { - this.$val = this; - if (arguments.length === 0) { - this.delta = 0; - this.cutoff = ""; - return; - } - this.delta = delta_; - this.cutoff = cutoff_; - }); - extFloat = $pkg.extFloat = $newType(0, $kindStruct, "strconv.extFloat", true, "strconv", false, function(mant_, exp_, neg_) { - this.$val = this; - if (arguments.length === 0) { - this.mant = new $Uint64(0, 0); - this.exp = 0; - this.neg = false; - return; - } - this.mant = mant_; - this.exp = exp_; - this.neg = neg_; - }); floatInfo = $pkg.floatInfo = $newType(0, $kindStruct, "strconv.floatInfo", true, "strconv", false, function(mantbits_, expbits_, bias_) { this.$val = this; if (arguments.length === 0) { @@ -11050,218 +12597,1715 @@ $packages["strconv"] = (function() { this.dp = dp_; this.neg = neg_; }); - sliceType$3 = $sliceType(leftCheat); - sliceType$4 = $sliceType($Uint16); - sliceType$5 = $sliceType($Uint32); - arrayType = $arrayType($Uint8, 800); + decimal = $pkg.decimal = $newType(0, $kindStruct, "strconv.decimal", true, "strconv", false, function(d_, nd_, dp_, neg_, trunc_) { + this.$val = this; + if (arguments.length === 0) { + this.d = arrayType$5.zero(); + this.nd = 0; + this.dp = 0; + this.neg = false; + this.trunc = false; + return; + } + this.d = d_; + this.nd = nd_; + this.dp = dp_; + this.neg = neg_; + this.trunc = trunc_; + }); + leftCheat = $pkg.leftCheat = $newType(0, $kindStruct, "strconv.leftCheat", true, "strconv", false, function(delta_, cutoff_) { + this.$val = this; + if (arguments.length === 0) { + this.delta = 0; + this.cutoff = ""; + return; + } + this.delta = delta_; + this.cutoff = cutoff_; + }); + NumError = $pkg.NumError = $newType(0, $kindStruct, "strconv.NumError", true, "strconv", true, function(Func_, Num_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Func = ""; + this.Num = ""; + this.Err = $ifaceNil; + return; + } + this.Func = Func_; + this.Num = Num_; + this.Err = Err_; + }); + sliceType = $sliceType($Uint16); + sliceType$1 = $sliceType($Uint32); + arrayType = $arrayType($Uint64, 2); + sliceType$2 = $sliceType(leftCheat); sliceType$6 = $sliceType($Uint8); - ptrType = $ptrType(NumError); - arrayType$1 = $arrayType($Uint8, 24); - arrayType$2 = $arrayType($Uint8, 32); - ptrType$1 = $ptrType(floatInfo); - arrayType$3 = $arrayType($Uint8, 65); - arrayType$4 = $arrayType($Uint8, 4); + arrayType$1 = $arrayType($Uint8, 4); + arrayType$2 = $arrayType($Uint8, 65); + ptrType = $ptrType(floatInfo); + arrayType$3 = $arrayType($Uint8, 32); + arrayType$4 = $arrayType($Uint8, 24); + arrayType$5 = $arrayType($Uint8, 800); + ptrType$1 = $ptrType(NumError); ptrType$2 = $ptrType(decimal); - ptrType$3 = $ptrType(decimalSlice); - ptrType$4 = $ptrType(extFloat); - NumError.ptr.prototype.Error = function() { - var _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return "strconv." + e.Func + ": " + "parsing " + Quote(e.Num) + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: NumError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + contains = function(s, c) { + var c, s; + return !((index(s, c) === -1)); }; - NumError.prototype.Error = function() { return this.$val.Error(); }; - syntaxError = function(fn, str) { - var fn, str; - return new NumError.ptr(fn, str, $pkg.ErrSyntax); + quoteWith = function(s, quote, ASCIIonly, graphicOnly) { + var ASCIIonly, _q, graphicOnly, quote, s; + return ($bytesToString(appendQuotedWith($makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))), s, quote, ASCIIonly, graphicOnly))); }; - rangeError = function(fn, str) { - var fn, str; - return new NumError.ptr(fn, str, $pkg.ErrRange); - }; - baseError = function(fn, str, base) { - var base, fn, str; - return new NumError.ptr(fn, str, errors.New("invalid base " + Itoa(base))); - }; - bitSizeError = function(fn, str, bitSize) { - var bitSize, fn, str; - return new NumError.ptr(fn, str, errors.New("invalid bit size " + Itoa(bitSize))); - }; - ParseUint = function(s, base, bitSize) { - var _1, _i, _ref, base, bitSize, c, cutoff, d, maxVal, n, n1, s, s0, x, x$1, x$2; - if (s.length === 0) { - return [new $Uint64(0, 0), syntaxError("ParseUint", s)]; + appendQuotedWith = function(buf, s, quote, ASCIIonly, graphicOnly) { + var ASCIIonly, _tuple, buf, graphicOnly, nBuf, quote, r, s, width; + if ((buf.$capacity - buf.$length >> 0) < s.length) { + nBuf = $makeSlice(sliceType$6, buf.$length, (((buf.$length + 1 >> 0) + s.length >> 0) + 1 >> 0)); + $copySlice(nBuf, buf); + buf = nBuf; } - s0 = s; - if (2 <= base && base <= 36) { - } else if ((base === 0)) { - if ((s.charCodeAt(0) === 48) && s.length > 1 && ((s.charCodeAt(1) === 120) || (s.charCodeAt(1) === 88))) { - if (s.length < 3) { - return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; - } - base = 16; - s = $substring(s, 2); - } else if ((s.charCodeAt(0) === 48)) { - base = 8; - s = $substring(s, 1); - } else { - base = 10; - } - } else { - return [new $Uint64(0, 0), baseError("ParseUint", s0, base)]; - } - if (bitSize === 0) { - bitSize = 32; - } else if (bitSize < 0 || bitSize > 64) { - return [new $Uint64(0, 0), bitSizeError("ParseUint", s0, bitSize)]; - } - cutoff = new $Uint64(0, 0); - _1 = base; - if (_1 === (10)) { - cutoff = new $Uint64(429496729, 2576980378); - } else if (_1 === (16)) { - cutoff = new $Uint64(268435456, 0); - } else { - cutoff = (x = $div64(new $Uint64(4294967295, 4294967295), (new $Uint64(0, base)), false), new $Uint64(x.$high + 0, x.$low + 1)); - } - maxVal = (x$1 = $shiftLeft64(new $Uint64(0, 1), ((bitSize >>> 0))), new $Uint64(x$1.$high - 0, x$1.$low - 1)); - n = new $Uint64(0, 0); - _ref = (new sliceType$6($stringToBytes(s))); - _i = 0; + buf = $append(buf, quote); + width = 0; while (true) { - if (!(_i < _ref.$length)) { break; } - c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - d = 0; - if (48 <= c && c <= 57) { - d = c - 48 << 24 >>> 24; - } else if (97 <= c && c <= 122) { - d = (c - 97 << 24 >>> 24) + 10 << 24 >>> 24; - } else if (65 <= c && c <= 90) { - d = (c - 65 << 24 >>> 24) + 10 << 24 >>> 24; - } else { - return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; + if (!(s.length > 0)) { break; } + r = ((s.charCodeAt(0) >> 0)); + width = 1; + if (r >= 128) { + _tuple = utf8.DecodeRuneInString(s); + r = _tuple[0]; + width = _tuple[1]; } - if (d >= ((base << 24 >>> 24))) { - return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; + if ((width === 1) && (r === 65533)) { + buf = $appendSlice(buf, "\\x"); + buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt(0) >>> 4 << 24 >>> 24))); + buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt(0) & 15) >>> 0))); + s = $substring(s, width); + continue; } - if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { - return [maxVal, rangeError("ParseUint", s0)]; - } - n = $mul64(n, ((new $Uint64(0, base)))); - n1 = (x$2 = (new $Uint64(0, d)), new $Uint64(n.$high + x$2.$high, n.$low + x$2.$low)); - if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) { - return [maxVal, rangeError("ParseUint", s0)]; - } - n = n1; - _i++; + buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); + s = $substring(s, width); } - return [n, $ifaceNil]; + buf = $append(buf, quote); + return buf; }; - $pkg.ParseUint = ParseUint; - ParseInt = function(s, base, bitSize) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, base, bitSize, cutoff, err, i, n, neg, s, s0, un, x, x$1; - i = new $Int64(0, 0); + appendQuotedRuneWith = function(buf, r, quote, ASCIIonly, graphicOnly) { + var ASCIIonly, buf, graphicOnly, quote, r; + buf = $append(buf, quote); + if (!utf8.ValidRune(r)) { + r = 65533; + } + buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); + buf = $append(buf, quote); + return buf; + }; + appendEscapedRune = function(buf, r, quote, ASCIIonly, graphicOnly) { + var ASCIIonly, _1, buf, graphicOnly, n, quote, r, runeTmp, s, s$1; + runeTmp = arrayType$1.zero(); + if ((r === ((quote >> 0))) || (r === 92)) { + buf = $append(buf, 92); + buf = $append(buf, ((r << 24 >>> 24))); + return buf; + } + if (ASCIIonly) { + if (r < 128 && IsPrint(r)) { + buf = $append(buf, ((r << 24 >>> 24))); + return buf; + } + } else if (IsPrint(r) || graphicOnly && isInGraphicList(r)) { + n = utf8.EncodeRune(new sliceType$6(runeTmp), r); + buf = $appendSlice(buf, $subslice(new sliceType$6(runeTmp), 0, n)); + return buf; + } + _1 = r; + if (_1 === (7)) { + buf = $appendSlice(buf, "\\a"); + } else if (_1 === (8)) { + buf = $appendSlice(buf, "\\b"); + } else if (_1 === (12)) { + buf = $appendSlice(buf, "\\f"); + } else if (_1 === (10)) { + buf = $appendSlice(buf, "\\n"); + } else if (_1 === (13)) { + buf = $appendSlice(buf, "\\r"); + } else if (_1 === (9)) { + buf = $appendSlice(buf, "\\t"); + } else if (_1 === (11)) { + buf = $appendSlice(buf, "\\v"); + } else { + if (r < 32) { + buf = $appendSlice(buf, "\\x"); + buf = $append(buf, "0123456789abcdef".charCodeAt((((r << 24 >>> 24)) >>> 4 << 24 >>> 24))); + buf = $append(buf, "0123456789abcdef".charCodeAt(((((r << 24 >>> 24)) & 15) >>> 0))); + } else if (!utf8.ValidRune(r)) { + r = 65533; + buf = $appendSlice(buf, "\\u"); + s = 12; + while (true) { + if (!(s >= 0)) { break; } + buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); + s = s - (4) >> 0; + } + } else if (r < 65536) { + buf = $appendSlice(buf, "\\u"); + s = 12; + while (true) { + if (!(s >= 0)) { break; } + buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); + s = s - (4) >> 0; + } + } else { + buf = $appendSlice(buf, "\\U"); + s$1 = 28; + while (true) { + if (!(s$1 >= 0)) { break; } + buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s$1 >>> 0)), 31)) >> 0) & 15))); + s$1 = s$1 - (4) >> 0; + } + } + } + return buf; + }; + Quote = function(s) { + var s; + return quoteWith(s, 34, false, false); + }; + $pkg.Quote = Quote; + AppendQuote = function(dst, s) { + var dst, s; + return appendQuotedWith(dst, s, 34, false, false); + }; + $pkg.AppendQuote = AppendQuote; + AppendQuoteToASCII = function(dst, s) { + var dst, s; + return appendQuotedWith(dst, s, 34, true, false); + }; + $pkg.AppendQuoteToASCII = AppendQuoteToASCII; + AppendQuoteRune = function(dst, r) { + var dst, r; + return appendQuotedRuneWith(dst, r, 39, false, false); + }; + $pkg.AppendQuoteRune = AppendQuoteRune; + AppendQuoteRuneToASCII = function(dst, r) { + var dst, r; + return appendQuotedRuneWith(dst, r, 39, true, false); + }; + $pkg.AppendQuoteRuneToASCII = AppendQuoteRuneToASCII; + CanBackquote = function(s) { + var _tuple, r, s, wid; + while (true) { + if (!(s.length > 0)) { break; } + _tuple = utf8.DecodeRuneInString(s); + r = _tuple[0]; + wid = _tuple[1]; + s = $substring(s, wid); + if (wid > 1) { + if (r === 65279) { + return false; + } + continue; + } + if (r === 65533) { + return false; + } + if ((r < 32 && !((r === 9))) || (r === 96) || (r === 127)) { + return false; + } + } + return true; + }; + $pkg.CanBackquote = CanBackquote; + unhex = function(b) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, c, ok, v; + v = 0; + ok = false; + c = ((b >> 0)); + if (48 <= c && c <= 57) { + _tmp = c - 48 >> 0; + _tmp$1 = true; + v = _tmp; + ok = _tmp$1; + return [v, ok]; + } else if (97 <= c && c <= 102) { + _tmp$2 = (c - 97 >> 0) + 10 >> 0; + _tmp$3 = true; + v = _tmp$2; + ok = _tmp$3; + return [v, ok]; + } else if (65 <= c && c <= 70) { + _tmp$4 = (c - 65 >> 0) + 10 >> 0; + _tmp$5 = true; + v = _tmp$4; + ok = _tmp$5; + return [v, ok]; + } + return [v, ok]; + }; + UnquoteChar = function(s, quote) { + var _1, _2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, c, c$1, err, j, j$1, multibyte, n, ok, quote, r, s, size, tail, v, v$1, value, x, x$1; + value = 0; + multibyte = false; + tail = ""; err = $ifaceNil; if (s.length === 0) { - _tmp = new $Int64(0, 0); - _tmp$1 = syntaxError("ParseInt", s); - i = _tmp; - err = _tmp$1; - return [i, err]; + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; } - s0 = s; - neg = false; - if (s.charCodeAt(0) === 43) { - s = $substring(s, 1); - } else if (s.charCodeAt(0) === 45) { - neg = true; - s = $substring(s, 1); - } - un = new $Uint64(0, 0); - _tuple = ParseUint(s, base, bitSize); - un = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual($assertType(err, ptrType).Err, $pkg.ErrRange))) { - $assertType(err, ptrType).Func = "ParseInt"; - $assertType(err, ptrType).Num = s0; - _tmp$2 = new $Int64(0, 0); - _tmp$3 = err; - i = _tmp$2; + c = s.charCodeAt(0); + if ((c === quote) && ((quote === 39) || (quote === 34))) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } else if (c >= 128) { + _tuple = utf8.DecodeRuneInString(s); + r = _tuple[0]; + size = _tuple[1]; + _tmp = r; + _tmp$1 = true; + _tmp$2 = $substring(s, size); + _tmp$3 = $ifaceNil; + value = _tmp; + multibyte = _tmp$1; + tail = _tmp$2; err = _tmp$3; - return [i, err]; - } - if (bitSize === 0) { - bitSize = 32; - } - cutoff = ($shiftLeft64(new $Uint64(0, 1), (((bitSize - 1 >> 0) >>> 0)))); - if (!neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low >= cutoff.$low))) { - _tmp$4 = ((x = new $Uint64(cutoff.$high - 0, cutoff.$low - 1), new $Int64(x.$high, x.$low))); - _tmp$5 = rangeError("ParseInt", s0); - i = _tmp$4; - err = _tmp$5; - return [i, err]; - } - if (neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low > cutoff.$low))) { - _tmp$6 = (x$1 = (new $Int64(cutoff.$high, cutoff.$low)), new $Int64(-x$1.$high, -x$1.$low)); - _tmp$7 = rangeError("ParseInt", s0); - i = _tmp$6; + return [value, multibyte, tail, err]; + } else if (!((c === 92))) { + _tmp$4 = ((s.charCodeAt(0) >> 0)); + _tmp$5 = false; + _tmp$6 = $substring(s, 1); + _tmp$7 = $ifaceNil; + value = _tmp$4; + multibyte = _tmp$5; + tail = _tmp$6; err = _tmp$7; - return [i, err]; + return [value, multibyte, tail, err]; } - n = (new $Int64(un.$high, un.$low)); - if (neg) { - n = new $Int64(-n.$high, -n.$low); + if (s.length <= 1) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; } - _tmp$8 = n; - _tmp$9 = $ifaceNil; - i = _tmp$8; - err = _tmp$9; - return [i, err]; + c$1 = s.charCodeAt(1); + s = $substring(s, 2); + switch (0) { default: + _1 = c$1; + if (_1 === (97)) { + value = 7; + } else if (_1 === (98)) { + value = 8; + } else if (_1 === (102)) { + value = 12; + } else if (_1 === (110)) { + value = 10; + } else if (_1 === (114)) { + value = 13; + } else if (_1 === (116)) { + value = 9; + } else if (_1 === (118)) { + value = 11; + } else if ((_1 === (120)) || (_1 === (117)) || (_1 === (85))) { + n = 0; + _2 = c$1; + if (_2 === (120)) { + n = 2; + } else if (_2 === (117)) { + n = 4; + } else if (_2 === (85)) { + n = 8; + } + v = 0; + if (s.length < n) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + j = 0; + while (true) { + if (!(j < n)) { break; } + _tuple$1 = unhex(s.charCodeAt(j)); + x = _tuple$1[0]; + ok = _tuple$1[1]; + if (!ok) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + v = (v << 4 >> 0) | x; + j = j + (1) >> 0; + } + s = $substring(s, n); + if (c$1 === 120) { + value = v; + break; + } + if (!utf8.ValidRune(v)) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + value = v; + multibyte = true; + } else if ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55))) { + v$1 = ((c$1 >> 0)) - 48 >> 0; + if (s.length < 2) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + j$1 = 0; + while (true) { + if (!(j$1 < 2)) { break; } + x$1 = ((s.charCodeAt(j$1) >> 0)) - 48 >> 0; + if (x$1 < 0 || x$1 > 7) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + v$1 = ((v$1 << 3 >> 0)) | x$1; + j$1 = j$1 + (1) >> 0; + } + s = $substring(s, 2); + if (v$1 > 255) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + value = v$1; + } else if (_1 === (92)) { + value = 92; + } else if ((_1 === (39)) || (_1 === (34))) { + if (!((c$1 === quote))) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + value = ((c$1 >> 0)); + } else { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + } + tail = s; + return [value, multibyte, tail, err]; }; - $pkg.ParseInt = ParseInt; - Atoi = function(s) { - var _i, _ref, _tuple, _tuple$1, ch, err, i64, n, nerr, ok, s, s0, sLen; - sLen = s.length; - if (true && (0 < sLen && sLen < 10) || false && (0 < sLen && sLen < 19)) { - s0 = s; - if ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43)) { - s = $substring(s, 1); - if (s.length < 1) { - return [0, new NumError.ptr("Atoi", s0, $pkg.ErrSyntax)]; + $pkg.UnquoteChar = UnquoteChar; + Unquote = function(s) { + var _tuple, err, out, rem, s; + _tuple = unquote(s, true); + out = _tuple[0]; + rem = _tuple[1]; + err = _tuple[2]; + if (rem.length > 0) { + return ["", $pkg.ErrSyntax]; + } + return [out, err]; + }; + $pkg.Unquote = Unquote; + unquote = function(in$1, unescape) { + var _1, _2, _q, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, arr, buf, buf$1, end, err, err$1, i, in$1, in0, multibyte, n, n$1, out, quote, r, r$1, rem, rem$1, unescape, valid; + out = ""; + rem = ""; + err = $ifaceNil; + if (in$1.length < 2) { + _tmp = ""; + _tmp$1 = in$1; + _tmp$2 = $pkg.ErrSyntax; + out = _tmp; + rem = _tmp$1; + err = _tmp$2; + return [out, rem, err]; + } + quote = in$1.charCodeAt(0); + end = index($substring(in$1, 1), quote); + if (end < 0) { + _tmp$3 = ""; + _tmp$4 = in$1; + _tmp$5 = $pkg.ErrSyntax; + out = _tmp$3; + rem = _tmp$4; + err = _tmp$5; + return [out, rem, err]; + } + end = end + (2) >> 0; + _1 = quote; + if (_1 === (96)) { + if (!unescape) { + out = $substring(in$1, 0, end); + } else if (!contains($substring(in$1, 0, end), 13)) { + out = $substring(in$1, 1, (end - 1 >> 0)); + } else { + buf = $makeSlice(sliceType$6, 0, (((end - 1 >> 0) - 1 >> 0) - 1 >> 0)); + i = 1; + while (true) { + if (!(i < (end - 1 >> 0))) { break; } + if (!((in$1.charCodeAt(i) === 13))) { + buf = $append(buf, in$1.charCodeAt(i)); + } + i = i + (1) >> 0; + } + out = ($bytesToString(buf)); + } + _tmp$6 = out; + _tmp$7 = $substring(in$1, end); + _tmp$8 = $ifaceNil; + out = _tmp$6; + rem = _tmp$7; + err = _tmp$8; + return [out, rem, err]; + } else if ((_1 === (34)) || (_1 === (39))) { + if (!contains($substring(in$1, 0, end), 92) && !contains($substring(in$1, 0, end), 10)) { + valid = false; + _2 = quote; + if (_2 === (34)) { + valid = utf8.ValidString($substring(in$1, 1, (end - 1 >> 0))); + } else if (_2 === (39)) { + _tuple = utf8.DecodeRuneInString($substring(in$1, 1, (end - 1 >> 0))); + r = _tuple[0]; + n = _tuple[1]; + valid = (((1 + n >> 0) + 1 >> 0) === end) && (!((r === 65533)) || !((n === 1))); + } + if (valid) { + out = $substring(in$1, 0, end); + if (unescape) { + out = $substring(out, 1, (end - 1 >> 0)); + } + _tmp$9 = out; + _tmp$10 = $substring(in$1, end); + _tmp$11 = $ifaceNil; + out = _tmp$9; + rem = _tmp$10; + err = _tmp$11; + return [out, rem, err]; } } - n = 0; - _ref = (new sliceType$6($stringToBytes(s))); - _i = 0; + buf$1 = sliceType$6.nil; + in0 = in$1; + in$1 = $substring(in$1, 1); + if (unescape) { + buf$1 = $makeSlice(sliceType$6, 0, (_q = ($imul(3, end)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); + } while (true) { - if (!(_i < _ref.$length)) { break; } - ch = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - ch = ch - (48) << 24 >>> 24; - if (ch > 9) { - return [0, new NumError.ptr("Atoi", s0, $pkg.ErrSyntax)]; + if (!(in$1.length > 0 && !((in$1.charCodeAt(0) === quote)))) { break; } + _tuple$1 = UnquoteChar(in$1, quote); + r$1 = _tuple$1[0]; + multibyte = _tuple$1[1]; + rem$1 = _tuple$1[2]; + err$1 = _tuple$1[3]; + if ((in$1.charCodeAt(0) === 10) || !($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp$12 = ""; + _tmp$13 = in0; + _tmp$14 = $pkg.ErrSyntax; + out = _tmp$12; + rem = _tmp$13; + err = _tmp$14; + return [out, rem, err]; + } + in$1 = rem$1; + if (unescape) { + if (r$1 < 128 || !multibyte) { + buf$1 = $append(buf$1, ((r$1 << 24 >>> 24))); + } else { + arr = arrayType$1.zero(); + n$1 = utf8.EncodeRune(new sliceType$6(arr), r$1); + buf$1 = $appendSlice(buf$1, $subslice(new sliceType$6(arr), 0, n$1)); + } + } + if (quote === 39) { + break; } - n = ($imul(n, 10)) + ((ch >> 0)) >> 0; - _i++; } - if (s0.charCodeAt(0) === 45) { - n = -n; + if (!(in$1.length > 0 && (in$1.charCodeAt(0) === quote))) { + _tmp$15 = ""; + _tmp$16 = in0; + _tmp$17 = $pkg.ErrSyntax; + out = _tmp$15; + rem = _tmp$16; + err = _tmp$17; + return [out, rem, err]; } - return [n, $ifaceNil]; + in$1 = $substring(in$1, 1); + if (unescape) { + _tmp$18 = ($bytesToString(buf$1)); + _tmp$19 = in$1; + _tmp$20 = $ifaceNil; + out = _tmp$18; + rem = _tmp$19; + err = _tmp$20; + return [out, rem, err]; + } + _tmp$21 = $substring(in0, 0, (in0.length - in$1.length >> 0)); + _tmp$22 = in$1; + _tmp$23 = $ifaceNil; + out = _tmp$21; + rem = _tmp$22; + err = _tmp$23; + return [out, rem, err]; + } else { + _tmp$24 = ""; + _tmp$25 = in$1; + _tmp$26 = $pkg.ErrSyntax; + out = _tmp$24; + rem = _tmp$25; + err = _tmp$26; + return [out, rem, err]; } - _tuple = ParseInt(s, 10, 0); - i64 = _tuple[0]; - err = _tuple[1]; - _tuple$1 = $assertType(err, ptrType, true); - nerr = _tuple$1[0]; - ok = _tuple$1[1]; - if (ok) { - nerr.Func = "Atoi"; + }; + bsearch16 = function(a, x) { + var _tmp, _tmp$1, a, h, i, j, x; + _tmp = 0; + _tmp$1 = a.$length; + i = _tmp; + j = _tmp$1; + while (true) { + if (!(i < j)) { break; } + h = i + (((j - i >> 0)) >> 1 >> 0) >> 0; + if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { + i = h + 1 >> 0; + } else { + j = h; + } } - return [(((i64.$low + ((i64.$high >> 31) * 4294967296)) >> 0)), err]; + return i; + }; + bsearch32 = function(a, x) { + var _tmp, _tmp$1, a, h, i, j, x; + _tmp = 0; + _tmp$1 = a.$length; + i = _tmp; + j = _tmp$1; + while (true) { + if (!(i < j)) { break; } + h = i + (((j - i >> 0)) >> 1 >> 0) >> 0; + if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { + i = h + 1 >> 0; + } else { + j = h; + } + } + return i; + }; + IsPrint = function(r) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, i, i$1, isNotPrint, isNotPrint$1, isPrint, isPrint$1, j, j$1, r, rr, rr$1, x, x$1, x$2, x$3; + if (r <= 255) { + if (32 <= r && r <= 126) { + return true; + } + if (161 <= r && r <= 255) { + return !((r === 173)); + } + return false; + } + if (0 <= r && r < 65536) { + _tmp = ((r << 16 >>> 16)); + _tmp$1 = isPrint16; + _tmp$2 = isNotPrint16; + rr = _tmp; + isPrint = _tmp$1; + isNotPrint = _tmp$2; + i = bsearch16(isPrint, rr); + if (i >= isPrint.$length || rr < (x = (i & ~1) >> 0, ((x < 0 || x >= isPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint.$array[isPrint.$offset + x])) || (x$1 = i | 1, ((x$1 < 0 || x$1 >= isPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint.$array[isPrint.$offset + x$1])) < rr) { + return false; + } + j = bsearch16(isNotPrint, rr); + return j >= isNotPrint.$length || !((((j < 0 || j >= isNotPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isNotPrint.$array[isNotPrint.$offset + j]) === rr)); + } + _tmp$3 = ((r >>> 0)); + _tmp$4 = isPrint32; + _tmp$5 = isNotPrint32; + rr$1 = _tmp$3; + isPrint$1 = _tmp$4; + isNotPrint$1 = _tmp$5; + i$1 = bsearch32(isPrint$1, rr$1); + if (i$1 >= isPrint$1.$length || rr$1 < (x$2 = (i$1 & ~1) >> 0, ((x$2 < 0 || x$2 >= isPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint$1.$array[isPrint$1.$offset + x$2])) || (x$3 = i$1 | 1, ((x$3 < 0 || x$3 >= isPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint$1.$array[isPrint$1.$offset + x$3])) < rr$1) { + return false; + } + if (r >= 131072) { + return true; + } + r = r - (65536) >> 0; + j$1 = bsearch16(isNotPrint$1, ((r << 16 >>> 16))); + return j$1 >= isNotPrint$1.$length || !((((j$1 < 0 || j$1 >= isNotPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isNotPrint$1.$array[isNotPrint$1.$offset + j$1]) === ((r << 16 >>> 16)))); + }; + $pkg.IsPrint = IsPrint; + isInGraphicList = function(r) { + var i, r, rr; + if (r > 65535) { + return false; + } + rr = ((r << 16 >>> 16)); + i = bsearch16(isGraphic, rr); + return i < isGraphic.$length && (rr === ((i < 0 || i >= isGraphic.$length) ? ($throwRuntimeError("index out of range"), undefined) : isGraphic.$array[isGraphic.$offset + i])); + }; + FormatInt = function(i, base) { + var _tuple, base, i, s; + if (true && (0 < i.$high || (0 === i.$high && 0 <= i.$low)) && (i.$high < 0 || (i.$high === 0 && i.$low < 100)) && (base === 10)) { + return small((((i.$low + ((i.$high >> 31) * 4294967296)) >> 0))); + } + _tuple = formatBits(sliceType$6.nil, (new $Uint64(i.$high, i.$low)), base, (i.$high < 0 || (i.$high === 0 && i.$low < 0)), false); + s = _tuple[1]; + return s; + }; + $pkg.FormatInt = FormatInt; + small = function(i) { + var i; + if (i < 10) { + return $substring("0123456789abcdefghijklmnopqrstuvwxyz", i, (i + 1 >> 0)); + } + return $substring("00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899", ($imul(i, 2)), (($imul(i, 2)) + 2 >> 0)); + }; + formatBits = function(dst, u, base, neg, append_) { + var _q, _q$1, _r, _r$1, a, append_, b, b$1, base, d, dst, i, is, is$1, is$2, j, m, neg, q, q$1, s, shift, u, us, us$1, x, x$1, x$2, x$3, x$4, x$5; + d = sliceType$6.nil; + s = ""; + if (base < 2 || base > 36) { + $panic(new $String("strconv: illegal AppendInt/FormatInt base")); + } + a = arrayType$2.zero(); + i = 65; + if (neg) { + u = new $Uint64(-u.$high, -u.$low); + } + if (base === 10) { + if (true) { + while (true) { + if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 1000000000)))) { break; } + q = $div64(u, new $Uint64(0, 1000000000), false); + us = (((x = $mul64(q, new $Uint64(0, 1000000000)), new $Uint64(u.$high - x.$high, u.$low - x.$low)).$low >>> 0)); + j = 4; + while (true) { + if (!(j > 0)) { break; } + is = (_r = us % 100, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; + us = (_q = us / (100), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + i = i - (2) >> 0; + (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$1] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 1 >>> 0)))); + (x$2 = i + 0 >> 0, ((x$2 < 0 || x$2 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$2] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 0 >>> 0)))); + j = j - (1) >> 0; + } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(((us * 2 >>> 0) + 1 >>> 0))); + u = q; + } + } + us$1 = ((u.$low >>> 0)); + while (true) { + if (!(us$1 >= 100)) { break; } + is$1 = (_r$1 = us$1 % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; + us$1 = (_q$1 = us$1 / (100), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); + i = i - (2) >> 0; + (x$3 = i + 1 >> 0, ((x$3 < 0 || x$3 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$3] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 1 >>> 0)))); + (x$4 = i + 0 >> 0, ((x$4 < 0 || x$4 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$4] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 0 >>> 0)))); + } + is$2 = us$1 * 2 >>> 0; + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$2 + 1 >>> 0))); + if (us$1 >= 10) { + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(is$2)); + } + } else if (isPowerOfTwo(base)) { + shift = (((bits.TrailingZeros(((base >>> 0))) >>> 0)) & 7) >>> 0; + b = (new $Uint64(0, base)); + m = ((base >>> 0)) - 1 >>> 0; + while (true) { + if (!((u.$high > b.$high || (u.$high === b.$high && u.$low >= b.$low)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((((u.$low >>> 0)) & m) >>> 0))); + u = $shiftRightUint64(u, (shift)); + } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((u.$low >>> 0)))); + } else { + b$1 = (new $Uint64(0, base)); + while (true) { + if (!((u.$high > b$1.$high || (u.$high === b$1.$high && u.$low >= b$1.$low)))) { break; } + i = i - (1) >> 0; + q$1 = $div64(u, b$1, false); + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((((x$5 = $mul64(q$1, b$1), new $Uint64(u.$high - x$5.$high, u.$low - x$5.$low)).$low >>> 0)))); + u = q$1; + } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((u.$low >>> 0)))); + } + if (neg) { + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = 45); + } + if (append_) { + d = $appendSlice(dst, $subslice(new sliceType$6(a), i)); + return [d, s]; + } + s = ($bytesToString($subslice(new sliceType$6(a), i))); + return [d, s]; + }; + isPowerOfTwo = function(x) { + var x; + return (x & ((x - 1 >> 0))) === 0; + }; + Itoa = function(i) { + var i; + return $internalize(i.toString(), $String); + }; + $pkg.Itoa = Itoa; + Atoi = function(s) { + var floatval, i, jsValue, s, v; + if (s.length === 0) { + return [0, syntaxError("Atoi", s)]; + } + i = 0; + while (true) { + if (!(i < s.length)) { break; } + v = s.charCodeAt(i); + if (v < 48 || v > 57) { + if (!((v === 43)) && !((v === 45))) { + return [0, syntaxError("Atoi", s)]; + } + } + i = i + (1) >> 0; + } + jsValue = $global.Number($externalize(s, $String), 10); + if (!!!($global.isFinite(jsValue))) { + return [0, syntaxError("Atoi", s)]; + } + floatval = $parseFloat(jsValue); + if (floatval > 2.147483647e+09) { + return [2147483647, rangeError("Atoi", s)]; + } else if (floatval < -2.147483648e+09) { + return [-2147483648, rangeError("Atoi", s)]; + } + return [$parseInt(jsValue) >> 0, $ifaceNil]; }; $pkg.Atoi = Atoi; + ryuFtoaFixed32 = function(d, mant, exp, prec) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, d, d0, dexp2, dfrac, di, e2, exact, exp, extra, extraMask, mant, prec, q, roundUp, y, y$1, y$2, y$3, y$4, y$5, y$6; + if (prec < 0) { + $panic(new $String("ryuFtoaFixed32 called with negative prec")); + } + if (prec > 9) { + $panic(new $String("ryuFtoaFixed32 called with prec > 9")); + } + if (mant === 0) { + _tmp = 0; + _tmp$1 = 0; + d.nd = _tmp; + d.dp = _tmp$1; + return; + } + e2 = exp; + b = bits.Len32(mant); + if (b < 25) { + mant = (y = ((((25 - b >> 0) >>> 0))), y < 32 ? (mant << y) : 0) >>> 0; + e2 = e2 + (((b) - 25 >> 0)) >> 0; + } + q = (-mulByLog2Log10(e2 + 24 >> 0) + prec >> 0) - 1 >> 0; + exact = q <= 27 && q >= 0; + _tuple = mult64bitPow10(mant, e2, q); + di = _tuple[0]; + dexp2 = _tuple[1]; + d0 = _tuple[2]; + if (dexp2 >= 0) { + $panic(new $String("not enough significant bits after mult64bitPow10")); + } + if (q < 0 && q >= -10 && divisibleByPower5((new $Uint64(0, mant)), -q)) { + exact = true; + d0 = true; + } + extra = ((-dexp2 >>> 0)); + extraMask = ((((y$1 = extra, y$1 < 32 ? (1 << y$1) : 0) >>> 0) - 1 >>> 0)); + _tmp$2 = (y$2 = extra, y$2 < 32 ? (di >>> y$2) : 0) >>> 0; + _tmp$3 = (di & extraMask) >>> 0; + di = _tmp$2; + dfrac = _tmp$3; + roundUp = false; + if (exact) { + roundUp = dfrac > ((y$3 = ((extra - 1 >>> 0)), y$3 < 32 ? (1 << y$3) : 0) >>> 0) || ((dfrac === ((y$4 = ((extra - 1 >>> 0)), y$4 < 32 ? (1 << y$4) : 0) >>> 0)) && !d0) || ((dfrac === ((y$5 = ((extra - 1 >>> 0)), y$5 < 32 ? (1 << y$5) : 0) >>> 0)) && d0 && (((di & 1) >>> 0) === 1)); + } else { + roundUp = ((y$6 = ((extra - 1 >>> 0)), y$6 < 32 ? (dfrac >>> y$6) : 0) >>> 0) === 1; + } + if (!((dfrac === 0))) { + d0 = false; + } + formatDecimal(d, (new $Uint64(0, di)), !d0, roundUp, prec); + d.dp = d.dp - (q) >> 0; + }; + ryuFtoaFixed64 = function(d, mant, exp, prec) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, d, d0, dexp2, dfrac, di, e2, exact, exp, extra, extraMask, mant, prec, q, roundUp, x, x$1, x$2, x$3, x$4, x$5; + if (prec > 18) { + $panic(new $String("ryuFtoaFixed64 called with prec > 18")); + } + if ((mant.$high === 0 && mant.$low === 0)) { + _tmp = 0; + _tmp$1 = 0; + d.nd = _tmp; + d.dp = _tmp$1; + return; + } + e2 = exp; + b = bits.Len64(mant); + if (b < 55) { + mant = $shiftLeft64(mant, (((55 - b >> 0) >>> 0))); + e2 = e2 + (((b) - 55 >> 0)) >> 0; + } + q = (-mulByLog2Log10(e2 + 54 >> 0) + prec >> 0) - 1 >> 0; + exact = q <= 55 && q >= 0; + _tuple = mult128bitPow10(mant, e2, q); + di = _tuple[0]; + dexp2 = _tuple[1]; + d0 = _tuple[2]; + if (dexp2 >= 0) { + $panic(new $String("not enough significant bits after mult128bitPow10")); + } + if (q < 0 && q >= -22 && divisibleByPower5(mant, -q)) { + exact = true; + d0 = true; + } + extra = ((-dexp2 >>> 0)); + extraMask = ((x = $shiftLeft64(new $Uint64(0, 1), extra), new $Uint64(x.$high - 0, x.$low - 1))); + _tmp$2 = $shiftRightUint64(di, extra); + _tmp$3 = new $Uint64(di.$high & extraMask.$high, (di.$low & extraMask.$low) >>> 0); + di = _tmp$2; + dfrac = _tmp$3; + roundUp = false; + if (exact) { + roundUp = (x$1 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (dfrac.$high > x$1.$high || (dfrac.$high === x$1.$high && dfrac.$low > x$1.$low))) || ((x$2 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (dfrac.$high === x$2.$high && dfrac.$low === x$2.$low)) && !d0) || ((x$3 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (dfrac.$high === x$3.$high && dfrac.$low === x$3.$low)) && d0 && (x$4 = new $Uint64(di.$high & 0, (di.$low & 1) >>> 0), (x$4.$high === 0 && x$4.$low === 1))); + } else { + roundUp = (x$5 = $shiftRightUint64(dfrac, ((extra - 1 >>> 0))), (x$5.$high === 0 && x$5.$low === 1)); + } + if (!((dfrac.$high === 0 && dfrac.$low === 0))) { + d0 = false; + } + formatDecimal(d, di, !d0, roundUp, prec); + d.dp = d.dp - (q) >> 0; + }; + formatDecimal = function(d, m, trunc, roundUp, prec) { + var _q, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, a, b, d, m, max$1, n, prec, roundUp, trimmed, trunc, v, v1, v2, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + max$1 = ((prec < 0 || prec >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[prec]); + trimmed = 0; + while (true) { + if (!((m.$high > max$1.$high || (m.$high === max$1.$high && m.$low >= max$1.$low)))) { break; } + _tmp = $div64(m, new $Uint64(0, 10), false); + _tmp$1 = $div64(m, new $Uint64(0, 10), true); + a = _tmp; + b = _tmp$1; + m = a; + trimmed = trimmed + (1) >> 0; + if ((b.$high > 0 || (b.$high === 0 && b.$low > 5))) { + roundUp = true; + } else if ((b.$high < 0 || (b.$high === 0 && b.$low < 5))) { + roundUp = false; + } else { + roundUp = trunc || (x = new $Uint64(m.$high & 0, (m.$low & 1) >>> 0), (x.$high === 0 && x.$low === 1)); + } + if (!((b.$high === 0 && b.$low === 0))) { + trunc = true; + } + } + if (roundUp) { + m = (x$1 = new $Uint64(0, 1), new $Uint64(m.$high + x$1.$high, m.$low + x$1.$low)); + } + if ((m.$high > max$1.$high || (m.$high === max$1.$high && m.$low >= max$1.$low))) { + m = $div64(m, (new $Uint64(0, 10)), false); + trimmed = trimmed + (1) >> 0; + } + n = ((prec >>> 0)); + d.nd = (prec); + v = m; + while (true) { + if (!((v.$high > 0 || (v.$high === 0 && v.$low >= 100)))) { break; } + _tmp$2 = new $Uint64(0, 0); + _tmp$3 = new $Uint64(0, 0); + v1 = _tmp$2; + v2 = _tmp$3; + if ((x$2 = $shiftRightUint64(v, 32), (x$2.$high === 0 && x$2.$low === 0))) { + _tmp$4 = (new $Uint64(0, (_q = ((v.$low >>> 0)) / 100, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")))); + _tmp$5 = (new $Uint64(0, (_r = ((v.$low >>> 0)) % 100, _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); + v1 = _tmp$4; + v2 = _tmp$5; + } else { + _tmp$6 = $div64(v, new $Uint64(0, 100), false); + _tmp$7 = $div64(v, new $Uint64(0, 100), true); + v1 = _tmp$6; + v2 = _tmp$7; + } + n = n - (2) >>> 0; + (x$4 = d.d, x$5 = n + 1 >>> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64((x$3 = $mul64(new $Uint64(0, 2), v2), new $Uint64(x$3.$high + 0, x$3.$low + 1)))))); + (x$7 = d.d, x$8 = n + 0 >>> 0, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64((x$6 = $mul64(new $Uint64(0, 2), v2), new $Uint64(x$6.$high + 0, x$6.$low + 0)))))); + v = v1; + } + if ((v.$high > 0 || (v.$high === 0 && v.$low > 0))) { + n = n - (1) >>> 0; + (x$10 = d.d, ((n < 0 || n >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + n] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64((x$9 = $mul64(new $Uint64(0, 2), v), new $Uint64(x$9.$high + 0, x$9.$low + 1)))))); + } + if ((v.$high > 0 || (v.$high === 0 && v.$low >= 10))) { + n = n - (1) >>> 0; + (x$11 = d.d, ((n < 0 || n >= x$11.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$11.$array[x$11.$offset + n] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64($mul64(new $Uint64(0, 2), v))))); + } + while (true) { + if (!((x$12 = d.d, x$13 = d.nd - 1 >> 0, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13])) === 48)) { break; } + d.nd = d.nd - (1) >> 0; + trimmed = trimmed + (1) >> 0; + } + d.dp = d.nd + trimmed >> 0; + }; + ryuFtoaShortest = function(d, mant, exp, flt) { + var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, c0, cup, d, dc, dc0, dc32, dl, dl0, dl32, du, du0, du32, e2, exp, extra, extraMask, flt, fracc, fracl, fracu, lok, mant, mc, ml, mu, q, uok, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; + if ((mant.$high === 0 && mant.$low === 0)) { + _tmp = 0; + _tmp$1 = 0; + d.nd = _tmp; + d.dp = _tmp$1; + return; + } + if (exp <= 0 && bits.TrailingZeros64(mant) >= -exp) { + mant = $shiftRightUint64(mant, (((-exp >>> 0)))); + ryuDigits(d, mant, mant, mant, true, false); + return; + } + _tuple = computeBounds(mant, exp, flt); + ml = _tuple[0]; + mc = _tuple[1]; + mu = _tuple[2]; + e2 = _tuple[3]; + if (e2 === 0) { + ryuDigits(d, ml, mc, mu, true, false); + return; + } + q = mulByLog2Log10(-e2) + 1 >> 0; + _tmp$2 = new $Uint64(0, 0); + _tmp$3 = new $Uint64(0, 0); + _tmp$4 = new $Uint64(0, 0); + dl = _tmp$2; + dc = _tmp$3; + du = _tmp$4; + _tmp$5 = false; + _tmp$6 = false; + _tmp$7 = false; + dl0 = _tmp$5; + dc0 = _tmp$6; + du0 = _tmp$7; + if (flt === float32info) { + _tmp$8 = 0; + _tmp$9 = 0; + _tmp$10 = 0; + dl32 = _tmp$8; + dc32 = _tmp$9; + du32 = _tmp$10; + _tuple$1 = mult64bitPow10(((ml.$low >>> 0)), e2, q); + dl32 = _tuple$1[0]; + dl0 = _tuple$1[2]; + _tuple$2 = mult64bitPow10(((mc.$low >>> 0)), e2, q); + dc32 = _tuple$2[0]; + dc0 = _tuple$2[2]; + _tuple$3 = mult64bitPow10(((mu.$low >>> 0)), e2, q); + du32 = _tuple$3[0]; + e2 = _tuple$3[1]; + du0 = _tuple$3[2]; + _tmp$11 = (new $Uint64(0, dl32)); + _tmp$12 = (new $Uint64(0, dc32)); + _tmp$13 = (new $Uint64(0, du32)); + dl = _tmp$11; + dc = _tmp$12; + du = _tmp$13; + } else { + _tuple$4 = mult128bitPow10(ml, e2, q); + dl = _tuple$4[0]; + dl0 = _tuple$4[2]; + _tuple$5 = mult128bitPow10(mc, e2, q); + dc = _tuple$5[0]; + dc0 = _tuple$5[2]; + _tuple$6 = mult128bitPow10(mu, e2, q); + du = _tuple$6[0]; + e2 = _tuple$6[1]; + du0 = _tuple$6[2]; + } + if (e2 >= 0) { + $panic(new $String("not enough significant bits after mult128bitPow10")); + } + if (q > 55) { + _tmp$14 = false; + _tmp$15 = false; + _tmp$16 = false; + dl0 = _tmp$14; + dc0 = _tmp$15; + du0 = _tmp$16; + } + if (q < 0 && q >= -24) { + if (divisibleByPower5(ml, -q)) { + dl0 = true; + } + if (divisibleByPower5(mc, -q)) { + dc0 = true; + } + if (divisibleByPower5(mu, -q)) { + du0 = true; + } + } + extra = ((-e2 >>> 0)); + extraMask = ((x = $shiftLeft64(new $Uint64(0, 1), extra), new $Uint64(x.$high - 0, x.$low - 1))); + _tmp$17 = $shiftRightUint64(dl, extra); + _tmp$18 = new $Uint64(dl.$high & extraMask.$high, (dl.$low & extraMask.$low) >>> 0); + dl = _tmp$17; + fracl = _tmp$18; + _tmp$19 = $shiftRightUint64(dc, extra); + _tmp$20 = new $Uint64(dc.$high & extraMask.$high, (dc.$low & extraMask.$low) >>> 0); + dc = _tmp$19; + fracc = _tmp$20; + _tmp$21 = $shiftRightUint64(du, extra); + _tmp$22 = new $Uint64(du.$high & extraMask.$high, (du.$low & extraMask.$low) >>> 0); + du = _tmp$21; + fracu = _tmp$22; + uok = !du0 || (fracu.$high > 0 || (fracu.$high === 0 && fracu.$low > 0)); + if (du0 && (fracu.$high === 0 && fracu.$low === 0)) { + uok = (x$1 = new $Uint64(mant.$high & 0, (mant.$low & 1) >>> 0), (x$1.$high === 0 && x$1.$low === 0)); + } + if (!uok) { + du = (x$2 = new $Uint64(0, 1), new $Uint64(du.$high - x$2.$high, du.$low - x$2.$low)); + } + cup = false; + if (dc0) { + cup = (x$3 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (fracc.$high > x$3.$high || (fracc.$high === x$3.$high && fracc.$low > x$3.$low))) || ((x$4 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (fracc.$high === x$4.$high && fracc.$low === x$4.$low)) && (x$5 = new $Uint64(dc.$high & 0, (dc.$low & 1) >>> 0), (x$5.$high === 0 && x$5.$low === 1))); + } else { + cup = (x$6 = $shiftRightUint64(fracc, ((extra - 1 >>> 0))), (x$6.$high === 0 && x$6.$low === 1)); + } + lok = dl0 && (fracl.$high === 0 && fracl.$low === 0) && ((x$7 = new $Uint64(mant.$high & 0, (mant.$low & 1) >>> 0), (x$7.$high === 0 && x$7.$low === 0))); + if (!lok) { + dl = (x$8 = new $Uint64(0, 1), new $Uint64(dl.$high + x$8.$high, dl.$low + x$8.$low)); + } + c0 = dc0 && (fracc.$high === 0 && fracc.$low === 0); + ryuDigits(d, dl, dc, du, c0, cup); + d.dp = d.dp - (q) >> 0; + }; + mulByLog2Log10 = function(x) { + var x; + return (($imul(x, 78913))) >> 18 >> 0; + }; + mulByLog10Log2 = function(x) { + var x; + return (($imul(x, 108853))) >> 15 >> 0; + }; + computeBounds = function(mant, exp, flt) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, central, e2, exp, flt, lower$1, mant, upper, x, x$1, x$2, x$3, x$4; + lower$1 = new $Uint64(0, 0); + central = new $Uint64(0, 0); + upper = new $Uint64(0, 0); + e2 = 0; + if (!((x = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high === x.$high && mant.$low === x.$low))) || (exp === ((flt.bias + 1 >> 0) - ((flt.mantbits >> 0)) >> 0))) { + _tmp = (x$1 = $mul64(new $Uint64(0, 2), mant), new $Uint64(x$1.$high - 0, x$1.$low - 1)); + _tmp$1 = $mul64(new $Uint64(0, 2), mant); + _tmp$2 = (x$2 = $mul64(new $Uint64(0, 2), mant), new $Uint64(x$2.$high + 0, x$2.$low + 1)); + lower$1 = _tmp; + central = _tmp$1; + upper = _tmp$2; + e2 = exp - 1 >> 0; + return [lower$1, central, upper, e2]; + } else { + _tmp$3 = (x$3 = $mul64(new $Uint64(0, 4), mant), new $Uint64(x$3.$high - 0, x$3.$low - 1)); + _tmp$4 = $mul64(new $Uint64(0, 4), mant); + _tmp$5 = (x$4 = $mul64(new $Uint64(0, 4), mant), new $Uint64(x$4.$high + 0, x$4.$low + 2)); + lower$1 = _tmp$3; + central = _tmp$4; + upper = _tmp$5; + e2 = exp - 2 >> 0; + return [lower$1, central, upper, e2]; + } + }; + ryuDigits = function(d, lower$1, central, upper, c0, cup) { + var _q, _r, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, c0, central, chi, clo, cup, d, lhi, llo, lower$1, n, uhi, ulo, upper, v, v1, v2, x, x$1, x$2, x$3; + _tuple = divmod1e9(lower$1); + lhi = _tuple[0]; + llo = _tuple[1]; + _tuple$1 = divmod1e9(central); + chi = _tuple$1[0]; + clo = _tuple$1[1]; + _tuple$2 = divmod1e9(upper); + uhi = _tuple$2[0]; + ulo = _tuple$2[1]; + if (uhi === 0) { + ryuDigits32(d, llo, clo, ulo, c0, cup, 8); + } else if (lhi < uhi) { + if (!((llo === 0))) { + lhi = lhi + (1) >>> 0; + } + c0 = c0 && (clo === 0); + cup = (clo > 500000000) || ((clo === 500000000) && cup); + ryuDigits32(d, lhi, chi, uhi, c0, cup, 8); + d.dp = d.dp + (9) >> 0; + } else { + d.nd = 0; + n = 9; + v = chi; + while (true) { + if (!(v > 0)) { break; } + _tmp = (_q = v / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + _tmp$1 = (_r = v % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); + v1 = _tmp; + v2 = _tmp$1; + v = v1; + n = n - (1) >>> 0; + (x = d.d, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n] = (((v2 + 48 >>> 0) << 24 >>> 24)))); + } + d.d = $subslice(d.d, n); + d.nd = (((9 - n >>> 0) >> 0)); + ryuDigits32(d, llo, clo, ulo, c0, cup, d.nd + 8 >> 0); + } + while (true) { + if (!(d.nd > 0 && ((x$1 = d.d, x$2 = d.nd - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2])) === 48))) { break; } + d.nd = d.nd - (1) >> 0; + } + while (true) { + if (!(d.nd > 0 && ((x$3 = d.d, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])) === 48))) { break; } + d.nd = d.nd - (1) >> 0; + d.dp = d.dp - (1) >> 0; + d.d = $subslice(d.d, 1); + } + }; + ryuDigits32 = function(d, lower$1, central, upper, c0, cup, endindex) { + var _q, _q$1, _q$2, _q$3, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, c, c0, cNextDigit, cdigit, central, cup, d, endindex, l, lower$1, n, trimmed, u, upper, v, v1, v2, x, x$1, x$2, x$3; + if (upper === 0) { + d.dp = endindex + 1 >> 0; + return; + } + trimmed = 0; + cNextDigit = 0; + while (true) { + if (!(upper > 0)) { break; } + l = (_q = ((lower$1 + 9 >>> 0)) / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + _tmp = (_q$1 = central / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); + _tmp$1 = (_r = central % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); + c = _tmp; + cdigit = _tmp$1; + u = (_q$2 = upper / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >>> 0 : $throwRuntimeError("integer divide by zero")); + if (l > u) { + break; + } + if ((l === (c + 1 >>> 0)) && c < u) { + c = c + (1) >>> 0; + cdigit = 0; + cup = false; + } + trimmed = trimmed + (1) >> 0; + c0 = c0 && (cNextDigit === 0); + cNextDigit = ((cdigit >> 0)); + _tmp$2 = l; + _tmp$3 = c; + _tmp$4 = u; + lower$1 = _tmp$2; + central = _tmp$3; + upper = _tmp$4; + } + if (trimmed > 0) { + cup = cNextDigit > 5 || ((cNextDigit === 5) && !c0) || ((cNextDigit === 5) && c0 && (((central & 1) >>> 0) === 1)); + } + if (central < upper && cup) { + central = central + (1) >>> 0; + } + endindex = endindex - (trimmed) >> 0; + v = central; + n = endindex; + while (true) { + if (!(n > d.nd)) { break; } + _tmp$5 = (_q$3 = v / 100, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >>> 0 : $throwRuntimeError("integer divide by zero")); + _tmp$6 = (_r$1 = v % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); + v1 = _tmp$5; + v2 = _tmp$6; + (x = d.d, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((($imul(2, v2) >>> 0) + 1 >>> 0)))); + (x$1 = d.d, x$2 = n - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((($imul(2, v2) >>> 0) + 0 >>> 0)))); + n = n - (2) >> 0; + v = v1; + } + if (n === d.nd) { + (x$3 = d.d, ((n < 0 || n >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + n] = (((v + 48 >>> 0) << 24 >>> 24)))); + } + d.nd = endindex + 1 >> 0; + d.dp = d.nd + trimmed >> 0; + }; + mult64bitPow10 = function(m, e2, q) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e2, exact, hi, lo, m, pow, q, resE, resM, x, x$1, x$2, x$3, x$4; + resM = 0; + resE = 0; + exact = false; + if (q === 0) { + _tmp = m << 6 >>> 0; + _tmp$1 = e2 - 6 >> 0; + _tmp$2 = true; + resM = _tmp; + resE = _tmp$1; + exact = _tmp$2; + return [resM, resE, exact]; + } + if (q < -348 || 347 < q) { + $panic(new $String("mult64bitPow10: power of 10 is out of range")); + } + pow = (x = q - -348 >> 0, ((x < 0 || x >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x]))[1]; + if (q < 0) { + pow = (x$1 = new $Uint64(0, 1), new $Uint64(pow.$high + x$1.$high, pow.$low + x$1.$low)); + } + _tuple = bits.Mul64((new $Uint64(0, m)), pow); + hi = _tuple[0]; + lo = _tuple[1]; + e2 = e2 + (((mulByLog10Log2(q) - 63 >> 0) + 57 >> 0)) >> 0; + _tmp$3 = (((x$2 = $shiftLeft64(hi, 7), x$3 = $shiftRightUint64(lo, 57), new $Uint64(x$2.$high | x$3.$high, (x$2.$low | x$3.$low) >>> 0)).$low >>> 0)); + _tmp$4 = e2; + _tmp$5 = (x$4 = $shiftLeft64(lo, 7), (x$4.$high === 0 && x$4.$low === 0)); + resM = _tmp$3; + resE = _tmp$4; + exact = _tmp$5; + return [resM, resE, exact]; + }; + mult128bitPow10 = function(m, e2, q) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, carry, e2, exact, h0, h1, l0, l1, m, mid, pow, q, resE, resM, x, x$1, x$2, x$3, x$4, x$5, x$6; + resM = new $Uint64(0, 0); + resE = 0; + exact = false; + if (q === 0) { + _tmp = $shiftLeft64(m, 8); + _tmp$1 = e2 - 8 >> 0; + _tmp$2 = true; + resM = _tmp; + resE = _tmp$1; + exact = _tmp$2; + return [resM, resE, exact]; + } + if (q < -348 || 347 < q) { + $panic(new $String("mult128bitPow10: power of 10 is out of range")); + } + pow = $clone((x = q - -348 >> 0, ((x < 0 || x >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x])), arrayType); + if (q < 0) { + pow[0] = (x$1 = pow[0], x$2 = new $Uint64(0, 1), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); + } + e2 = e2 + (((mulByLog10Log2(q) - 127 >> 0) + 119 >> 0)) >> 0; + _tuple = bits.Mul64(m, pow[0]); + l1 = _tuple[0]; + l0 = _tuple[1]; + _tuple$1 = bits.Mul64(m, pow[1]); + h1 = _tuple$1[0]; + h0 = _tuple$1[1]; + _tuple$2 = bits.Add64(l1, h0, new $Uint64(0, 0)); + mid = _tuple$2[0]; + carry = _tuple$2[1]; + h1 = (x$3 = carry, new $Uint64(h1.$high + x$3.$high, h1.$low + x$3.$low)); + _tmp$3 = (x$4 = $shiftLeft64(h1, 9), x$5 = $shiftRightUint64(mid, 55), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)); + _tmp$4 = e2; + _tmp$5 = (x$6 = $shiftLeft64(mid, 9), (x$6.$high === 0 && x$6.$low === 0)) && (l0.$high === 0 && l0.$low === 0); + resM = _tmp$3; + resE = _tmp$4; + exact = _tmp$5; + return [resM, resE, exact]; + }; + divisibleByPower5 = function(m, k) { + var i, k, m, x; + if ((m.$high === 0 && m.$low === 0)) { + return true; + } + i = 0; + while (true) { + if (!(i < k)) { break; } + if (!((x = $div64(m, new $Uint64(0, 5), true), (x.$high === 0 && x.$low === 0)))) { + return false; + } + m = $div64(m, (new $Uint64(0, 5)), false); + i = i + (1) >> 0; + } + return true; + }; + divmod1e9 = function(x) { + var _tuple, hi, q, x, x$1; + if (false) { + return [(($div64(x, new $Uint64(0, 1000000000), false).$low >>> 0)), (($div64(x, new $Uint64(0, 1000000000), true).$low >>> 0))]; + } + _tuple = bits.Mul64($shiftRightUint64(x, 1), new $Uint64(2305843009, 917808536)); + hi = _tuple[0]; + q = $shiftRightUint64(hi, 28); + return [((q.$low >>> 0)), (((x$1 = $mul64(q, new $Uint64(0, 1000000000)), new $Uint64(x.$high - x$1.$high, x.$low - x$1.$low)).$low >>> 0))]; + }; + AppendFloat = function(dst, f, fmt, prec, bitSize) { + var bitSize, dst, f, fmt, prec; + return genericFtoa(dst, f, fmt, prec, bitSize); + }; + $pkg.AppendFloat = AppendFloat; + genericFtoa = function(dst, val, fmt, prec, bitSize) { + var _1, _2, _3, _4, bitSize, bits$1, buf, buf$1, digits, digs, dst, exp, flt, fmt, mant, neg, ok, prec, s, shortest, val, x, x$1, x$2, x$3, y, y$1; + bits$1 = new $Uint64(0, 0); + flt = ptrType.nil; + _1 = bitSize; + if (_1 === (32)) { + bits$1 = (new $Uint64(0, math.Float32bits(($fround(val))))); + flt = float32info; + } else if (_1 === (64)) { + bits$1 = math.Float64bits(val); + flt = float64info; + } else { + $panic(new $String("strconv: illegal AppendFloat/FormatFloat bitSize")); + } + neg = !((x = $shiftRightUint64(bits$1, ((flt.expbits + flt.mantbits >>> 0))), (x.$high === 0 && x.$low === 0))); + exp = (($shiftRightUint64(bits$1, flt.mantbits).$low >> 0)) & ((((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)); + mant = (x$1 = (x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$2.$high - 0, x$2.$low - 1)), new $Uint64(bits$1.$high & x$1.$high, (bits$1.$low & x$1.$low) >>> 0)); + _2 = exp; + if (_2 === ((((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0))) { + s = ""; + if (!((mant.$high === 0 && mant.$low === 0))) { + s = "NaN"; + } else if (neg) { + s = "-Inf"; + } else { + s = "+Inf"; + } + return $appendSlice(dst, s); + } else if (_2 === (0)) { + exp = exp + (1) >> 0; + } else { + mant = (x$3 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high | x$3.$high, (mant.$low | x$3.$low) >>> 0)); + } + exp = exp + (flt.bias) >> 0; + if (fmt === 98) { + return fmtB(dst, neg, mant, exp, flt); + } + if ((fmt === 120) || (fmt === 88)) { + return fmtX(dst, prec, fmt, neg, mant, exp, flt); + } + if (!optimize) { + return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); + } + digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); + ok = false; + shortest = prec < 0; + if (shortest) { + buf = arrayType$3.zero(); + digs.d = new sliceType$6(buf); + ryuFtoaShortest(digs, mant, exp - ((flt.mantbits >> 0)) >> 0, flt); + ok = true; + _3 = fmt; + if ((_3 === (101)) || (_3 === (69))) { + prec = max(digs.nd - 1 >> 0, 0); + } else if (_3 === (102)) { + prec = max(digs.nd - digs.dp >> 0, 0); + } else if ((_3 === (103)) || (_3 === (71))) { + prec = digs.nd; + } + } else if (!((fmt === 102))) { + digits = prec; + _4 = fmt; + if ((_4 === (101)) || (_4 === (69))) { + digits = digits + (1) >> 0; + } else if ((_4 === (103)) || (_4 === (71))) { + if (prec === 0) { + prec = 1; + } + digits = prec; + } + buf$1 = arrayType$4.zero(); + if ((bitSize === 32) && digits <= 9) { + digs.d = new sliceType$6(buf$1); + ryuFtoaFixed32(digs, ((mant.$low >>> 0)), exp - ((flt.mantbits >> 0)) >> 0, digits); + ok = true; + } else if (digits <= 18) { + digs.d = new sliceType$6(buf$1); + ryuFtoaFixed64(digs, mant, exp - ((flt.mantbits >> 0)) >> 0, digits); + ok = true; + } + } + if (!ok) { + return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); + } + return formatDigits(dst, shortest, neg, $clone(digs, decimalSlice), prec, fmt); + }; + bigFtoa = function(dst, prec, fmt, neg, mant, exp, flt) { + var _1, _2, d, digs, dst, exp, flt, fmt, mant, neg, prec, shortest; + d = new decimal.ptr(arrayType$5.zero(), 0, 0, false, false); + d.Assign(mant); + d.Shift(exp - ((flt.mantbits >> 0)) >> 0); + digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); + shortest = prec < 0; + if (shortest) { + roundShortest(d, mant, exp, flt); + decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); + _1 = fmt; + if ((_1 === (101)) || (_1 === (69))) { + prec = digs.nd - 1 >> 0; + } else if (_1 === (102)) { + prec = max(digs.nd - digs.dp >> 0, 0); + } else if ((_1 === (103)) || (_1 === (71))) { + prec = digs.nd; + } + } else { + _2 = fmt; + if ((_2 === (101)) || (_2 === (69))) { + d.Round(prec + 1 >> 0); + } else if (_2 === (102)) { + d.Round(d.dp + prec >> 0); + } else if ((_2 === (103)) || (_2 === (71))) { + if (prec === 0) { + prec = 1; + } + d.Round(prec); + } + decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); + } + return formatDigits(dst, shortest, neg, $clone(digs, decimalSlice), prec, fmt); + }; + formatDigits = function(dst, shortest, neg, digs, prec, fmt) { + var _1, digs, dst, eprec, exp, fmt, neg, prec, shortest; + _1 = fmt; + if ((_1 === (101)) || (_1 === (69))) { + return fmtE(dst, neg, $clone(digs, decimalSlice), prec, fmt); + } else if (_1 === (102)) { + return fmtF(dst, neg, $clone(digs, decimalSlice), prec); + } else if ((_1 === (103)) || (_1 === (71))) { + eprec = prec; + if (eprec > digs.nd && digs.nd >= digs.dp) { + eprec = digs.nd; + } + if (shortest) { + eprec = 6; + } + exp = digs.dp - 1 >> 0; + if (exp < -4 || exp >= eprec) { + if (prec > digs.nd) { + prec = digs.nd; + } + return fmtE(dst, neg, $clone(digs, decimalSlice), prec - 1 >> 0, (fmt + 101 << 24 >>> 24) - 103 << 24 >>> 24); + } + if (prec > digs.dp) { + prec = digs.nd; + } + return fmtF(dst, neg, $clone(digs, decimalSlice), max(prec - digs.dp >> 0, 0)); + } + return $append(dst, 37, fmt); + }; + roundShortest = function(d, mant, exp, flt) { + var d, exp, explo, flt, inclusive, l, li, lower$1, m, mant, mantlo, mi, minexp, okdown, okup, u, ui, upper, upperdelta, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; + if ((mant.$high === 0 && mant.$low === 0)) { + d.nd = 0; + return; + } + minexp = flt.bias + 1 >> 0; + if (exp > minexp && ($imul(332, ((d.dp - d.nd >> 0)))) >= ($imul(100, ((exp - ((flt.mantbits >> 0)) >> 0))))) { + return; + } + upper = new decimal.ptr(arrayType$5.zero(), 0, 0, false, false); + upper.Assign((x = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x.$high + 0, x.$low + 1))); + upper.Shift((exp - ((flt.mantbits >> 0)) >> 0) - 1 >> 0); + mantlo = new $Uint64(0, 0); + explo = 0; + if ((x$1 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high > x$1.$high || (mant.$high === x$1.$high && mant.$low > x$1.$low))) || (exp === minexp)) { + mantlo = new $Uint64(mant.$high - 0, mant.$low - 1); + explo = exp; + } else { + mantlo = (x$2 = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x$2.$high - 0, x$2.$low - 1)); + explo = exp - 1 >> 0; + } + lower$1 = new decimal.ptr(arrayType$5.zero(), 0, 0, false, false); + lower$1.Assign((x$3 = $mul64(mantlo, new $Uint64(0, 2)), new $Uint64(x$3.$high + 0, x$3.$low + 1))); + lower$1.Shift((explo - ((flt.mantbits >> 0)) >> 0) - 1 >> 0); + inclusive = (x$4 = $div64(mant, new $Uint64(0, 2), true), (x$4.$high === 0 && x$4.$low === 0)); + upperdelta = 0; + ui = 0; + while (true) { + mi = (ui - upper.dp >> 0) + d.dp >> 0; + if (mi >= d.nd) { + break; + } + li = (ui - upper.dp >> 0) + lower$1.dp >> 0; + l = 48; + if (li >= 0 && li < lower$1.nd) { + l = (x$5 = lower$1.d, ((li < 0 || li >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[li])); + } + m = 48; + if (mi >= 0) { + m = (x$6 = d.d, ((mi < 0 || mi >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[mi])); + } + u = 48; + if (ui < upper.nd) { + u = (x$7 = upper.d, ((ui < 0 || ui >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[ui])); + } + okdown = !((l === m)) || inclusive && ((li + 1 >> 0) === lower$1.nd); + if ((upperdelta === 0) && (m + 1 << 24 >>> 24) < u) { + upperdelta = 2; + } else if ((upperdelta === 0) && !((m === u))) { + upperdelta = 1; + } else if ((upperdelta === 1) && (!((m === 57)) || !((u === 48)))) { + upperdelta = 2; + } + okup = upperdelta > 0 && (inclusive || upperdelta > 1 || (ui + 1 >> 0) < upper.nd); + if (okdown && okup) { + d.Round(mi + 1 >> 0); + return; + } else if (okdown) { + d.RoundDown(mi + 1 >> 0); + return; + } else if (okup) { + d.RoundUp(mi + 1 >> 0); + return; + } + ui = ui + (1) >> 0; + } + }; + fmtE = function(dst, neg, d, prec, fmt) { + var _q, _q$1, _q$2, _r, _r$1, _r$2, ch, d, dst, exp, fmt, i, m, neg, prec, x; + if (neg) { + dst = $append(dst, 45); + } + ch = 48; + if (!((d.nd === 0))) { + ch = (x = d.d, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); + } + dst = $append(dst, ch); + if (prec > 0) { + dst = $append(dst, 46); + i = 1; + m = min(d.nd, prec + 1 >> 0); + if (i < m) { + dst = $appendSlice(dst, $subslice(d.d, i, m)); + i = m; + } + while (true) { + if (!(i <= prec)) { break; } + dst = $append(dst, 48); + i = i + (1) >> 0; + } + } + dst = $append(dst, fmt); + exp = d.dp - 1 >> 0; + if (d.nd === 0) { + exp = 0; + } + if (exp < 0) { + ch = 45; + exp = -exp; + } else { + ch = 43; + } + dst = $append(dst, ch); + if (exp < 10) { + dst = $append(dst, 48, ((exp << 24 >>> 24)) + 48 << 24 >>> 24); + } else if (exp < 100) { + dst = $append(dst, (((_q = exp / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r = exp % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); + } else { + dst = $append(dst, (((_q$1 = exp / 100, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (_r$1 = (((_q$2 = exp / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24, (((_r$2 = exp % 10, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); + } + return dst; + }; + fmtF = function(dst, neg, d, prec) { + var ch, d, dst, i, j, m, neg, prec, x; + if (neg) { + dst = $append(dst, 45); + } + if (d.dp > 0) { + m = min(d.nd, d.dp); + dst = $appendSlice(dst, $subslice(d.d, 0, m)); + while (true) { + if (!(m < d.dp)) { break; } + dst = $append(dst, 48); + m = m + (1) >> 0; + } + } else { + dst = $append(dst, 48); + } + if (prec > 0) { + dst = $append(dst, 46); + i = 0; + while (true) { + if (!(i < prec)) { break; } + ch = 48; + j = d.dp + i >> 0; + if (0 <= j && j < d.nd) { + ch = (x = d.d, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j])); + } + dst = $append(dst, ch); + i = i + (1) >> 0; + } + } + return dst; + }; + fmtB = function(dst, neg, mant, exp, flt) { + var _tuple, _tuple$1, dst, exp, flt, mant, neg; + if (neg) { + dst = $append(dst, 45); + } + _tuple = formatBits(dst, mant, 10, false, true); + dst = _tuple[0]; + dst = $append(dst, 112); + exp = exp - (((flt.mantbits >> 0))) >> 0; + if (exp >= 0) { + dst = $append(dst, 43); + } + _tuple$1 = formatBits(dst, (new $Uint64(0, exp)), 10, exp < 0, true); + dst = _tuple$1[0]; + return dst; + }; + fmtX = function(dst, prec, fmt, neg, mant, exp, flt) { + var _q, _q$1, _q$2, _q$3, _q$4, _q$5, _r, _r$1, _r$2, _r$3, _r$4, _r$5, ch, dst, exp, extra, flt, fmt, hex, i, mant, neg, prec, shift, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; + if ((mant.$high === 0 && mant.$low === 0)) { + exp = 0; + } + mant = $shiftLeft64(mant, ((60 - flt.mantbits >>> 0))); + while (true) { + if (!(!((mant.$high === 0 && mant.$low === 0)) && (x = new $Uint64(mant.$high & 268435456, (mant.$low & 0) >>> 0), (x.$high === 0 && x.$low === 0)))) { break; } + mant = $shiftLeft64(mant, (1)); + exp = exp - (1) >> 0; + } + if (prec >= 0 && prec < 15) { + shift = ((($imul(prec, 4)) >>> 0)); + extra = (x$1 = $shiftLeft64(mant, shift), new $Uint64(x$1.$high & 268435455, (x$1.$low & 4294967295) >>> 0)); + mant = $shiftRightUint64(mant, ((60 - shift >>> 0))); + if ((x$2 = (x$3 = new $Uint64(mant.$high & 0, (mant.$low & 1) >>> 0), new $Uint64(extra.$high | x$3.$high, (extra.$low | x$3.$low) >>> 0)), (x$2.$high > 134217728 || (x$2.$high === 134217728 && x$2.$low > 0)))) { + mant = (x$4 = new $Uint64(0, 1), new $Uint64(mant.$high + x$4.$high, mant.$low + x$4.$low)); + } + mant = $shiftLeft64(mant, ((60 - shift >>> 0))); + if (!((x$5 = new $Uint64(mant.$high & 536870912, (mant.$low & 0) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { + mant = $shiftRightUint64(mant, (1)); + exp = exp + (1) >> 0; + } + } + hex = "0123456789abcdef"; + if (fmt === 88) { + hex = "0123456789ABCDEF"; + } + if (neg) { + dst = $append(dst, 45); + } + dst = $append(dst, 48, fmt, 48 + (((x$6 = $shiftRightUint64(mant, 60), new $Uint64(x$6.$high & 0, (x$6.$low & 1) >>> 0)).$low << 24 >>> 24)) << 24 >>> 24); + mant = $shiftLeft64(mant, (4)); + if (prec < 0 && !((mant.$high === 0 && mant.$low === 0))) { + dst = $append(dst, 46); + while (true) { + if (!(!((mant.$high === 0 && mant.$low === 0)))) { break; } + dst = $append(dst, hex.charCodeAt($flatten64((x$7 = $shiftRightUint64(mant, 60), new $Uint64(x$7.$high & 0, (x$7.$low & 15) >>> 0))))); + mant = $shiftLeft64(mant, (4)); + } + } else if (prec > 0) { + dst = $append(dst, 46); + i = 0; + while (true) { + if (!(i < prec)) { break; } + dst = $append(dst, hex.charCodeAt($flatten64((x$8 = $shiftRightUint64(mant, 60), new $Uint64(x$8.$high & 0, (x$8.$low & 15) >>> 0))))); + mant = $shiftLeft64(mant, (4)); + i = i + (1) >> 0; + } + } + ch = 80; + if (fmt === lower(fmt)) { + ch = 112; + } + dst = $append(dst, ch); + if (exp < 0) { + ch = 45; + exp = -exp; + } else { + ch = 43; + } + dst = $append(dst, ch); + if (exp < 100) { + dst = $append(dst, (((_q = exp / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r = exp % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); + } else if (exp < 1000) { + dst = $append(dst, (((_q$1 = exp / 100, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r$1 = ((_q$2 = exp / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))) % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r$2 = exp % 10, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); + } else { + dst = $append(dst, (((_q$3 = exp / 1000, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (_r$3 = (((_q$4 = exp / 100, (_q$4 === _q$4 && _q$4 !== 1/0 && _q$4 !== -1/0) ? _q$4 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) % 10, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24, (((_r$4 = ((_q$5 = exp / 10, (_q$5 === _q$5 && _q$5 !== 1/0 && _q$5 !== -1/0) ? _q$5 >> 0 : $throwRuntimeError("integer divide by zero"))) % 10, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r$5 = exp % 10, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); + } + return dst; + }; + min = function(a, b) { + var a, b; + if (a < b) { + return a; + } + return b; + }; + max = function(a, b) { + var a, b; + if (a > b) { + return a; + } + return b; + }; decimal.ptr.prototype.String = function() { var a, buf, n, w; a = this; @@ -11320,7 +14364,7 @@ $packages["strconv"] = (function() { decimal.ptr.prototype.Assign = function(v) { var a, buf, n, v, v1, x, x$1, x$2; a = this; - buf = arrayType$1.zero(); + buf = arrayType$4.zero(); n = 0; while (true) { if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } @@ -11554,1367 +14598,253 @@ $packages["strconv"] = (function() { return n; }; decimal.prototype.RoundedInteger = function() { return this.$val.RoundedInteger(); }; - extFloat.ptr.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { - var _tmp, _tmp$1, exp, expBiased, f, flt, lower, mant, neg, upper, x, x$1, x$2, x$3, x$4; - lower = new extFloat.ptr(new $Uint64(0, 0), 0, false); - upper = new extFloat.ptr(new $Uint64(0, 0), 0, false); - f = this; - f.mant = mant; - f.exp = exp - ((flt.mantbits >> 0)) >> 0; - f.neg = neg; - if (f.exp <= 0 && (x = $shiftLeft64(($shiftRightUint64(mant, ((-f.exp >>> 0)))), ((-f.exp >>> 0))), (mant.$high === x.$high && mant.$low === x.$low))) { - f.mant = $shiftRightUint64(f.mant, (((-f.exp >>> 0)))); - f.exp = 0; - _tmp = $clone(f, extFloat); - _tmp$1 = $clone(f, extFloat); - extFloat.copy(lower, _tmp); - extFloat.copy(upper, _tmp$1); - return [lower, upper]; - } - expBiased = exp - flt.bias >> 0; - extFloat.copy(upper, new extFloat.ptr((x$1 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$1.$high + 0, x$1.$low + 1)), f.exp - 1 >> 0, f.neg)); - if (!((x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) || (expBiased === 1)) { - extFloat.copy(lower, new extFloat.ptr((x$3 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$3.$high - 0, x$3.$low - 1)), f.exp - 1 >> 0, f.neg)); - } else { - extFloat.copy(lower, new extFloat.ptr((x$4 = $mul64(new $Uint64(0, 4), f.mant), new $Uint64(x$4.$high - 0, x$4.$low - 1)), f.exp - 2 >> 0, f.neg)); - } - return [lower, upper]; + index = function(s, c) { + var c, s; + return bytealg.IndexByteString(s, c); }; - extFloat.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { return this.$val.AssignComputeBounds(mant, exp, neg, flt); }; - extFloat.ptr.prototype.Normalize = function() { - var f, shift, x; - f = this; - if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { - return 0; - } - shift = bits.LeadingZeros64(f.mant); - f.mant = $shiftLeft64(f.mant, (((shift >>> 0)))); - f.exp = f.exp - (shift) >> 0; - return ((shift >>> 0)); + lower = function(c) { + var c; + return (c | 32) >>> 0; }; - extFloat.prototype.Normalize = function() { return this.$val.Normalize(); }; - extFloat.ptr.prototype.Multiply = function(g) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, cross1, cross2, f, fhi, flo, g, ghi, glo, rem, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - f = this; - _tmp = $shiftRightUint64(f.mant, 32); - _tmp$1 = (new $Uint64(0, ((f.mant.$low >>> 0)))); - fhi = _tmp; - flo = _tmp$1; - _tmp$2 = $shiftRightUint64(g.mant, 32); - _tmp$3 = (new $Uint64(0, ((g.mant.$low >>> 0)))); - ghi = _tmp$2; - glo = _tmp$3; - cross1 = $mul64(fhi, glo); - cross2 = $mul64(flo, ghi); - f.mant = (x = (x$1 = $mul64(fhi, ghi), x$2 = $shiftRightUint64(cross1, 32), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)), x$3 = $shiftRightUint64(cross2, 32), new $Uint64(x.$high + x$3.$high, x.$low + x$3.$low)); - rem = (x$4 = (x$5 = (new $Uint64(0, ((cross1.$low >>> 0)))), x$6 = (new $Uint64(0, ((cross2.$low >>> 0)))), new $Uint64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)), x$7 = $shiftRightUint64(($mul64(flo, glo)), 32), new $Uint64(x$4.$high + x$7.$high, x$4.$low + x$7.$low)); - rem = (x$8 = new $Uint64(0, 2147483648), new $Uint64(rem.$high + x$8.$high, rem.$low + x$8.$low)); - f.mant = (x$9 = f.mant, x$10 = ($shiftRightUint64(rem, 32)), new $Uint64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)); - f.exp = (f.exp + g.exp >> 0) + 64 >> 0; + NumError.ptr.prototype.Error = function() { + var {$24r, _r, e, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + e = this; + _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = "strconv." + e.Func + ": " + "parsing " + Quote(e.Num) + ": " + _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: NumError.ptr.prototype.Error, $c: true, $r, $24r, _r, e, $s};return $f; }; - extFloat.prototype.Multiply = function(g) { return this.$val.Multiply(g); }; - extFloat.ptr.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { - var _q, _r, adjExp, denormalExp, errors$1, exp10, extrabits, f, flt, halfway, i, mant_extra, mantissa, neg, ok, shift, trunc, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y; - ok = false; - f = this; - errors$1 = 0; - if (trunc) { - errors$1 = errors$1 + (4) >> 0; - } - f.mant = mantissa; - f.exp = 0; - f.neg = neg; - i = (_q = ((exp10 - -348 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - if (exp10 < -348 || i >= 87) { - ok = false; - return ok; - } - adjExp = (_r = ((exp10 - -348 >> 0)) % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); - if (adjExp < 19 && (x = (x$1 = 19 - adjExp >> 0, ((x$1 < 0 || x$1 >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[x$1])), (mantissa.$high < x.$high || (mantissa.$high === x.$high && mantissa.$low < x.$low)))) { - f.mant = $mul64(f.mant, (((adjExp < 0 || adjExp >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[adjExp]))); - f.Normalize(); - } else { - f.Normalize(); - f.Multiply($clone(((adjExp < 0 || adjExp >= smallPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : smallPowersOfTen[adjExp]), extFloat)); - errors$1 = errors$1 + (4) >> 0; - } - f.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); - if (errors$1 > 0) { - errors$1 = errors$1 + (1) >> 0; - } - errors$1 = errors$1 + (4) >> 0; - shift = f.Normalize(); - errors$1 = (y = (shift), y < 32 ? (errors$1 << y) : 0) >> 0; - denormalExp = flt.bias - 63 >> 0; - extrabits = 0; - if (f.exp <= denormalExp) { - extrabits = ((63 - flt.mantbits >>> 0) + 1 >>> 0) + (((denormalExp - f.exp >> 0) >>> 0)) >>> 0; - } else { - extrabits = 63 - flt.mantbits >>> 0; - } - halfway = $shiftLeft64(new $Uint64(0, 1), ((extrabits - 1 >>> 0))); - mant_extra = (x$2 = f.mant, x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), extrabits), new $Uint64(x$4.$high - 0, x$4.$low - 1)), new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); - if ((x$5 = (x$6 = (new $Int64(halfway.$high, halfway.$low)), x$7 = (new $Int64(0, errors$1)), new $Int64(x$6.$high - x$7.$high, x$6.$low - x$7.$low)), x$8 = (new $Int64(mant_extra.$high, mant_extra.$low)), (x$5.$high < x$8.$high || (x$5.$high === x$8.$high && x$5.$low < x$8.$low))) && (x$9 = (new $Int64(mant_extra.$high, mant_extra.$low)), x$10 = (x$11 = (new $Int64(halfway.$high, halfway.$low)), x$12 = (new $Int64(0, errors$1)), new $Int64(x$11.$high + x$12.$high, x$11.$low + x$12.$low)), (x$9.$high < x$10.$high || (x$9.$high === x$10.$high && x$9.$low < x$10.$low)))) { - ok = false; - return ok; - } - ok = true; - return ok; + NumError.prototype.Error = function() { return this.$val.Error(); }; + NumError.ptr.prototype.Unwrap = function() { + var e; + e = this; + return e.Err; }; - extFloat.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { return this.$val.AssignDecimal(mantissa, exp10, neg, trunc, flt); }; - extFloat.ptr.prototype.frexp10 = function() { - var _q, _q$1, _tmp, _tmp$1, approxExp10, exp, exp10, f, i, index; - exp10 = 0; - index = 0; - f = this; - approxExp10 = (_q = ($imul(((-46 - f.exp >> 0)), 28)) / 93, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - i = (_q$1 = ((approxExp10 - -348 >> 0)) / 8, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); - Loop: - while (true) { - exp = (f.exp + ((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]).exp >> 0) + 64 >> 0; - if (exp < -60) { - i = i + (1) >> 0; - } else if (exp > -32) { - i = i - (1) >> 0; - } else { - break Loop; - } - } - f.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); - _tmp = -((-348 + ($imul(i, 8)) >> 0)); - _tmp$1 = i; - exp10 = _tmp; - index = _tmp$1; - return [exp10, index]; + NumError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; + syntaxError = function(fn, str) { + var fn, str; + return new NumError.ptr(fn, str, $pkg.ErrSyntax); }; - extFloat.prototype.frexp10 = function() { return this.$val.frexp10(); }; - frexp10Many = function(a, b, c) { - var _tuple, a, b, c, exp10, i; - exp10 = 0; - _tuple = c.frexp10(); - exp10 = _tuple[0]; - i = _tuple[1]; - a.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); - b.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); - return exp10; + rangeError = function(fn, str) { + var fn, str; + return new NumError.ptr(fn, str, $pkg.ErrRange); }; - extFloat.ptr.prototype.FixedDecimal = function(d, n) { - var $CE$B5, _q, _q$1, _tmp, _tmp$1, _tuple, buf, d, digit, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, n, nd, needed, ok, pos, pow, pow10, rest, shift, v, v1, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - f = this; - if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { - d.nd = 0; - d.dp = 0; - d.neg = f.neg; - return true; - } - if (n === 0) { - $panic(new $String("strconv: internal error: extFloat.FixedDecimal called with n == 0")); - } - f.Normalize(); - _tuple = f.frexp10(); - exp10 = _tuple[0]; - shift = ((-f.exp >>> 0)); - integer = (($shiftRightUint64(f.mant, shift).$low >>> 0)); - fraction = (x$1 = f.mant, x$2 = $shiftLeft64((new $Uint64(0, integer)), shift), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); - $CE$B5 = new $Uint64(0, 1); - needed = n; - integerDigits = 0; - pow10 = new $Uint64(0, 1); - _tmp = 0; - _tmp$1 = new $Uint64(0, 1); - i = _tmp; - pow = _tmp$1; - while (true) { - if (!(i < 20)) { break; } - if ((x$3 = (new $Uint64(0, integer)), (pow.$high > x$3.$high || (pow.$high === x$3.$high && pow.$low > x$3.$low)))) { - integerDigits = i; - break; - } - pow = $mul64(pow, (new $Uint64(0, 10))); - i = i + (1) >> 0; - } - rest = integer; - if (integerDigits > needed) { - pow10 = (x$4 = integerDigits - needed >> 0, ((x$4 < 0 || x$4 >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[x$4])); - integer = (_q = integer / (((pow10.$low >>> 0))), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - rest = rest - (($imul(integer, ((pow10.$low >>> 0))) >>> 0)) >>> 0; - } else { - rest = 0; - } - buf = arrayType$2.zero(); - pos = 32; - v = integer; - while (true) { - if (!(v > 0)) { break; } - v1 = (_q$1 = v / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); - v = v - (($imul(10, v1) >>> 0)) >>> 0; - pos = pos - (1) >> 0; - ((pos < 0 || pos >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[pos] = (((v + 48 >>> 0) << 24 >>> 24))); - v = v1; - } - i$1 = pos; - while (true) { - if (!(i$1 < 32)) { break; } - (x$5 = d.d, x$6 = i$1 - pos >> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6] = ((i$1 < 0 || i$1 >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i$1]))); - i$1 = i$1 + (1) >> 0; - } - nd = 32 - pos >> 0; - d.nd = nd; - d.dp = integerDigits + exp10 >> 0; - needed = needed - (nd) >> 0; - if (needed > 0) { - if (!((rest === 0)) || !((pow10.$high === 0 && pow10.$low === 1))) { - $panic(new $String("strconv: internal error, rest != 0 but needed > 0")); - } - while (true) { - if (!(needed > 0)) { break; } - fraction = $mul64(fraction, (new $Uint64(0, 10))); - $CE$B5 = $mul64($CE$B5, (new $Uint64(0, 10))); - if ((x$7 = $mul64(new $Uint64(0, 2), $CE$B5), x$8 = $shiftLeft64(new $Uint64(0, 1), shift), (x$7.$high > x$8.$high || (x$7.$high === x$8.$high && x$7.$low > x$8.$low)))) { - return false; - } - digit = $shiftRightUint64(fraction, shift); - (x$9 = d.d, ((nd < 0 || nd >= x$9.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$9.$array[x$9.$offset + nd] = ((new $Uint64(digit.$high + 0, digit.$low + 48).$low << 24 >>> 24)))); - fraction = (x$10 = $shiftLeft64(digit, shift), new $Uint64(fraction.$high - x$10.$high, fraction.$low - x$10.$low)); - nd = nd + (1) >> 0; - needed = needed - (1) >> 0; - } - d.nd = nd; - } - ok = adjustLastDigitFixed(d, (x$11 = $shiftLeft64((new $Uint64(0, rest)), shift), new $Uint64(x$11.$high | fraction.$high, (x$11.$low | fraction.$low) >>> 0)), pow10, shift, $CE$B5); - if (!ok) { - return false; - } - i$2 = d.nd - 1 >> 0; - while (true) { - if (!(i$2 >= 0)) { break; } - if (!(((x$12 = d.d, ((i$2 < 0 || i$2 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + i$2])) === 48))) { - d.nd = i$2 + 1 >> 0; - break; - } - i$2 = i$2 - (1) >> 0; - } - return true; + baseError = function(fn, str, base) { + var base, fn, str; + return new NumError.ptr(fn, str, errors.New("invalid base " + Itoa(base))); }; - extFloat.prototype.FixedDecimal = function(d, n) { return this.$val.FixedDecimal(d, n); }; - adjustLastDigitFixed = function(d, num, den, shift, $CE$B5) { - var $CE$B5, d, den, i, num, shift, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - if ((x = $shiftLeft64(den, shift), (num.$high > x.$high || (num.$high === x.$high && num.$low > x.$low)))) { - $panic(new $String("strconv: num > den< x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { - $panic(new $String("strconv: \xCE\xB5 > (den< x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low)))) { - i = d.nd - 1 >> 0; - while (true) { - if (!(i >= 0)) { break; } - if ((x$7 = d.d, ((i < 0 || i >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + i])) === 57) { - d.nd = d.nd - (1) >> 0; + base0 = base === 0; + s0 = s; + if (2 <= base && base <= 36) { + } else if ((base === 0)) { + base = 10; + if (s.charCodeAt(0) === 48) { + if (s.length >= 3 && (lower(s.charCodeAt(1)) === 98)) { + base = 2; + s = $substring(s, 2); + } else if (s.length >= 3 && (lower(s.charCodeAt(1)) === 111)) { + base = 8; + s = $substring(s, 2); + } else if (s.length >= 3 && (lower(s.charCodeAt(1)) === 120)) { + base = 16; + s = $substring(s, 2); } else { - break; - } - i = i - (1) >> 0; - } - if (i < 0) { - (x$8 = d.d, (0 >= x$8.$length ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + 0] = 49)); - d.nd = 1; - d.dp = d.dp + (1) >> 0; - } else { - (x$10 = d.d, ((i < 0 || i >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + i] = ((x$9 = d.d, ((i < 0 || i >= x$9.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$9.$array[x$9.$offset + i])) + (1) << 24 >>> 24))); - } - return true; - } - return false; - }; - extFloat.ptr.prototype.ShortestDecimal = function(d, lower, upper) { - var _q, _tmp, _tmp$1, _tmp$2, _tmp$3, allowance, buf, currentDiff, d, digit, digit$1, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, lower, multiplier, n, nd, pow, pow$1, shift, targetDiff, upper, v, v1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - f = this; - if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { - d.nd = 0; - d.dp = 0; - d.neg = f.neg; - return true; - } - if ((f.exp === 0) && $equal(lower, f, extFloat) && $equal(lower, upper, extFloat)) { - buf = arrayType$1.zero(); - n = 23; - v = f.mant; - while (true) { - if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } - v1 = $div64(v, new $Uint64(0, 10), false); - v = (x$1 = $mul64(new $Uint64(0, 10), v1), new $Uint64(v.$high - x$1.$high, v.$low - x$1.$low)); - ((n < 0 || n >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[n] = ((new $Uint64(v.$high + 0, v.$low + 48).$low << 24 >>> 24))); - n = n - (1) >> 0; - v = v1; - } - nd = (24 - n >> 0) - 1 >> 0; - i = 0; - while (true) { - if (!(i < nd)) { break; } - (x$3 = d.d, ((i < 0 || i >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i] = (x$2 = (n + 1 >> 0) + i >> 0, ((x$2 < 0 || x$2 >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x$2])))); - i = i + (1) >> 0; - } - _tmp = nd; - _tmp$1 = nd; - d.nd = _tmp; - d.dp = _tmp$1; - while (true) { - if (!(d.nd > 0 && ((x$4 = d.d, x$5 = d.nd - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])) === 48))) { break; } - d.nd = d.nd - (1) >> 0; - } - if (d.nd === 0) { - d.dp = 0; - } - d.neg = f.neg; - return true; - } - upper.Normalize(); - if (f.exp > upper.exp) { - f.mant = $shiftLeft64(f.mant, ((((f.exp - upper.exp >> 0) >>> 0)))); - f.exp = upper.exp; - } - if (lower.exp > upper.exp) { - lower.mant = $shiftLeft64(lower.mant, ((((lower.exp - upper.exp >> 0) >>> 0)))); - lower.exp = upper.exp; - } - exp10 = frexp10Many(lower, f, upper); - upper.mant = (x$6 = upper.mant, x$7 = new $Uint64(0, 1), new $Uint64(x$6.$high + x$7.$high, x$6.$low + x$7.$low)); - lower.mant = (x$8 = lower.mant, x$9 = new $Uint64(0, 1), new $Uint64(x$8.$high - x$9.$high, x$8.$low - x$9.$low)); - shift = ((-upper.exp >>> 0)); - integer = (($shiftRightUint64(upper.mant, shift).$low >>> 0)); - fraction = (x$10 = upper.mant, x$11 = $shiftLeft64((new $Uint64(0, integer)), shift), new $Uint64(x$10.$high - x$11.$high, x$10.$low - x$11.$low)); - allowance = (x$12 = upper.mant, x$13 = lower.mant, new $Uint64(x$12.$high - x$13.$high, x$12.$low - x$13.$low)); - targetDiff = (x$14 = upper.mant, x$15 = f.mant, new $Uint64(x$14.$high - x$15.$high, x$14.$low - x$15.$low)); - integerDigits = 0; - _tmp$2 = 0; - _tmp$3 = new $Uint64(0, 1); - i$1 = _tmp$2; - pow = _tmp$3; - while (true) { - if (!(i$1 < 20)) { break; } - if ((x$16 = (new $Uint64(0, integer)), (pow.$high > x$16.$high || (pow.$high === x$16.$high && pow.$low > x$16.$low)))) { - integerDigits = i$1; - break; - } - pow = $mul64(pow, (new $Uint64(0, 10))); - i$1 = i$1 + (1) >> 0; - } - i$2 = 0; - while (true) { - if (!(i$2 < integerDigits)) { break; } - pow$1 = (x$17 = (integerDigits - i$2 >> 0) - 1 >> 0, ((x$17 < 0 || x$17 >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[x$17])); - digit = (_q = integer / ((pow$1.$low >>> 0)), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - (x$18 = d.d, ((i$2 < 0 || i$2 >= x$18.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$18.$array[x$18.$offset + i$2] = (((digit + 48 >>> 0) << 24 >>> 24)))); - integer = integer - (($imul(digit, ((pow$1.$low >>> 0))) >>> 0)) >>> 0; - currentDiff = (x$19 = $shiftLeft64((new $Uint64(0, integer)), shift), new $Uint64(x$19.$high + fraction.$high, x$19.$low + fraction.$low)); - if ((currentDiff.$high < allowance.$high || (currentDiff.$high === allowance.$high && currentDiff.$low < allowance.$low))) { - d.nd = i$2 + 1 >> 0; - d.dp = integerDigits + exp10 >> 0; - d.neg = f.neg; - return adjustLastDigit(d, currentDiff, targetDiff, allowance, $shiftLeft64(pow$1, shift), new $Uint64(0, 2)); - } - i$2 = i$2 + (1) >> 0; - } - d.nd = integerDigits; - d.dp = d.nd + exp10 >> 0; - d.neg = f.neg; - digit$1 = 0; - multiplier = new $Uint64(0, 1); - while (true) { - fraction = $mul64(fraction, (new $Uint64(0, 10))); - multiplier = $mul64(multiplier, (new $Uint64(0, 10))); - digit$1 = (($shiftRightUint64(fraction, shift).$low >> 0)); - (x$20 = d.d, x$21 = d.nd, ((x$21 < 0 || x$21 >= x$20.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$20.$array[x$20.$offset + x$21] = (((digit$1 + 48 >> 0) << 24 >>> 24)))); - d.nd = d.nd + (1) >> 0; - fraction = (x$22 = $shiftLeft64((new $Uint64(0, digit$1)), shift), new $Uint64(fraction.$high - x$22.$high, fraction.$low - x$22.$low)); - if ((x$23 = $mul64(allowance, multiplier), (fraction.$high < x$23.$high || (fraction.$high === x$23.$high && fraction.$low < x$23.$low)))) { - return adjustLastDigit(d, fraction, $mul64(targetDiff, multiplier), $mul64(allowance, multiplier), $shiftLeft64(new $Uint64(0, 1), shift), $mul64(multiplier, new $Uint64(0, 2))); - } - } - }; - extFloat.prototype.ShortestDecimal = function(d, lower, upper) { return this.$val.ShortestDecimal(d, lower, upper); }; - adjustLastDigit = function(d, currentDiff, targetDiff, maxDiff, ulpDecimal, ulpBinary) { - var _index, currentDiff, d, maxDiff, targetDiff, ulpBinary, ulpDecimal, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - if ((x = $mul64(new $Uint64(0, 2), ulpBinary), (ulpDecimal.$high < x.$high || (ulpDecimal.$high === x.$high && ulpDecimal.$low < x.$low)))) { - return false; - } - while (true) { - if (!((x$1 = (x$2 = (x$3 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(currentDiff.$high + x$3.$high, currentDiff.$low + x$3.$low)), new $Uint64(x$2.$high + ulpBinary.$high, x$2.$low + ulpBinary.$low)), (x$1.$high < targetDiff.$high || (x$1.$high === targetDiff.$high && x$1.$low < targetDiff.$low))))) { break; } - _index = d.nd - 1 >> 0; - (x$5 = d.d, ((_index < 0 || _index >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + _index] = ((x$4 = d.d, ((_index < 0 || _index >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + _index])) - (1) << 24 >>> 24))); - currentDiff = (x$6 = ulpDecimal, new $Uint64(currentDiff.$high + x$6.$high, currentDiff.$low + x$6.$low)); - } - if ((x$7 = new $Uint64(currentDiff.$high + ulpDecimal.$high, currentDiff.$low + ulpDecimal.$low), x$8 = (x$9 = (x$10 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(targetDiff.$high + x$10.$high, targetDiff.$low + x$10.$low)), new $Uint64(x$9.$high + ulpBinary.$high, x$9.$low + ulpBinary.$low)), (x$7.$high < x$8.$high || (x$7.$high === x$8.$high && x$7.$low <= x$8.$low)))) { - return false; - } - if ((currentDiff.$high < ulpBinary.$high || (currentDiff.$high === ulpBinary.$high && currentDiff.$low < ulpBinary.$low)) || (x$11 = new $Uint64(maxDiff.$high - ulpBinary.$high, maxDiff.$low - ulpBinary.$low), (currentDiff.$high > x$11.$high || (currentDiff.$high === x$11.$high && currentDiff.$low > x$11.$low)))) { - return false; - } - if ((d.nd === 1) && ((x$12 = d.d, (0 >= x$12.$length ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + 0])) === 48)) { - d.nd = 0; - d.dp = 0; - } - return true; - }; - AppendFloat = function(dst, f, fmt, prec, bitSize) { - var bitSize, dst, f, fmt, prec; - return genericFtoa(dst, f, fmt, prec, bitSize); - }; - $pkg.AppendFloat = AppendFloat; - genericFtoa = function(dst, val, fmt, prec, bitSize) { - var _1, _2, _3, _4, _tuple, bitSize, bits$1, buf, buf$1, digits, digs, dst, exp, f, f$1, flt, fmt, lower, mant, neg, ok, prec, s, shortest, upper, val, x, x$1, x$2, x$3, y, y$1; - bits$1 = new $Uint64(0, 0); - flt = ptrType$1.nil; - _1 = bitSize; - if (_1 === (32)) { - bits$1 = (new $Uint64(0, math.Float32bits(($fround(val))))); - flt = float32info; - } else if (_1 === (64)) { - bits$1 = math.Float64bits(val); - flt = float64info; - } else { - $panic(new $String("strconv: illegal AppendFloat/FormatFloat bitSize")); - } - neg = !((x = $shiftRightUint64(bits$1, ((flt.expbits + flt.mantbits >>> 0))), (x.$high === 0 && x.$low === 0))); - exp = (($shiftRightUint64(bits$1, flt.mantbits).$low >> 0)) & ((((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)); - mant = (x$1 = (x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$2.$high - 0, x$2.$low - 1)), new $Uint64(bits$1.$high & x$1.$high, (bits$1.$low & x$1.$low) >>> 0)); - _2 = exp; - if (_2 === ((((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0))) { - s = ""; - if (!((mant.$high === 0 && mant.$low === 0))) { - s = "NaN"; - } else if (neg) { - s = "-Inf"; - } else { - s = "+Inf"; - } - return $appendSlice(dst, s); - } else if (_2 === (0)) { - exp = exp + (1) >> 0; - } else { - mant = (x$3 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high | x$3.$high, (mant.$low | x$3.$low) >>> 0)); - } - exp = exp + (flt.bias) >> 0; - if (fmt === 98) { - return fmtB(dst, neg, mant, exp, flt); - } - if (!optimize) { - return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); - } - digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); - ok = false; - shortest = prec < 0; - if (shortest) { - f = new extFloat.ptr(new $Uint64(0, 0), 0, false); - _tuple = f.AssignComputeBounds(mant, exp, neg, flt); - lower = $clone(_tuple[0], extFloat); - upper = $clone(_tuple[1], extFloat); - buf = arrayType$2.zero(); - digs.d = new sliceType$6(buf); - ok = f.ShortestDecimal(digs, lower, upper); - if (!ok) { - return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); - } - _3 = fmt; - if ((_3 === (101)) || (_3 === (69))) { - prec = max(digs.nd - 1 >> 0, 0); - } else if (_3 === (102)) { - prec = max(digs.nd - digs.dp >> 0, 0); - } else if ((_3 === (103)) || (_3 === (71))) { - prec = digs.nd; - } - } else if (!((fmt === 102))) { - digits = prec; - _4 = fmt; - if ((_4 === (101)) || (_4 === (69))) { - digits = digits + (1) >> 0; - } else if ((_4 === (103)) || (_4 === (71))) { - if (prec === 0) { - prec = 1; - } - digits = prec; - } - if (digits <= 15) { - buf$1 = arrayType$1.zero(); - digs.d = new sliceType$6(buf$1); - f$1 = new extFloat.ptr(mant, exp - ((flt.mantbits >> 0)) >> 0, neg); - ok = f$1.FixedDecimal(digs, digits); - } - } - if (!ok) { - return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); - } - return formatDigits(dst, shortest, neg, $clone(digs, decimalSlice), prec, fmt); - }; - bigFtoa = function(dst, prec, fmt, neg, mant, exp, flt) { - var _1, _2, d, digs, dst, exp, flt, fmt, mant, neg, prec, shortest; - d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - d.Assign(mant); - d.Shift(exp - ((flt.mantbits >> 0)) >> 0); - digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); - shortest = prec < 0; - if (shortest) { - roundShortest(d, mant, exp, flt); - decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); - _1 = fmt; - if ((_1 === (101)) || (_1 === (69))) { - prec = digs.nd - 1 >> 0; - } else if (_1 === (102)) { - prec = max(digs.nd - digs.dp >> 0, 0); - } else if ((_1 === (103)) || (_1 === (71))) { - prec = digs.nd; - } - } else { - _2 = fmt; - if ((_2 === (101)) || (_2 === (69))) { - d.Round(prec + 1 >> 0); - } else if (_2 === (102)) { - d.Round(d.dp + prec >> 0); - } else if ((_2 === (103)) || (_2 === (71))) { - if (prec === 0) { - prec = 1; - } - d.Round(prec); - } - decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); - } - return formatDigits(dst, shortest, neg, $clone(digs, decimalSlice), prec, fmt); - }; - formatDigits = function(dst, shortest, neg, digs, prec, fmt) { - var _1, digs, dst, eprec, exp, fmt, neg, prec, shortest; - _1 = fmt; - if ((_1 === (101)) || (_1 === (69))) { - return fmtE(dst, neg, $clone(digs, decimalSlice), prec, fmt); - } else if (_1 === (102)) { - return fmtF(dst, neg, $clone(digs, decimalSlice), prec); - } else if ((_1 === (103)) || (_1 === (71))) { - eprec = prec; - if (eprec > digs.nd && digs.nd >= digs.dp) { - eprec = digs.nd; - } - if (shortest) { - eprec = 6; - } - exp = digs.dp - 1 >> 0; - if (exp < -4 || exp >= eprec) { - if (prec > digs.nd) { - prec = digs.nd; - } - return fmtE(dst, neg, $clone(digs, decimalSlice), prec - 1 >> 0, (fmt + 101 << 24 >>> 24) - 103 << 24 >>> 24); - } - if (prec > digs.dp) { - prec = digs.nd; - } - return fmtF(dst, neg, $clone(digs, decimalSlice), max(prec - digs.dp >> 0, 0)); - } - return $append(dst, 37, fmt); - }; - roundShortest = function(d, mant, exp, flt) { - var d, exp, explo, flt, i, inclusive, l, lower, m, mant, mantlo, minexp, okdown, okup, u, upper, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; - if ((mant.$high === 0 && mant.$low === 0)) { - d.nd = 0; - return; - } - minexp = flt.bias + 1 >> 0; - if (exp > minexp && ($imul(332, ((d.dp - d.nd >> 0)))) >= ($imul(100, ((exp - ((flt.mantbits >> 0)) >> 0))))) { - return; - } - upper = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - upper.Assign((x = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x.$high + 0, x.$low + 1))); - upper.Shift((exp - ((flt.mantbits >> 0)) >> 0) - 1 >> 0); - mantlo = new $Uint64(0, 0); - explo = 0; - if ((x$1 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high > x$1.$high || (mant.$high === x$1.$high && mant.$low > x$1.$low))) || (exp === minexp)) { - mantlo = new $Uint64(mant.$high - 0, mant.$low - 1); - explo = exp; - } else { - mantlo = (x$2 = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x$2.$high - 0, x$2.$low - 1)); - explo = exp - 1 >> 0; - } - lower = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - lower.Assign((x$3 = $mul64(mantlo, new $Uint64(0, 2)), new $Uint64(x$3.$high + 0, x$3.$low + 1))); - lower.Shift((explo - ((flt.mantbits >> 0)) >> 0) - 1 >> 0); - inclusive = (x$4 = $div64(mant, new $Uint64(0, 2), true), (x$4.$high === 0 && x$4.$low === 0)); - i = 0; - while (true) { - if (!(i < d.nd)) { break; } - l = 48; - if (i < lower.nd) { - l = (x$5 = lower.d, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i])); - } - m = (x$6 = d.d, ((i < 0 || i >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i])); - u = 48; - if (i < upper.nd) { - u = (x$7 = upper.d, ((i < 0 || i >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i])); - } - okdown = !((l === m)) || inclusive && ((i + 1 >> 0) === lower.nd); - okup = !((m === u)) && (inclusive || (m + 1 << 24 >>> 24) < u || (i + 1 >> 0) < upper.nd); - if (okdown && okup) { - d.Round(i + 1 >> 0); - return; - } else if (okdown) { - d.RoundDown(i + 1 >> 0); - return; - } else if (okup) { - d.RoundUp(i + 1 >> 0); - return; - } - i = i + (1) >> 0; - } - }; - fmtE = function(dst, neg, d, prec, fmt) { - var _q, _q$1, _q$2, _r, _r$1, _r$2, ch, d, dst, exp, fmt, i, m, neg, prec, x; - if (neg) { - dst = $append(dst, 45); - } - ch = 48; - if (!((d.nd === 0))) { - ch = (x = d.d, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); - } - dst = $append(dst, ch); - if (prec > 0) { - dst = $append(dst, 46); - i = 1; - m = min(d.nd, prec + 1 >> 0); - if (i < m) { - dst = $appendSlice(dst, $subslice(d.d, i, m)); - i = m; - } - while (true) { - if (!(i <= prec)) { break; } - dst = $append(dst, 48); - i = i + (1) >> 0; - } - } - dst = $append(dst, fmt); - exp = d.dp - 1 >> 0; - if (d.nd === 0) { - exp = 0; - } - if (exp < 0) { - ch = 45; - exp = -exp; - } else { - ch = 43; - } - dst = $append(dst, ch); - if (exp < 10) { - dst = $append(dst, 48, ((exp << 24 >>> 24)) + 48 << 24 >>> 24); - } else if (exp < 100) { - dst = $append(dst, (((_q = exp / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r = exp % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); - } else { - dst = $append(dst, (((_q$1 = exp / 100, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (_r$1 = (((_q$2 = exp / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24, (((_r$2 = exp % 10, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); - } - return dst; - }; - fmtF = function(dst, neg, d, prec) { - var ch, d, dst, i, j, m, neg, prec, x; - if (neg) { - dst = $append(dst, 45); - } - if (d.dp > 0) { - m = min(d.nd, d.dp); - dst = $appendSlice(dst, $subslice(d.d, 0, m)); - while (true) { - if (!(m < d.dp)) { break; } - dst = $append(dst, 48); - m = m + (1) >> 0; - } - } else { - dst = $append(dst, 48); - } - if (prec > 0) { - dst = $append(dst, 46); - i = 0; - while (true) { - if (!(i < prec)) { break; } - ch = 48; - j = d.dp + i >> 0; - if (0 <= j && j < d.nd) { - ch = (x = d.d, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j])); - } - dst = $append(dst, ch); - i = i + (1) >> 0; - } - } - return dst; - }; - fmtB = function(dst, neg, mant, exp, flt) { - var _tuple, _tuple$1, dst, exp, flt, mant, neg; - if (neg) { - dst = $append(dst, 45); - } - _tuple = formatBits(dst, mant, 10, false, true); - dst = _tuple[0]; - dst = $append(dst, 112); - exp = exp - (((flt.mantbits >> 0))) >> 0; - if (exp >= 0) { - dst = $append(dst, 43); - } - _tuple$1 = formatBits(dst, (new $Uint64(0, exp)), 10, exp < 0, true); - dst = _tuple$1[0]; - return dst; - }; - min = function(a, b) { - var a, b; - if (a < b) { - return a; - } - return b; - }; - max = function(a, b) { - var a, b; - if (a > b) { - return a; - } - return b; - }; - FormatInt = function(i, base) { - var _tuple, base, i, s; - if (true && (0 < i.$high || (0 === i.$high && 0 <= i.$low)) && (i.$high < 0 || (i.$high === 0 && i.$low < 100)) && (base === 10)) { - return small((((i.$low + ((i.$high >> 31) * 4294967296)) >> 0))); - } - _tuple = formatBits(sliceType$6.nil, (new $Uint64(i.$high, i.$low)), base, (i.$high < 0 || (i.$high === 0 && i.$low < 0)), false); - s = _tuple[1]; - return s; - }; - $pkg.FormatInt = FormatInt; - Itoa = function(i) { - var i; - return FormatInt((new $Int64(0, i)), 10); - }; - $pkg.Itoa = Itoa; - small = function(i) { - var i; - if (i < 10) { - return $substring("0123456789abcdefghijklmnopqrstuvwxyz", i, (i + 1 >> 0)); - } - return $substring("00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899", ($imul(i, 2)), (($imul(i, 2)) + 2 >> 0)); - }; - formatBits = function(dst, u, base, neg, append_) { - var _q, _q$1, _r, _r$1, a, append_, b, b$1, base, d, dst, i, is, is$1, is$2, j, m, neg, q, q$1, s, shift, u, us, us$1, x, x$1, x$2, x$3, x$4, x$5; - d = sliceType$6.nil; - s = ""; - if (base < 2 || base > 36) { - $panic(new $String("strconv: illegal AppendInt/FormatInt base")); - } - a = arrayType$3.zero(); - i = 65; - if (neg) { - u = new $Uint64(-u.$high, -u.$low); - } - if (base === 10) { - if (true) { - while (true) { - if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 1000000000)))) { break; } - q = $div64(u, new $Uint64(0, 1000000000), false); - us = (((x = $mul64(q, new $Uint64(0, 1000000000)), new $Uint64(u.$high - x.$high, u.$low - x.$low)).$low >>> 0)); - j = 4; - while (true) { - if (!(j > 0)) { break; } - is = (_r = us % 100, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; - us = (_q = us / (100), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - i = i - (2) >> 0; - (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$1] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 1 >>> 0)))); - (x$2 = i + 0 >> 0, ((x$2 < 0 || x$2 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$2] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 0 >>> 0)))); - j = j - (1) >> 0; - } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(((us * 2 >>> 0) + 1 >>> 0))); - u = q; + base = 8; + s = $substring(s, 1); } } - us$1 = ((u.$low >>> 0)); - while (true) { - if (!(us$1 >= 100)) { break; } - is$1 = (_r$1 = us$1 % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; - us$1 = (_q$1 = us$1 / (100), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); - i = i - (2) >> 0; - (x$3 = i + 1 >> 0, ((x$3 < 0 || x$3 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$3] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 1 >>> 0)))); - (x$4 = i + 0 >> 0, ((x$4 < 0 || x$4 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$4] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 0 >>> 0)))); - } - is$2 = us$1 * 2 >>> 0; - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$2 + 1 >>> 0))); - if (us$1 >= 10) { - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(is$2)); - } - } else if (isPowerOfTwo(base)) { - shift = (((bits.TrailingZeros(((base >>> 0))) >>> 0)) & 31) >>> 0; - b = (new $Uint64(0, base)); - m = ((base >>> 0)) - 1 >>> 0; - while (true) { - if (!((u.$high > b.$high || (u.$high === b.$high && u.$low >= b.$low)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((((u.$low >>> 0)) & m) >>> 0))); - u = $shiftRightUint64(u, (shift)); - } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((u.$low >>> 0)))); } else { - b$1 = (new $Uint64(0, base)); - while (true) { - if (!((u.$high > b$1.$high || (u.$high === b$1.$high && u.$low >= b$1.$low)))) { break; } - i = i - (1) >> 0; - q$1 = $div64(u, b$1, false); - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((((x$5 = $mul64(q$1, b$1), new $Uint64(u.$high - x$5.$high, u.$low - x$5.$low)).$low >>> 0)))); - u = q$1; - } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((u.$low >>> 0)))); + return [new $Uint64(0, 0), baseError("ParseUint", s0, base)]; } - if (neg) { - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = 45); + if (bitSize === 0) { + bitSize = 32; + } else if (bitSize < 0 || bitSize > 64) { + return [new $Uint64(0, 0), bitSizeError("ParseUint", s0, bitSize)]; } - if (append_) { - d = $appendSlice(dst, $subslice(new sliceType$6(a), i)); - return [d, s]; + cutoff = new $Uint64(0, 0); + _1 = base; + if (_1 === (10)) { + cutoff = new $Uint64(429496729, 2576980378); + } else if (_1 === (16)) { + cutoff = new $Uint64(268435456, 0); + } else { + cutoff = (x = $div64(new $Uint64(4294967295, 4294967295), (new $Uint64(0, base)), false), new $Uint64(x.$high + 0, x.$low + 1)); } - s = ($bytesToString($subslice(new sliceType$6(a), i))); - return [d, s]; - }; - isPowerOfTwo = function(x) { - var x; - return (x & ((x - 1 >> 0))) === 0; - }; - quoteWith = function(s, quote, ASCIIonly, graphicOnly) { - var ASCIIonly, _q, graphicOnly, quote, s; - return ($bytesToString(appendQuotedWith($makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))), s, quote, ASCIIonly, graphicOnly))); - }; - appendQuotedWith = function(buf, s, quote, ASCIIonly, graphicOnly) { - var ASCIIonly, _tuple, buf, graphicOnly, quote, r, s, width; - buf = $append(buf, quote); - width = 0; + maxVal = (x$1 = $shiftLeft64(new $Uint64(0, 1), ((bitSize >>> 0))), new $Uint64(x$1.$high - 0, x$1.$low - 1)); + underscores = false; + n = new $Uint64(0, 0); + _ref = (new sliceType$6($stringToBytes(s))); + _i = 0; while (true) { - if (!(s.length > 0)) { break; } - r = ((s.charCodeAt(0) >> 0)); - width = 1; - if (r >= 128) { - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - width = _tuple[1]; - } - if ((width === 1) && (r === 65533)) { - buf = $appendSlice(buf, "\\x"); - buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt(0) >>> 4 << 24 >>> 24))); - buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt(0) & 15) >>> 0))); - s = $substring(s, width); + if (!(_i < _ref.$length)) { break; } + c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + d = 0; + if ((c === 95) && base0) { + underscores = true; + _i++; continue; - } - buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); - s = $substring(s, width); - } - buf = $append(buf, quote); - return buf; - }; - appendQuotedRuneWith = function(buf, r, quote, ASCIIonly, graphicOnly) { - var ASCIIonly, buf, graphicOnly, quote, r; - buf = $append(buf, quote); - if (!utf8.ValidRune(r)) { - r = 65533; - } - buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); - buf = $append(buf, quote); - return buf; - }; - appendEscapedRune = function(buf, r, quote, ASCIIonly, graphicOnly) { - var ASCIIonly, _1, buf, graphicOnly, n, quote, r, runeTmp, s, s$1; - runeTmp = arrayType$4.zero(); - if ((r === ((quote >> 0))) || (r === 92)) { - buf = $append(buf, 92); - buf = $append(buf, ((r << 24 >>> 24))); - return buf; - } - if (ASCIIonly) { - if (r < 128 && IsPrint(r)) { - buf = $append(buf, ((r << 24 >>> 24))); - return buf; - } - } else if (IsPrint(r) || graphicOnly && isInGraphicList(r)) { - n = utf8.EncodeRune(new sliceType$6(runeTmp), r); - buf = $appendSlice(buf, $subslice(new sliceType$6(runeTmp), 0, n)); - return buf; - } - _1 = r; - if (_1 === (7)) { - buf = $appendSlice(buf, "\\a"); - } else if (_1 === (8)) { - buf = $appendSlice(buf, "\\b"); - } else if (_1 === (12)) { - buf = $appendSlice(buf, "\\f"); - } else if (_1 === (10)) { - buf = $appendSlice(buf, "\\n"); - } else if (_1 === (13)) { - buf = $appendSlice(buf, "\\r"); - } else if (_1 === (9)) { - buf = $appendSlice(buf, "\\t"); - } else if (_1 === (11)) { - buf = $appendSlice(buf, "\\v"); - } else { - if (r < 32) { - buf = $appendSlice(buf, "\\x"); - buf = $append(buf, "0123456789abcdef".charCodeAt((((r << 24 >>> 24)) >>> 4 << 24 >>> 24))); - buf = $append(buf, "0123456789abcdef".charCodeAt(((((r << 24 >>> 24)) & 15) >>> 0))); - } else if (r > 1114111) { - r = 65533; - buf = $appendSlice(buf, "\\u"); - s = 12; - while (true) { - if (!(s >= 0)) { break; } - buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); - s = s - (4) >> 0; - } - } else if (r < 65536) { - buf = $appendSlice(buf, "\\u"); - s = 12; - while (true) { - if (!(s >= 0)) { break; } - buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); - s = s - (4) >> 0; - } + } else if (48 <= c && c <= 57) { + d = c - 48 << 24 >>> 24; + } else if (97 <= lower(c) && lower(c) <= 122) { + d = (lower(c) - 97 << 24 >>> 24) + 10 << 24 >>> 24; } else { - buf = $appendSlice(buf, "\\U"); - s$1 = 28; - while (true) { - if (!(s$1 >= 0)) { break; } - buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s$1 >>> 0)), 31)) >> 0) & 15))); - s$1 = s$1 - (4) >> 0; - } + return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; } + if (d >= ((base << 24 >>> 24))) { + return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; + } + if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { + return [maxVal, rangeError("ParseUint", s0)]; + } + n = $mul64(n, ((new $Uint64(0, base)))); + n1 = (x$2 = (new $Uint64(0, d)), new $Uint64(n.$high + x$2.$high, n.$low + x$2.$low)); + if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) { + return [maxVal, rangeError("ParseUint", s0)]; + } + n = n1; + _i++; } - return buf; + if (underscores && !underscoreOK(s0)) { + return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; + } + return [n, $ifaceNil]; }; - Quote = function(s) { - var s; - return quoteWith(s, 34, false, false); - }; - $pkg.Quote = Quote; - AppendQuote = function(dst, s) { - var dst, s; - return appendQuotedWith(dst, s, 34, false, false); - }; - $pkg.AppendQuote = AppendQuote; - AppendQuoteToASCII = function(dst, s) { - var dst, s; - return appendQuotedWith(dst, s, 34, true, false); - }; - $pkg.AppendQuoteToASCII = AppendQuoteToASCII; - AppendQuoteRune = function(dst, r) { - var dst, r; - return appendQuotedRuneWith(dst, r, 39, false, false); - }; - $pkg.AppendQuoteRune = AppendQuoteRune; - AppendQuoteRuneToASCII = function(dst, r) { - var dst, r; - return appendQuotedRuneWith(dst, r, 39, true, false); - }; - $pkg.AppendQuoteRuneToASCII = AppendQuoteRuneToASCII; - CanBackquote = function(s) { - var _tuple, r, s, wid; - while (true) { - if (!(s.length > 0)) { break; } - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - wid = _tuple[1]; - s = $substring(s, wid); - if (wid > 1) { - if (r === 65279) { - return false; - } - continue; - } - if (r === 65533) { - return false; - } - if ((r < 32 && !((r === 9))) || (r === 96) || (r === 127)) { - return false; - } - } - return true; - }; - $pkg.CanBackquote = CanBackquote; - unhex = function(b) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, c, ok, v; - v = 0; - ok = false; - c = ((b >> 0)); - if (48 <= c && c <= 57) { - _tmp = c - 48 >> 0; - _tmp$1 = true; - v = _tmp; - ok = _tmp$1; - return [v, ok]; - } else if (97 <= c && c <= 102) { - _tmp$2 = (c - 97 >> 0) + 10 >> 0; - _tmp$3 = true; - v = _tmp$2; - ok = _tmp$3; - return [v, ok]; - } else if (65 <= c && c <= 70) { - _tmp$4 = (c - 65 >> 0) + 10 >> 0; - _tmp$5 = true; - v = _tmp$4; - ok = _tmp$5; - return [v, ok]; - } - return [v, ok]; - }; - UnquoteChar = function(s, quote) { - var _1, _2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, c, c$1, err, j, j$1, multibyte, n, ok, quote, r, s, size, tail, v, v$1, value, x, x$1; - value = 0; - multibyte = false; - tail = ""; - err = $ifaceNil; - if (s.length === 0) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - c = s.charCodeAt(0); - if ((c === quote) && ((quote === 39) || (quote === 34))) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } else if (c >= 128) { - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - size = _tuple[1]; - _tmp = r; - _tmp$1 = true; - _tmp$2 = $substring(s, size); - _tmp$3 = $ifaceNil; - value = _tmp; - multibyte = _tmp$1; - tail = _tmp$2; - err = _tmp$3; - return [value, multibyte, tail, err]; - } else if (!((c === 92))) { - _tmp$4 = ((s.charCodeAt(0) >> 0)); - _tmp$5 = false; - _tmp$6 = $substring(s, 1); - _tmp$7 = $ifaceNil; - value = _tmp$4; - multibyte = _tmp$5; - tail = _tmp$6; - err = _tmp$7; - return [value, multibyte, tail, err]; - } - if (s.length <= 1) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - c$1 = s.charCodeAt(1); - s = $substring(s, 2); - switch (0) { default: - _1 = c$1; - if (_1 === (97)) { - value = 7; - } else if (_1 === (98)) { - value = 8; - } else if (_1 === (102)) { - value = 12; - } else if (_1 === (110)) { - value = 10; - } else if (_1 === (114)) { - value = 13; - } else if (_1 === (116)) { - value = 9; - } else if (_1 === (118)) { - value = 11; - } else if ((_1 === (120)) || (_1 === (117)) || (_1 === (85))) { - n = 0; - _2 = c$1; - if (_2 === (120)) { - n = 2; - } else if (_2 === (117)) { - n = 4; - } else if (_2 === (85)) { - n = 8; - } - v = 0; - if (s.length < n) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - j = 0; - while (true) { - if (!(j < n)) { break; } - _tuple$1 = unhex(s.charCodeAt(j)); - x = _tuple$1[0]; - ok = _tuple$1[1]; - if (!ok) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - v = (v << 4 >> 0) | x; - j = j + (1) >> 0; - } - s = $substring(s, n); - if (c$1 === 120) { - value = v; - break; - } - if (v > 1114111) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - value = v; - multibyte = true; - } else if ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55))) { - v$1 = ((c$1 >> 0)) - 48 >> 0; - if (s.length < 2) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - j$1 = 0; - while (true) { - if (!(j$1 < 2)) { break; } - x$1 = ((s.charCodeAt(j$1) >> 0)) - 48 >> 0; - if (x$1 < 0 || x$1 > 7) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - v$1 = ((v$1 << 3 >> 0)) | x$1; - j$1 = j$1 + (1) >> 0; - } - s = $substring(s, 2); - if (v$1 > 255) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - value = v$1; - } else if (_1 === (92)) { - value = 92; - } else if ((_1 === (39)) || (_1 === (34))) { - if (!((c$1 === quote))) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - value = ((c$1 >> 0)); - } else { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - } - tail = s; - return [value, multibyte, tail, err]; - }; - $pkg.UnquoteChar = UnquoteChar; - Unquote = function(s) { - var _1, _q, _tuple, _tuple$1, buf, buf$1, c, err, i, multibyte, n, n$1, quote, r, runeTmp, s, size, ss; - n = s.length; - if (n < 2) { - return ["", $pkg.ErrSyntax]; - } - quote = s.charCodeAt(0); - if (!((quote === s.charCodeAt((n - 1 >> 0))))) { - return ["", $pkg.ErrSyntax]; - } - s = $substring(s, 1, (n - 1 >> 0)); - if (quote === 96) { - if (contains(s, 96)) { - return ["", $pkg.ErrSyntax]; - } - if (contains(s, 13)) { - buf = $makeSlice(sliceType$6, 0, (s.length - 1 >> 0)); - i = 0; - while (true) { - if (!(i < s.length)) { break; } - if (!((s.charCodeAt(i) === 13))) { - buf = $append(buf, s.charCodeAt(i)); - } - i = i + (1) >> 0; - } - return [($bytesToString(buf)), $ifaceNil]; - } - return [s, $ifaceNil]; - } - if (!((quote === 34)) && !((quote === 39))) { - return ["", $pkg.ErrSyntax]; - } - if (contains(s, 10)) { - return ["", $pkg.ErrSyntax]; - } - if (!contains(s, 92) && !contains(s, quote)) { - _1 = quote; - if (_1 === (34)) { - if (utf8.ValidString(s)) { - return [s, $ifaceNil]; - } - } else if (_1 === (39)) { - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - size = _tuple[1]; - if ((size === s.length) && (!((r === 65533)) || !((size === 1)))) { - return [s, $ifaceNil]; - } - } - } - runeTmp = arrayType$4.zero(); - buf$1 = $makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); - while (true) { - if (!(s.length > 0)) { break; } - _tuple$1 = UnquoteChar(s, quote); - c = _tuple$1[0]; - multibyte = _tuple$1[1]; - ss = _tuple$1[2]; - err = _tuple$1[3]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return ["", err]; - } - s = ss; - if (c < 128 || !multibyte) { - buf$1 = $append(buf$1, ((c << 24 >>> 24))); - } else { - n$1 = utf8.EncodeRune(new sliceType$6(runeTmp), c); - buf$1 = $appendSlice(buf$1, $subslice(new sliceType$6(runeTmp), 0, n$1)); - } - if ((quote === 39) && !((s.length === 0))) { - return ["", $pkg.ErrSyntax]; - } - } - return [($bytesToString(buf$1)), $ifaceNil]; - }; - $pkg.Unquote = Unquote; - contains = function(s, c) { - var c, i, s; + $pkg.ParseUint = ParseUint; + underscoreOK = function(s) { + var hex, i, s, saw; + saw = 94; i = 0; + if (s.length >= 1 && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { + s = $substring(s, 1); + } + hex = false; + if (s.length >= 2 && (s.charCodeAt(0) === 48) && ((lower(s.charCodeAt(1)) === 98) || (lower(s.charCodeAt(1)) === 111) || (lower(s.charCodeAt(1)) === 120))) { + i = 2; + saw = 48; + hex = lower(s.charCodeAt(1)) === 120; + } while (true) { if (!(i < s.length)) { break; } - if (s.charCodeAt(i) === c) { - return true; + if (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57 || hex && 97 <= lower(s.charCodeAt(i)) && lower(s.charCodeAt(i)) <= 102) { + saw = 48; + i = i + (1) >> 0; + continue; } - i = i + (1) >> 0; - } - return false; - }; - bsearch16 = function(a, x) { - var _q, _tmp, _tmp$1, a, h, i, j, x; - _tmp = 0; - _tmp$1 = a.$length; - i = _tmp; - j = _tmp$1; - while (true) { - if (!(i < j)) { break; } - h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { - i = h + 1 >> 0; - } else { - j = h; + if (s.charCodeAt(i) === 95) { + if (!((saw === 48))) { + return false; + } + saw = 95; + i = i + (1) >> 0; + continue; } - } - return i; - }; - bsearch32 = function(a, x) { - var _q, _tmp, _tmp$1, a, h, i, j, x; - _tmp = 0; - _tmp$1 = a.$length; - i = _tmp; - j = _tmp$1; - while (true) { - if (!(i < j)) { break; } - h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { - i = h + 1 >> 0; - } else { - j = h; - } - } - return i; - }; - IsPrint = function(r) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, i, i$1, isNotPrint, isNotPrint$1, isPrint, isPrint$1, j, j$1, r, rr, rr$1, x, x$1, x$2, x$3; - if (r <= 255) { - if (32 <= r && r <= 126) { - return true; - } - if (161 <= r && r <= 255) { - return !((r === 173)); - } - return false; - } - if (0 <= r && r < 65536) { - _tmp = ((r << 16 >>> 16)); - _tmp$1 = isPrint16; - _tmp$2 = isNotPrint16; - rr = _tmp; - isPrint = _tmp$1; - isNotPrint = _tmp$2; - i = bsearch16(isPrint, rr); - if (i >= isPrint.$length || rr < (x = (i & ~1) >> 0, ((x < 0 || x >= isPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint.$array[isPrint.$offset + x])) || (x$1 = i | 1, ((x$1 < 0 || x$1 >= isPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint.$array[isPrint.$offset + x$1])) < rr) { + if (saw === 95) { return false; } - j = bsearch16(isNotPrint, rr); - return j >= isNotPrint.$length || !((((j < 0 || j >= isNotPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isNotPrint.$array[isNotPrint.$offset + j]) === rr)); + saw = 33; + i = i + (1) >> 0; } - _tmp$3 = ((r >>> 0)); - _tmp$4 = isPrint32; - _tmp$5 = isNotPrint32; - rr$1 = _tmp$3; - isPrint$1 = _tmp$4; - isNotPrint$1 = _tmp$5; - i$1 = bsearch32(isPrint$1, rr$1); - if (i$1 >= isPrint$1.$length || rr$1 < (x$2 = (i$1 & ~1) >> 0, ((x$2 < 0 || x$2 >= isPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint$1.$array[isPrint$1.$offset + x$2])) || (x$3 = i$1 | 1, ((x$3 < 0 || x$3 >= isPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint$1.$array[isPrint$1.$offset + x$3])) < rr$1) { - return false; - } - if (r >= 131072) { - return true; - } - r = r - (65536) >> 0; - j$1 = bsearch16(isNotPrint$1, ((r << 16 >>> 16))); - return j$1 >= isNotPrint$1.$length || !((((j$1 < 0 || j$1 >= isNotPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isNotPrint$1.$array[isNotPrint$1.$offset + j$1]) === ((r << 16 >>> 16)))); + return !((saw === 95)); }; - $pkg.IsPrint = IsPrint; - isInGraphicList = function(r) { - var i, r, rr; - if (r > 65535) { - return false; - } - rr = ((r << 16 >>> 16)); - i = bsearch16(isGraphic, rr); - return i < isGraphic.$length && (rr === ((i < 0 || i >= isGraphic.$length) ? ($throwRuntimeError("index out of range"), undefined) : isGraphic.$array[isGraphic.$offset + i])); - }; - ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$2.methods = [{prop: "set", name: "set", pkg: "strconv", typ: $funcType([$String], [$Bool], false)}, {prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Assign", name: "Assign", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "Shift", name: "Shift", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundDown", name: "RoundDown", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundUp", name: "RoundUp", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundedInteger", name: "RoundedInteger", pkg: "", typ: $funcType([], [$Uint64], false)}]; - ptrType$4.methods = [{prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "AssignComputeBounds", name: "AssignComputeBounds", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, ptrType$1], [extFloat, extFloat], false)}, {prop: "Normalize", name: "Normalize", pkg: "", typ: $funcType([], [$Uint], false)}, {prop: "Multiply", name: "Multiply", pkg: "", typ: $funcType([extFloat], [], false)}, {prop: "AssignDecimal", name: "AssignDecimal", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, $Bool, ptrType$1], [$Bool], false)}, {prop: "frexp10", name: "frexp10", pkg: "strconv", typ: $funcType([], [$Int, $Int], false)}, {prop: "FixedDecimal", name: "FixedDecimal", pkg: "", typ: $funcType([ptrType$3, $Int], [$Bool], false)}, {prop: "ShortestDecimal", name: "ShortestDecimal", pkg: "", typ: $funcType([ptrType$3, ptrType$4, ptrType$4], [$Bool], false)}]; - NumError.init("", [{prop: "Func", name: "Func", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Num", name: "Num", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); - decimal.init("strconv", [{prop: "d", name: "d", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "nd", name: "nd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "trunc", name: "trunc", embedded: false, exported: false, typ: $Bool, tag: ""}]); - leftCheat.init("strconv", [{prop: "delta", name: "delta", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "cutoff", name: "cutoff", embedded: false, exported: false, typ: $String, tag: ""}]); - extFloat.init("strconv", [{prop: "mant", name: "mant", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "exp", name: "exp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}]); + ptrType$2.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Assign", name: "Assign", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "Shift", name: "Shift", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundDown", name: "RoundDown", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundUp", name: "RoundUp", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundedInteger", name: "RoundedInteger", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "set", name: "set", pkg: "strconv", typ: $funcType([$String], [$Bool], false)}, {prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType], [$Uint64, $Bool], false)}]; + ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; floatInfo.init("strconv", [{prop: "mantbits", name: "mantbits", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "expbits", name: "expbits", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "bias", name: "bias", embedded: false, exported: false, typ: $Int, tag: ""}]); decimalSlice.init("strconv", [{prop: "d", name: "d", embedded: false, exported: false, typ: sliceType$6, tag: ""}, {prop: "nd", name: "nd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}]); + decimal.init("strconv", [{prop: "d", name: "d", embedded: false, exported: false, typ: arrayType$5, tag: ""}, {prop: "nd", name: "nd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "trunc", name: "trunc", embedded: false, exported: false, typ: $Bool, tag: ""}]); + leftCheat.init("strconv", [{prop: "delta", name: "delta", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "cutoff", name: "cutoff", embedded: false, exported: false, typ: $String, tag: ""}]); + NumError.init("", [{prop: "Func", name: "Func", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Num", name: "Num", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = bits.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - optimize = true; - $pkg.ErrRange = errors.New("value out of range"); - $pkg.ErrSyntax = errors.New("invalid syntax"); - leftcheats = new sliceType$3([new leftCheat.ptr(0, ""), new leftCheat.ptr(1, "5"), new leftCheat.ptr(1, "25"), new leftCheat.ptr(1, "125"), new leftCheat.ptr(2, "625"), new leftCheat.ptr(2, "3125"), new leftCheat.ptr(2, "15625"), new leftCheat.ptr(3, "78125"), new leftCheat.ptr(3, "390625"), new leftCheat.ptr(3, "1953125"), new leftCheat.ptr(4, "9765625"), new leftCheat.ptr(4, "48828125"), new leftCheat.ptr(4, "244140625"), new leftCheat.ptr(4, "1220703125"), new leftCheat.ptr(5, "6103515625"), new leftCheat.ptr(5, "30517578125"), new leftCheat.ptr(5, "152587890625"), new leftCheat.ptr(6, "762939453125"), new leftCheat.ptr(6, "3814697265625"), new leftCheat.ptr(6, "19073486328125"), new leftCheat.ptr(7, "95367431640625"), new leftCheat.ptr(7, "476837158203125"), new leftCheat.ptr(7, "2384185791015625"), new leftCheat.ptr(7, "11920928955078125"), new leftCheat.ptr(8, "59604644775390625"), new leftCheat.ptr(8, "298023223876953125"), new leftCheat.ptr(8, "1490116119384765625"), new leftCheat.ptr(9, "7450580596923828125"), new leftCheat.ptr(9, "37252902984619140625"), new leftCheat.ptr(9, "186264514923095703125"), new leftCheat.ptr(10, "931322574615478515625"), new leftCheat.ptr(10, "4656612873077392578125"), new leftCheat.ptr(10, "23283064365386962890625"), new leftCheat.ptr(10, "116415321826934814453125"), new leftCheat.ptr(11, "582076609134674072265625"), new leftCheat.ptr(11, "2910383045673370361328125"), new leftCheat.ptr(11, "14551915228366851806640625"), new leftCheat.ptr(12, "72759576141834259033203125"), new leftCheat.ptr(12, "363797880709171295166015625"), new leftCheat.ptr(12, "1818989403545856475830078125"), new leftCheat.ptr(13, "9094947017729282379150390625"), new leftCheat.ptr(13, "45474735088646411895751953125"), new leftCheat.ptr(13, "227373675443232059478759765625"), new leftCheat.ptr(13, "1136868377216160297393798828125"), new leftCheat.ptr(14, "5684341886080801486968994140625"), new leftCheat.ptr(14, "28421709430404007434844970703125"), new leftCheat.ptr(14, "142108547152020037174224853515625"), new leftCheat.ptr(15, "710542735760100185871124267578125"), new leftCheat.ptr(15, "3552713678800500929355621337890625"), new leftCheat.ptr(15, "17763568394002504646778106689453125"), new leftCheat.ptr(16, "88817841970012523233890533447265625"), new leftCheat.ptr(16, "444089209850062616169452667236328125"), new leftCheat.ptr(16, "2220446049250313080847263336181640625"), new leftCheat.ptr(16, "11102230246251565404236316680908203125"), new leftCheat.ptr(17, "55511151231257827021181583404541015625"), new leftCheat.ptr(17, "277555756156289135105907917022705078125"), new leftCheat.ptr(17, "1387778780781445675529539585113525390625"), new leftCheat.ptr(18, "6938893903907228377647697925567626953125"), new leftCheat.ptr(18, "34694469519536141888238489627838134765625"), new leftCheat.ptr(18, "173472347597680709441192448139190673828125"), new leftCheat.ptr(19, "867361737988403547205962240695953369140625")]); - smallPowersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(2147483648, 0), -63, false), new extFloat.ptr(new $Uint64(2684354560, 0), -60, false), new extFloat.ptr(new $Uint64(3355443200, 0), -57, false), new extFloat.ptr(new $Uint64(4194304000, 0), -54, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3276800000, 0), -47, false), new extFloat.ptr(new $Uint64(4096000000, 0), -44, false), new extFloat.ptr(new $Uint64(2560000000, 0), -40, false)]); - powersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(4203730336, 136053384), -1220, false), new extFloat.ptr(new $Uint64(3132023167, 2722021238), -1193, false), new extFloat.ptr(new $Uint64(2333539104, 810921078), -1166, false), new extFloat.ptr(new $Uint64(3477244234, 1573795306), -1140, false), new extFloat.ptr(new $Uint64(2590748842, 1432697645), -1113, false), new extFloat.ptr(new $Uint64(3860516611, 1025131999), -1087, false), new extFloat.ptr(new $Uint64(2876309015, 3348809418), -1060, false), new extFloat.ptr(new $Uint64(4286034428, 3200048207), -1034, false), new extFloat.ptr(new $Uint64(3193344495, 1097586188), -1007, false), new extFloat.ptr(new $Uint64(2379227053, 2424306748), -980, false), new extFloat.ptr(new $Uint64(3545324584, 827693699), -954, false), new extFloat.ptr(new $Uint64(2641472655, 2913388981), -927, false), new extFloat.ptr(new $Uint64(3936100983, 602835915), -901, false), new extFloat.ptr(new $Uint64(2932623761, 1081627501), -874, false), new extFloat.ptr(new $Uint64(2184974969, 1572261463), -847, false), new extFloat.ptr(new $Uint64(3255866422, 1308317239), -821, false), new extFloat.ptr(new $Uint64(2425809519, 944281679), -794, false), new extFloat.ptr(new $Uint64(3614737867, 629291719), -768, false), new extFloat.ptr(new $Uint64(2693189581, 2545915892), -741, false), new extFloat.ptr(new $Uint64(4013165208, 388672741), -715, false), new extFloat.ptr(new $Uint64(2990041083, 708162190), -688, false), new extFloat.ptr(new $Uint64(2227754207, 3536207675), -661, false), new extFloat.ptr(new $Uint64(3319612455, 450088378), -635, false), new extFloat.ptr(new $Uint64(2473304014, 3139815830), -608, false), new extFloat.ptr(new $Uint64(3685510180, 2103616900), -582, false), new extFloat.ptr(new $Uint64(2745919064, 224385782), -555, false), new extFloat.ptr(new $Uint64(4091738259, 3737383206), -529, false), new extFloat.ptr(new $Uint64(3048582568, 2868871352), -502, false), new extFloat.ptr(new $Uint64(2271371013, 1820084875), -475, false), new extFloat.ptr(new $Uint64(3384606560, 885076051), -449, false), new extFloat.ptr(new $Uint64(2521728396, 2444895829), -422, false), new extFloat.ptr(new $Uint64(3757668132, 1881767613), -396, false), new extFloat.ptr(new $Uint64(2799680927, 3102062735), -369, false), new extFloat.ptr(new $Uint64(4171849679, 2289335700), -343, false), new extFloat.ptr(new $Uint64(3108270227, 2410191823), -316, false), new extFloat.ptr(new $Uint64(2315841784, 3205436779), -289, false), new extFloat.ptr(new $Uint64(3450873173, 1697722806), -263, false), new extFloat.ptr(new $Uint64(2571100870, 3497754540), -236, false), new extFloat.ptr(new $Uint64(3831238852, 707476230), -210, false), new extFloat.ptr(new $Uint64(2854495385, 1769181907), -183, false), new extFloat.ptr(new $Uint64(4253529586, 2197867022), -157, false), new extFloat.ptr(new $Uint64(3169126500, 2450594539), -130, false), new extFloat.ptr(new $Uint64(2361183241, 1867548876), -103, false), new extFloat.ptr(new $Uint64(3518437208, 3793315116), -77, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3906250000, 0), -24, false), new extFloat.ptr(new $Uint64(2910383045, 2892103680), 3, false), new extFloat.ptr(new $Uint64(2168404344, 4170451332), 30, false), new extFloat.ptr(new $Uint64(3231174267, 3372684723), 56, false), new extFloat.ptr(new $Uint64(2407412430, 2078956656), 83, false), new extFloat.ptr(new $Uint64(3587324068, 2884206696), 109, false), new extFloat.ptr(new $Uint64(2672764710, 395977285), 136, false), new extFloat.ptr(new $Uint64(3982729777, 3569679143), 162, false), new extFloat.ptr(new $Uint64(2967364920, 2361961896), 189, false), new extFloat.ptr(new $Uint64(2210859150, 447440347), 216, false), new extFloat.ptr(new $Uint64(3294436857, 1114709402), 242, false), new extFloat.ptr(new $Uint64(2454546732, 2786846552), 269, false), new extFloat.ptr(new $Uint64(3657559652, 443583978), 295, false), new extFloat.ptr(new $Uint64(2725094297, 2599384906), 322, false), new extFloat.ptr(new $Uint64(4060706939, 3028118405), 348, false), new extFloat.ptr(new $Uint64(3025462433, 2044532855), 375, false), new extFloat.ptr(new $Uint64(2254145170, 1536935362), 402, false), new extFloat.ptr(new $Uint64(3358938053, 3365297469), 428, false), new extFloat.ptr(new $Uint64(2502603868, 4204241075), 455, false), new extFloat.ptr(new $Uint64(3729170365, 2577424355), 481, false), new extFloat.ptr(new $Uint64(2778448436, 3677981733), 508, false), new extFloat.ptr(new $Uint64(4140210802, 2744688476), 534, false), new extFloat.ptr(new $Uint64(3084697427, 1424604878), 561, false), new extFloat.ptr(new $Uint64(2298278679, 4062331362), 588, false), new extFloat.ptr(new $Uint64(3424702107, 3546052773), 614, false), new extFloat.ptr(new $Uint64(2551601907, 2065781727), 641, false), new extFloat.ptr(new $Uint64(3802183132, 2535403578), 667, false), new extFloat.ptr(new $Uint64(2832847187, 1558426518), 694, false), new extFloat.ptr(new $Uint64(4221271257, 2762425404), 720, false), new extFloat.ptr(new $Uint64(3145092172, 2812560400), 747, false), new extFloat.ptr(new $Uint64(2343276271, 3057687578), 774, false), new extFloat.ptr(new $Uint64(3491753744, 2790753324), 800, false), new extFloat.ptr(new $Uint64(2601559269, 3918606633), 827, false), new extFloat.ptr(new $Uint64(3876625403, 2711358621), 853, false), new extFloat.ptr(new $Uint64(2888311001, 1648096297), 880, false), new extFloat.ptr(new $Uint64(2151959390, 2057817989), 907, false), new extFloat.ptr(new $Uint64(3206669376, 61660461), 933, false), new extFloat.ptr(new $Uint64(2389154863, 1581580175), 960, false), new extFloat.ptr(new $Uint64(3560118173, 2626467905), 986, false), new extFloat.ptr(new $Uint64(2652494738, 3034782633), 1013, false), new extFloat.ptr(new $Uint64(3952525166, 3135207385), 1039, false), new extFloat.ptr(new $Uint64(2944860731, 2616258155), 1066, false)]); + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = bytealg.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = bits.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + isPrint16 = new sliceType([32, 126, 161, 887, 890, 895, 900, 1366, 1369, 1418, 1421, 1479, 1488, 1514, 1519, 1524, 1542, 1563, 1566, 1805, 1808, 1866, 1869, 1969, 1984, 2042, 2045, 2093, 2096, 2139, 2142, 2154, 2208, 2247, 2259, 2444, 2447, 2448, 2451, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2531, 2534, 2558, 2561, 2570, 2575, 2576, 2579, 2617, 2620, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2654, 2662, 2678, 2689, 2745, 2748, 2765, 2768, 2768, 2784, 2787, 2790, 2801, 2809, 2828, 2831, 2832, 2835, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2901, 2903, 2908, 2915, 2918, 2935, 2946, 2954, 2958, 2965, 2969, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3021, 3024, 3024, 3031, 3031, 3046, 3066, 3072, 3129, 3133, 3149, 3157, 3162, 3168, 3171, 3174, 3183, 3191, 3257, 3260, 3277, 3285, 3286, 3294, 3299, 3302, 3314, 3328, 3407, 3412, 3427, 3430, 3478, 3482, 3517, 3520, 3526, 3530, 3530, 3535, 3551, 3558, 3567, 3570, 3572, 3585, 3642, 3647, 3675, 3713, 3773, 3776, 3789, 3792, 3801, 3804, 3807, 3840, 3948, 3953, 4058, 4096, 4295, 4301, 4301, 4304, 4685, 4688, 4701, 4704, 4749, 4752, 4789, 4792, 4805, 4808, 4885, 4888, 4954, 4957, 4988, 4992, 5017, 5024, 5109, 5112, 5117, 5120, 5788, 5792, 5880, 5888, 5908, 5920, 5942, 5952, 5971, 5984, 6003, 6016, 6109, 6112, 6121, 6128, 6137, 6144, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6443, 6448, 6459, 6464, 6464, 6468, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6622, 6683, 6686, 6780, 6783, 6793, 6800, 6809, 6816, 6829, 6832, 6848, 6912, 6987, 6992, 7036, 7040, 7155, 7164, 7223, 7227, 7241, 7245, 7304, 7312, 7354, 7357, 7367, 7376, 7418, 7424, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8061, 8064, 8147, 8150, 8175, 8178, 8190, 8208, 8231, 8240, 8286, 8304, 8305, 8308, 8348, 8352, 8383, 8400, 8432, 8448, 8587, 8592, 9254, 9280, 9290, 9312, 11123, 11126, 11507, 11513, 11559, 11565, 11565, 11568, 11623, 11631, 11632, 11647, 11670, 11680, 11858, 11904, 12019, 12032, 12245, 12272, 12283, 12289, 12438, 12441, 12543, 12549, 12771, 12784, 40956, 40960, 42124, 42128, 42182, 42192, 42539, 42560, 42743, 42752, 42943, 42946, 42954, 42997, 43052, 43056, 43065, 43072, 43127, 43136, 43205, 43214, 43225, 43232, 43347, 43359, 43388, 43392, 43481, 43486, 43574, 43584, 43597, 43600, 43609, 43612, 43714, 43739, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43883, 43888, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64449, 64467, 64831, 64848, 64911, 64914, 64967, 65008, 65021, 65024, 65049, 65056, 65131, 65136, 65276, 65281, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65504, 65518, 65532, 65533]); + isNotPrint16 = new sliceType([173, 907, 909, 930, 1328, 1424, 1757, 2111, 2143, 2229, 2274, 2436, 2473, 2481, 2526, 2564, 2601, 2609, 2612, 2615, 2621, 2653, 2692, 2702, 2706, 2729, 2737, 2740, 2758, 2762, 2816, 2820, 2857, 2865, 2868, 2910, 2948, 2961, 2971, 2973, 3017, 3085, 3089, 3113, 3141, 3145, 3159, 3213, 3217, 3241, 3252, 3269, 3273, 3295, 3312, 3341, 3345, 3397, 3401, 3456, 3460, 3506, 3516, 3541, 3543, 3715, 3717, 3723, 3748, 3750, 3781, 3783, 3912, 3992, 4029, 4045, 4294, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6001, 6431, 6751, 7674, 8024, 8026, 8028, 8030, 8117, 8133, 8156, 8181, 8335, 11158, 11311, 11359, 11558, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 11743, 11930, 12352, 12592, 12687, 12831, 43470, 43519, 43815, 43823, 64311, 64317, 64319, 64322, 64325, 65107, 65127, 65141, 65511]); + isPrint32 = new sliceType$1([65536, 65613, 65616, 65629, 65664, 65786, 65792, 65794, 65799, 65843, 65847, 65948, 65952, 65952, 66000, 66045, 66176, 66204, 66208, 66256, 66272, 66299, 66304, 66339, 66349, 66378, 66384, 66426, 66432, 66499, 66504, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 66927, 66927, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67640, 67644, 67644, 67647, 67742, 67751, 67759, 67808, 67829, 67835, 67867, 67871, 67897, 67903, 67903, 67968, 68023, 68028, 68047, 68050, 68102, 68108, 68149, 68152, 68154, 68159, 68168, 68176, 68184, 68192, 68255, 68288, 68326, 68331, 68342, 68352, 68405, 68409, 68437, 68440, 68466, 68472, 68497, 68505, 68508, 68521, 68527, 68608, 68680, 68736, 68786, 68800, 68850, 68858, 68903, 68912, 68921, 69216, 69293, 69296, 69297, 69376, 69415, 69424, 69465, 69552, 69579, 69600, 69622, 69632, 69709, 69714, 69743, 69759, 69825, 69840, 69864, 69872, 69881, 69888, 69959, 69968, 70006, 70016, 70132, 70144, 70206, 70272, 70313, 70320, 70378, 70384, 70393, 70400, 70412, 70415, 70416, 70419, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70753, 70784, 70855, 70864, 70873, 71040, 71093, 71096, 71133, 71168, 71236, 71248, 71257, 71264, 71276, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71487, 71680, 71739, 71840, 71922, 71935, 71942, 71945, 71945, 71948, 71992, 71995, 72006, 72016, 72025, 72096, 72103, 72106, 72151, 72154, 72164, 72192, 72263, 72272, 72354, 72384, 72440, 72704, 72773, 72784, 72812, 72816, 72847, 72850, 72886, 72960, 73014, 73018, 73031, 73040, 73049, 73056, 73112, 73120, 73129, 73440, 73464, 73648, 73648, 73664, 73713, 73727, 74649, 74752, 74868, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92777, 92782, 92783, 92880, 92909, 92912, 92917, 92928, 92997, 93008, 93047, 93053, 93071, 93760, 93850, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94180, 94192, 94193, 94208, 100343, 100352, 101589, 101632, 101640, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113820, 113823, 118784, 119029, 119040, 119078, 119081, 119154, 119163, 119272, 119296, 119365, 119520, 119539, 119552, 119638, 119648, 119672, 119808, 119967, 119970, 119970, 119973, 119974, 119977, 120074, 120077, 120134, 120138, 120485, 120488, 120779, 120782, 121483, 121499, 121519, 122880, 122904, 122907, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123215, 123584, 123641, 123647, 123647, 124928, 125124, 125127, 125142, 125184, 125259, 125264, 125273, 125278, 125279, 126065, 126132, 126209, 126269, 126464, 126500, 126503, 126523, 126530, 126530, 126535, 126548, 126551, 126564, 126567, 126619, 126625, 126651, 126704, 126705, 126976, 127019, 127024, 127123, 127136, 127150, 127153, 127221, 127232, 127405, 127462, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 128727, 128736, 128748, 128752, 128764, 128768, 128883, 128896, 128984, 128992, 129003, 129024, 129035, 129040, 129095, 129104, 129113, 129120, 129159, 129168, 129197, 129200, 129201, 129280, 129619, 129632, 129645, 129648, 129652, 129656, 129658, 129664, 129670, 129680, 129704, 129712, 129718, 129728, 129730, 129744, 129750, 129792, 129994, 130032, 130041, 131072, 173789, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 196608, 201546, 917760, 917999]); + isNotPrint32 = new sliceType([12, 39, 59, 62, 399, 926, 2057, 2102, 2134, 2291, 2564, 2580, 2584, 3711, 3754, 4285, 4405, 4576, 4626, 4743, 4745, 4750, 4766, 4868, 4905, 4913, 4916, 4922, 5212, 6420, 6423, 6454, 7177, 7223, 7336, 7431, 7434, 7483, 7486, 7526, 7529, 7567, 7570, 9327, 27231, 27482, 27490, 54357, 54429, 54445, 54458, 54460, 54468, 54534, 54549, 54557, 54586, 54591, 54597, 54609, 55968, 57351, 57378, 57381, 60932, 60960, 60963, 60968, 60979, 60984, 60986, 61000, 61002, 61004, 61008, 61011, 61016, 61018, 61020, 61022, 61024, 61027, 61035, 61043, 61048, 61053, 61055, 61066, 61092, 61098, 61632, 61648, 63865, 63948, 64403]); + isGraphic = new sliceType([160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288]); uint64pow10 = $toNativeArray($kindUint64, [new $Uint64(0, 1), new $Uint64(0, 10), new $Uint64(0, 100), new $Uint64(0, 1000), new $Uint64(0, 10000), new $Uint64(0, 100000), new $Uint64(0, 1000000), new $Uint64(0, 10000000), new $Uint64(0, 100000000), new $Uint64(0, 1000000000), new $Uint64(2, 1410065408), new $Uint64(23, 1215752192), new $Uint64(232, 3567587328), new $Uint64(2328, 1316134912), new $Uint64(23283, 276447232), new $Uint64(232830, 2764472320), new $Uint64(2328306, 1874919424), new $Uint64(23283064, 1569325056), new $Uint64(232830643, 2808348672), new $Uint64(2328306436, 2313682944)]); float32info = new floatInfo.ptr(23, 8, -127); float64info = new floatInfo.ptr(52, 11, -1023); - isPrint16 = new sliceType$4([32, 126, 161, 887, 890, 895, 900, 1366, 1369, 1418, 1421, 1479, 1488, 1514, 1520, 1524, 1542, 1563, 1566, 1805, 1808, 1866, 1869, 1969, 1984, 2042, 2048, 2093, 2096, 2139, 2142, 2154, 2208, 2237, 2260, 2444, 2447, 2448, 2451, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2531, 2534, 2557, 2561, 2570, 2575, 2576, 2579, 2617, 2620, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2654, 2662, 2677, 2689, 2745, 2748, 2765, 2768, 2768, 2784, 2787, 2790, 2801, 2809, 2828, 2831, 2832, 2835, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2915, 2918, 2935, 2946, 2954, 2958, 2965, 2969, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3021, 3024, 3024, 3031, 3031, 3046, 3066, 3072, 3129, 3133, 3149, 3157, 3162, 3168, 3171, 3174, 3183, 3192, 3257, 3260, 3277, 3285, 3286, 3294, 3299, 3302, 3314, 3328, 3407, 3412, 3427, 3430, 3455, 3458, 3478, 3482, 3517, 3520, 3526, 3530, 3530, 3535, 3551, 3558, 3567, 3570, 3572, 3585, 3642, 3647, 3675, 3713, 3716, 3719, 3722, 3725, 3725, 3732, 3751, 3754, 3773, 3776, 3789, 3792, 3801, 3804, 3807, 3840, 3948, 3953, 4058, 4096, 4295, 4301, 4301, 4304, 4685, 4688, 4701, 4704, 4749, 4752, 4789, 4792, 4805, 4808, 4885, 4888, 4954, 4957, 4988, 4992, 5017, 5024, 5109, 5112, 5117, 5120, 5788, 5792, 5880, 5888, 5908, 5920, 5942, 5952, 5971, 5984, 6003, 6016, 6109, 6112, 6121, 6128, 6137, 6144, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6443, 6448, 6459, 6464, 6464, 6468, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6622, 6683, 6686, 6780, 6783, 6793, 6800, 6809, 6816, 6829, 6832, 6846, 6912, 6987, 6992, 7036, 7040, 7155, 7164, 7223, 7227, 7241, 7245, 7304, 7360, 7367, 7376, 7417, 7424, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8061, 8064, 8147, 8150, 8175, 8178, 8190, 8208, 8231, 8240, 8286, 8304, 8305, 8308, 8348, 8352, 8383, 8400, 8432, 8448, 8587, 8592, 9254, 9280, 9290, 9312, 11123, 11126, 11157, 11160, 11193, 11197, 11218, 11244, 11247, 11264, 11507, 11513, 11559, 11565, 11565, 11568, 11623, 11631, 11632, 11647, 11670, 11680, 11849, 11904, 12019, 12032, 12245, 12272, 12283, 12289, 12438, 12441, 12543, 12549, 12590, 12593, 12730, 12736, 12771, 12784, 19893, 19904, 40938, 40960, 42124, 42128, 42182, 42192, 42539, 42560, 42743, 42752, 42935, 42999, 43051, 43056, 43065, 43072, 43127, 43136, 43205, 43214, 43225, 43232, 43261, 43264, 43347, 43359, 43388, 43392, 43481, 43486, 43574, 43584, 43597, 43600, 43609, 43612, 43714, 43739, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43877, 43888, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64449, 64467, 64831, 64848, 64911, 64914, 64967, 65008, 65021, 65024, 65049, 65056, 65131, 65136, 65276, 65281, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65504, 65518, 65532, 65533]); - isNotPrint16 = new sliceType$4([173, 907, 909, 930, 1328, 1376, 1416, 1424, 1757, 2111, 2143, 2229, 2274, 2436, 2473, 2481, 2526, 2564, 2601, 2609, 2612, 2615, 2621, 2653, 2692, 2702, 2706, 2729, 2737, 2740, 2758, 2762, 2816, 2820, 2857, 2865, 2868, 2910, 2948, 2961, 2971, 2973, 3017, 3076, 3085, 3089, 3113, 3141, 3145, 3159, 3204, 3213, 3217, 3241, 3252, 3269, 3273, 3295, 3312, 3332, 3341, 3345, 3397, 3401, 3460, 3506, 3516, 3541, 3543, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3770, 3781, 3783, 3912, 3992, 4029, 4045, 4294, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6001, 6431, 6751, 7674, 8024, 8026, 8028, 8030, 8117, 8133, 8156, 8181, 8335, 11209, 11311, 11359, 11558, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 11743, 11930, 12352, 12687, 12831, 13055, 42927, 43470, 43519, 43815, 43823, 64311, 64317, 64319, 64322, 64325, 65107, 65127, 65141, 65511]); - isPrint32 = new sliceType$5([65536, 65613, 65616, 65629, 65664, 65786, 65792, 65794, 65799, 65843, 65847, 65947, 65952, 65952, 66000, 66045, 66176, 66204, 66208, 66256, 66272, 66299, 66304, 66339, 66349, 66378, 66384, 66426, 66432, 66499, 66504, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 66927, 66927, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67640, 67644, 67644, 67647, 67742, 67751, 67759, 67808, 67829, 67835, 67867, 67871, 67897, 67903, 67903, 67968, 68023, 68028, 68047, 68050, 68102, 68108, 68147, 68152, 68154, 68159, 68167, 68176, 68184, 68192, 68255, 68288, 68326, 68331, 68342, 68352, 68405, 68409, 68437, 68440, 68466, 68472, 68497, 68505, 68508, 68521, 68527, 68608, 68680, 68736, 68786, 68800, 68850, 68858, 68863, 69216, 69246, 69632, 69709, 69714, 69743, 69759, 69825, 69840, 69864, 69872, 69881, 69888, 69955, 69968, 70006, 70016, 70093, 70096, 70132, 70144, 70206, 70272, 70313, 70320, 70378, 70384, 70393, 70400, 70412, 70415, 70416, 70419, 70457, 70460, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70749, 70784, 70855, 70864, 70873, 71040, 71093, 71096, 71133, 71168, 71236, 71248, 71257, 71264, 71276, 71296, 71351, 71360, 71369, 71424, 71449, 71453, 71467, 71472, 71487, 71840, 71922, 71935, 71935, 72192, 72263, 72272, 72323, 72326, 72354, 72384, 72440, 72704, 72773, 72784, 72812, 72816, 72847, 72850, 72886, 72960, 73014, 73018, 73031, 73040, 73049, 73728, 74649, 74752, 74868, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92777, 92782, 92783, 92880, 92909, 92912, 92917, 92928, 92997, 93008, 93047, 93053, 93071, 93952, 94020, 94032, 94078, 94095, 94111, 94176, 94177, 94208, 100332, 100352, 101106, 110592, 110878, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113820, 113823, 118784, 119029, 119040, 119078, 119081, 119154, 119163, 119272, 119296, 119365, 119552, 119638, 119648, 119665, 119808, 119967, 119970, 119970, 119973, 119974, 119977, 120074, 120077, 120134, 120138, 120485, 120488, 120779, 120782, 121483, 121499, 121519, 122880, 122904, 122907, 122922, 124928, 125124, 125127, 125142, 125184, 125258, 125264, 125273, 125278, 125279, 126464, 126500, 126503, 126523, 126530, 126530, 126535, 126548, 126551, 126564, 126567, 126619, 126625, 126651, 126704, 126705, 126976, 127019, 127024, 127123, 127136, 127150, 127153, 127221, 127232, 127244, 127248, 127339, 127344, 127404, 127462, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 128724, 128736, 128748, 128752, 128760, 128768, 128883, 128896, 128980, 129024, 129035, 129040, 129095, 129104, 129113, 129120, 129159, 129168, 129197, 129280, 129291, 129296, 129356, 129360, 129387, 129408, 129431, 129472, 129472, 129488, 129510, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]); - isNotPrint32 = new sliceType$4([12, 39, 59, 62, 399, 926, 2057, 2102, 2134, 2291, 2564, 2580, 2584, 4285, 4405, 4576, 4626, 4743, 4745, 4750, 4766, 4868, 4905, 4913, 4916, 5210, 5212, 6813, 7177, 7223, 7336, 7431, 7434, 7483, 7486, 9327, 27231, 27482, 27490, 54357, 54429, 54445, 54458, 54460, 54468, 54534, 54549, 54557, 54586, 54591, 54597, 54609, 55968, 57351, 57378, 57381, 60932, 60960, 60963, 60968, 60979, 60984, 60986, 61000, 61002, 61004, 61008, 61011, 61016, 61018, 61020, 61022, 61024, 61027, 61035, 61043, 61048, 61053, 61055, 61066, 61092, 61098, 61632, 61648, 61743, 63807]); - isGraphic = new sliceType$4([160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288]); + detailedPowersOfTen = $toNativeArray($kindArray, [$toNativeArray($kindUint64, [new $Uint64(389204073, 3445679187), new $Uint64(4203730336, 136053384)]), $toNativeArray($kindUint64, [new $Uint64(243252546, 542936756), new $Uint64(2627331460, 85033365)]), $toNativeArray($kindUint64, [new $Uint64(1377807506, 2826154593), new $Uint64(3284164325, 106291706)]), $toNativeArray($kindUint64, [new $Uint64(3869743031, 1385209593), new $Uint64(4105205406, 1206606456)]), $toNativeArray($kindUint64, [new $Uint64(2418589394, 2476368732), new $Uint64(2565753378, 3975354507)]), $toNativeArray($kindUint64, [new $Uint64(1949494919, 947977267), new $Uint64(3207191723, 2821709486)]), $toNativeArray($kindUint64, [new $Uint64(289385001, 111229759), new $Uint64(4008989654, 2453395034)]), $toNativeArray($kindUint64, [new $Uint64(1254607449, 2753873159), new $Uint64(2505618534, 459630072)]), $toNativeArray($kindUint64, [new $Uint64(1568259312, 221115977), new $Uint64(3132023167, 2722021238)]), $toNativeArray($kindUint64, [new $Uint64(4107807788, 276394972), new $Uint64(3915028959, 2328784723)]), $toNativeArray($kindUint64, [new $Uint64(2030508955, 2320230505), new $Uint64(2446893099, 3066103188)]), $toNativeArray($kindUint64, [new $Uint64(2538136194, 1826546308), new $Uint64(3058616374, 2758887161)]), $toNativeArray($kindUint64, [new $Uint64(4246412067, 135699237), new $Uint64(3823270468, 1301125303)]), $toNativeArray($kindUint64, [new $Uint64(4264620277, 3842908407), new $Uint64(2389544042, 2960686962)]), $toNativeArray($kindUint64, [new $Uint64(3183291699, 1582410037), new $Uint64(2986930053, 1553375055)]), $toNativeArray($kindUint64, [new $Uint64(2905372800, 904270722), new $Uint64(3733662566, 3015460643)]), $toNativeArray($kindUint64, [new $Uint64(1278987088, 565169201), new $Uint64(2333539104, 810921078)]), $toNativeArray($kindUint64, [new $Uint64(3746217508, 706461501), new $Uint64(2916923880, 1013651347)]), $toNativeArray($kindUint64, [new $Uint64(3609030061, 883076877), new $Uint64(3646154850, 1267064184)]), $toNativeArray($kindUint64, [new $Uint64(2255643788, 1088793960), new $Uint64(2278846781, 1865656939)]), $toNativeArray($kindUint64, [new $Uint64(1745812911, 1360992450), new $Uint64(2848558476, 3405812998)]), $toNativeArray($kindUint64, [new $Uint64(34782491, 627498738), new $Uint64(3560698095, 4257266248)]), $toNativeArray($kindUint64, [new $Uint64(21739056, 4150283095), new $Uint64(2225436309, 4271404141)]), $toNativeArray($kindUint64, [new $Uint64(1100915645, 892886573), new $Uint64(2781795387, 2118029704)]), $toNativeArray($kindUint64, [new $Uint64(1376144556, 2189850041), new $Uint64(3477244234, 1573795306)]), $toNativeArray($kindUint64, [new $Uint64(1933832171, 3516139923), new $Uint64(2173277646, 2057363890)]), $toNativeArray($kindUint64, [new $Uint64(269806566, 3321433080), new $Uint64(2716597058, 424221215)]), $toNativeArray($kindUint64, [new $Uint64(3558483680, 2004307702), new $Uint64(3395746322, 2677760166)]), $toNativeArray($kindUint64, [new $Uint64(2300620952, 2505384628), new $Uint64(4244682903, 1199716560)]), $toNativeArray($kindUint64, [new $Uint64(1437888095, 1565865392), new $Uint64(2652926814, 2360435586)]), $toNativeArray($kindUint64, [new $Uint64(3944843767, 883589917), new $Uint64(3316158518, 803060834)]), $toNativeArray($kindUint64, [new $Uint64(2783571061, 30745572), new $Uint64(4145198147, 3151309691)]), $toNativeArray($kindUint64, [new $Uint64(1202861001, 556086894), new $Uint64(2590748842, 1432697645)]), $toNativeArray($kindUint64, [new $Uint64(2577318075, 1768850442), new $Uint64(3238436052, 3938355704)]), $toNativeArray($kindUint64, [new $Uint64(3221647594, 1137321229), new $Uint64(4048045066, 627977334)]), $toNativeArray($kindUint64, [new $Uint64(939787922, 1784567592), new $Uint64(2530028166, 1466227658)]), $toNativeArray($kindUint64, [new $Uint64(3322218551, 83225842), new $Uint64(3162535207, 3980268220)]), $toNativeArray($kindUint64, [new $Uint64(4152773188, 3325257774), new $Uint64(3953169009, 3901593451)]), $toNativeArray($kindUint64, [new $Uint64(2058612330, 4225769757), new $Uint64(2470730631, 827883171)]), $toNativeArray($kindUint64, [new $Uint64(1499523589, 3134728548), new $Uint64(3088413288, 4256079436)]), $toNativeArray($kindUint64, [new $Uint64(1874404487, 697185213), new $Uint64(3860516611, 1025131999)]), $toNativeArray($kindUint64, [new $Uint64(2782115540, 2046353494), new $Uint64(2412822882, 103836587)]), $toNativeArray($kindUint64, [new $Uint64(2403902601, 2557941868), new $Uint64(3016028602, 2277279382)]), $toNativeArray($kindUint64, [new $Uint64(857394603, 4271169159), new $Uint64(3770035753, 699115580)]), $toNativeArray($kindUint64, [new $Uint64(2683355275, 2132609812), new $Uint64(2356272345, 3121301797)]), $toNativeArray($kindUint64, [new $Uint64(132968622, 1592020441), new $Uint64(2945340432, 680401775)]), $toNativeArray($kindUint64, [new $Uint64(3387436249, 4137509200), new $Uint64(3681675540, 850502218)]), $toNativeArray($kindUint64, [new $Uint64(3190889480, 975330514), new $Uint64(2301047212, 2679047534)]), $toNativeArray($kindUint64, [new $Uint64(1841128202, 1219163142), new $Uint64(2876309015, 3348809418)]), $toNativeArray($kindUint64, [new $Uint64(153926604, 3671437576), new $Uint64(3595386269, 3112269949)]), $toNativeArray($kindUint64, [new $Uint64(633075040, 147164837), new $Uint64(2247116418, 2482039630)]), $toNativeArray($kindUint64, [new $Uint64(2938827448, 183956046), new $Uint64(2808895523, 955065889)]), $toNativeArray($kindUint64, [new $Uint64(452308838, 229945057), new $Uint64(3511119404, 120090538)]), $toNativeArray($kindUint64, [new $Uint64(1356434847, 3364941133), new $Uint64(2194449627, 2222540234)]), $toNativeArray($kindUint64, [new $Uint64(3843027207, 3132434592), new $Uint64(2743062034, 1704433468)]), $toNativeArray($kindUint64, [new $Uint64(508816713, 2841801416), new $Uint64(3428827542, 4278025484)]), $toNativeArray($kindUint64, [new $Uint64(636020892, 331026298), new $Uint64(4286034428, 3200048207)]), $toNativeArray($kindUint64, [new $Uint64(2008125793, 2354375084), new $Uint64(2678771517, 4147513777)]), $toNativeArray($kindUint64, [new $Uint64(3583899065, 4016710679), new $Uint64(3348464397, 1963166749)]), $toNativeArray($kindUint64, [new $Uint64(1258648360, 1799662877), new $Uint64(4185580496, 3527700261)]), $toNativeArray($kindUint64, [new $Uint64(1323526137, 1124789298), new $Uint64(2615987810, 2204812663)]), $toNativeArray($kindUint64, [new $Uint64(580665847, 2479728447), new $Uint64(3269984763, 608532181)]), $toNativeArray($kindUint64, [new $Uint64(1799574133, 2025918735), new $Uint64(4087480953, 3981890698)]), $toNativeArray($kindUint64, [new $Uint64(2198475657, 1803070121), new $Uint64(2554675596, 878068950)]), $toNativeArray($kindUint64, [new $Uint64(600610923, 3327579475), new $Uint64(3193344495, 1097586188)]), $toNativeArray($kindUint64, [new $Uint64(750763654, 3085732520), new $Uint64(3991680619, 298240911)]), $toNativeArray($kindUint64, [new $Uint64(2079840020, 854841001), new $Uint64(2494800386, 3944496953)]), $toNativeArray($kindUint64, [new $Uint64(3673541849, 1068551251), new $Uint64(3118500483, 2783137543)]), $toNativeArray($kindUint64, [new $Uint64(3518185487, 2409430888), new $Uint64(3898125604, 2405180105)]), $toNativeArray($kindUint64, [new $Uint64(588253193, 3116507041), new $Uint64(2436328502, 3650721214)]), $toNativeArray($kindUint64, [new $Uint64(2882800140, 674408330), new $Uint64(3045410628, 2415917869)]), $toNativeArray($kindUint64, [new $Uint64(382274703, 843010412), new $Uint64(3806763285, 3019897337)]), $toNativeArray($kindUint64, [new $Uint64(2923276249, 2137494243), new $Uint64(2379227053, 2424306747)]), $toNativeArray($kindUint64, [new $Uint64(2580353487, 3745609628), new $Uint64(2974033816, 4104125258)]), $toNativeArray($kindUint64, [new $Uint64(1077958211, 3608270211), new $Uint64(3717542271, 835189277)]), $toNativeArray($kindUint64, [new $Uint64(1210594794, 1718297970), new $Uint64(2323463919, 2132606034)]), $toNativeArray($kindUint64, [new $Uint64(3660727141, 388815), new $Uint64(2904329899, 1592015718)]), $toNativeArray($kindUint64, [new $Uint64(2428425278, 1074227842), new $Uint64(3630412374, 916277824)]), $toNativeArray($kindUint64, [new $Uint64(1517765798, 3892617873), new $Uint64(2269007733, 3793899112)]), $toNativeArray($kindUint64, [new $Uint64(1897207248, 2718288694), new $Uint64(2836259667, 1521148418)]), $toNativeArray($kindUint64, [new $Uint64(224025412, 3397860867), new $Uint64(3545324584, 827693699)]), $toNativeArray($kindUint64, [new $Uint64(3898112266, 4271146690), new $Uint64(2215827865, 517308561)]), $toNativeArray($kindUint64, [new $Uint64(1651414861, 3191449714), new $Uint64(2769784831, 1720377526)]), $toNativeArray($kindUint64, [new $Uint64(4211752225, 768086671), new $Uint64(3462231039, 1076730083)]), $toNativeArray($kindUint64, [new $Uint64(2095474228, 3164408729), new $Uint64(2163894399, 2283569038)]), $toNativeArray($kindUint64, [new $Uint64(471859137, 3955510912), new $Uint64(2704867999, 1780719474)]), $toNativeArray($kindUint64, [new $Uint64(2737307570, 1723163168), new $Uint64(3381084999, 1152157518)]), $toNativeArray($kindUint64, [new $Uint64(1274150815, 6470312), new $Uint64(4226356249, 366455074)]), $toNativeArray($kindUint64, [new $Uint64(1870086083, 1614656681), new $Uint64(2641472655, 2913388981)]), $toNativeArray($kindUint64, [new $Uint64(3411349428, 944579027), new $Uint64(3301840819, 2567994402)]), $toNativeArray($kindUint64, [new $Uint64(2116703137, 1180723784), new $Uint64(4127301024, 2136251179)]), $toNativeArray($kindUint64, [new $Uint64(786068548, 3422306925), new $Uint64(2579563140, 1335156987)]), $toNativeArray($kindUint64, [new $Uint64(4203811157, 4277883656), new $Uint64(3224453925, 1668946233)]), $toNativeArray($kindUint64, [new $Uint64(2033538475, 2126129098), new $Uint64(4030567406, 3159924616)]), $toNativeArray($kindUint64, [new $Uint64(1270961547, 791959774), new $Uint64(2519104629, 901211061)]), $toNativeArray($kindUint64, [new $Uint64(2662443757, 4211175190), new $Uint64(3148880786, 2200255650)]), $toNativeArray($kindUint64, [new $Uint64(1180571049, 2042743516), new $Uint64(3936100983, 602835915)]), $toNativeArray($kindUint64, [new $Uint64(200985993, 3961069257), new $Uint64(2460063114, 1987385183)]), $toNativeArray($kindUint64, [new $Uint64(3472457964, 1730111099), new $Uint64(3075078893, 336747830)]), $toNativeArray($kindUint64, [new $Uint64(2193088807, 2162638874), new $Uint64(3843848616, 1494676612)]), $toNativeArray($kindUint64, [new $Uint64(3518164152, 2962262032), new $Uint64(2402405385, 934172882)]), $toNativeArray($kindUint64, [new $Uint64(2250221542, 3702827541), new $Uint64(3003006731, 2241457927)]), $toNativeArray($kindUint64, [new $Uint64(1739035104, 2481050778), new $Uint64(3753758414, 1728080585)]), $toNativeArray($kindUint64, [new $Uint64(3771251500, 1550656736), new $Uint64(2346099009, 6308541)]), $toNativeArray($kindUint64, [new $Uint64(1492838903, 1938320920), new $Uint64(2932623761, 1081627501)]), $toNativeArray($kindUint64, [new $Uint64(2939790453, 1349159326), new $Uint64(3665779701, 2425776200)]), $toNativeArray($kindUint64, [new $Uint64(1837369033, 1380095491), new $Uint64(2291112313, 2052981037)]), $toNativeArray($kindUint64, [new $Uint64(3370453115, 2798861187), new $Uint64(2863890391, 3639968120)]), $toNativeArray($kindUint64, [new $Uint64(4213066394, 2424834660), new $Uint64(3579862989, 3476218326)]), $toNativeArray($kindUint64, [new $Uint64(1559424672, 2589263487), new $Uint64(2237414368, 2709507366)]), $toNativeArray($kindUint64, [new $Uint64(4096764488, 3236579358), new $Uint64(2796767960, 3386884207)]), $toNativeArray($kindUint64, [new $Uint64(4047213786, 4045724198), new $Uint64(3495959950, 4233605259)]), $toNativeArray($kindUint64, [new $Uint64(1992637704, 3602319448), new $Uint64(2184974969, 1572261463)]), $toNativeArray($kindUint64, [new $Uint64(1417055307, 207932014), new $Uint64(2731218711, 3039068653)]), $toNativeArray($kindUint64, [new $Uint64(2845060957, 3481140489), new $Uint64(3414023389, 2725093992)]), $toNativeArray($kindUint64, [new $Uint64(3556326197, 1130200140), new $Uint64(4267529237, 185142018)]), $toNativeArray($kindUint64, [new $Uint64(3296445697, 1243245999), new $Uint64(2667205773, 652584673)]), $toNativeArray($kindUint64, [new $Uint64(899331649, 2627799323), new $Uint64(3334007216, 1889472666)]), $toNativeArray($kindUint64, [new $Uint64(3271648210, 63523682), new $Uint64(4167509020, 2361840832)]), $toNativeArray($kindUint64, [new $Uint64(2044780131, 1113444125), new $Uint64(2604693137, 3623634168)]), $toNativeArray($kindUint64, [new $Uint64(2555975164, 318063332), new $Uint64(3255866422, 1308317238)]), $toNativeArray($kindUint64, [new $Uint64(1047485307, 397579165), new $Uint64(4069833027, 3782880196)]), $toNativeArray($kindUint64, [new $Uint64(2802161964, 4006583362), new $Uint64(2543645642, 1827429210)]), $toNativeArray($kindUint64, [new $Uint64(1355218808, 713261907), new $Uint64(3179557053, 136802865)]), $toNativeArray($kindUint64, [new $Uint64(2767765334, 891577384), new $Uint64(3974446316, 1244745405)]), $toNativeArray($kindUint64, [new $Uint64(2266724245, 3778461337), new $Uint64(2484028947, 2925449526)]), $toNativeArray($kindUint64, [new $Uint64(685921659, 1501851199), new $Uint64(3105036184, 2583070084)]), $toNativeArray($kindUint64, [new $Uint64(857402074, 803572175), new $Uint64(3881295230, 3228837605)]), $toNativeArray($kindUint64, [new $Uint64(1072747208, 1575974433), new $Uint64(2425809519, 944281679)]), $toNativeArray($kindUint64, [new $Uint64(267192186, 1969968041), new $Uint64(3032261899, 106610275)]), $toNativeArray($kindUint64, [new $Uint64(3555215705, 314976404), new $Uint64(3790327373, 3354488315)]), $toNativeArray($kindUint64, [new $Uint64(1685138903, 2881214812), new $Uint64(2368954608, 2633426109)]), $toNativeArray($kindUint64, [new $Uint64(3180165453, 2527776691), new $Uint64(2961193260, 3291782636)]), $toNativeArray($kindUint64, [new $Uint64(3975206816, 4233462688), new $Uint64(3701491575, 4114728295)]), $toNativeArray($kindUint64, [new $Uint64(4095116996, 2645914180), new $Uint64(2313432234, 4182317920)]), $toNativeArray($kindUint64, [new $Uint64(823928949, 3307392725), new $Uint64(2891790293, 3080413753)]), $toNativeArray($kindUint64, [new $Uint64(2103653011, 913015435), new $Uint64(3614737867, 629291719)]), $toNativeArray($kindUint64, [new $Uint64(2925395868, 33763735), new $Uint64(2259211166, 4151403708)]), $toNativeArray($kindUint64, [new $Uint64(3656744835, 42204668), new $Uint64(2824013958, 3041770987)]), $toNativeArray($kindUint64, [new $Uint64(3497189219, 3273981307), new $Uint64(3530017448, 1654730086)]), $toNativeArray($kindUint64, [new $Uint64(1112001438, 1509367405), new $Uint64(2206260905, 1034206304)]), $toNativeArray($kindUint64, [new $Uint64(1390001797, 4034192904), new $Uint64(2757826131, 2366499704)]), $toNativeArray($kindUint64, [new $Uint64(1737502247, 1821515659), new $Uint64(3447282664, 1884382806)]), $toNativeArray($kindUint64, [new $Uint64(12197080, 2749060022), new $Uint64(2154551665, 1177739254)]), $toNativeArray($kindUint64, [new $Uint64(2162729998, 3436325028), new $Uint64(2693189581, 2545915891)]), $toNativeArray($kindUint64, [new $Uint64(1629670674, 2147922637), new $Uint64(3366486976, 4256136688)]), $toNativeArray($kindUint64, [new $Uint64(2037088343, 537419649), new $Uint64(4208108721, 1025203564)]), $toNativeArray($kindUint64, [new $Uint64(3420663862, 1946500016), new $Uint64(2630067950, 3325106787)]), $toNativeArray($kindUint64, [new $Uint64(3202088004, 285641372), new $Uint64(3287584938, 2008899836)]), $toNativeArray($kindUint64, [new $Uint64(4002610005, 357051716), new $Uint64(4109481173, 363641147)]), $toNativeArray($kindUint64, [new $Uint64(1964760341, 760028234), new $Uint64(2568425733, 764146629)]), $toNativeArray($kindUint64, [new $Uint64(3529692250, 2023777117), new $Uint64(3210532166, 2028925110)]), $toNativeArray($kindUint64, [new $Uint64(2264631665, 382237748), new $Uint64(4013165208, 388672740)]), $toNativeArray($kindUint64, [new $Uint64(3562878438, 2923253152), new $Uint64(2508228255, 242920462)]), $toNativeArray($kindUint64, [new $Uint64(2306114400, 1506582793), new $Uint64(3135285318, 3524876050)]), $toNativeArray($kindUint64, [new $Uint64(735159352, 1883228491), new $Uint64(3919106648, 2258611415)]), $toNativeArray($kindUint64, [new $Uint64(2070087331, 1177017807), new $Uint64(2449441655, 1411632134)]), $toNativeArray($kindUint64, [new $Uint64(440125516, 397530434), new $Uint64(3061802069, 690798344)]), $toNativeArray($kindUint64, [new $Uint64(550156895, 496913043), new $Uint64(3827252586, 1937239754)]), $toNativeArray($kindUint64, [new $Uint64(1417589883, 1921183388), new $Uint64(2392032866, 2284516670)]), $toNativeArray($kindUint64, [new $Uint64(3919471002, 1327737411), new $Uint64(2990041083, 708162189)]), $toNativeArray($kindUint64, [new $Uint64(1678113280, 3807155412), new $Uint64(3737551353, 4106428209)]), $toNativeArray($kindUint64, [new $Uint64(3733175360, 2379472132), new $Uint64(2335969596, 955904894)]), $toNativeArray($kindUint64, [new $Uint64(2518985552, 2974340165), new $Uint64(2919961995, 1194881118)]), $toNativeArray($kindUint64, [new $Uint64(1001248292, 3717925207), new $Uint64(3649952494, 419859574)]), $toNativeArray($kindUint64, [new $Uint64(3847005655, 176219606), new $Uint64(2281220308, 3483637705)]), $toNativeArray($kindUint64, [new $Uint64(1587531596, 3441499980), new $Uint64(2851525386, 59579836)]), $toNativeArray($kindUint64, [new $Uint64(1984414496, 6907679), new $Uint64(3564406732, 2221958443)]), $toNativeArray($kindUint64, [new $Uint64(703388148, 4317299), new $Uint64(2227754207, 3536207675)]), $toNativeArray($kindUint64, [new $Uint64(4100460657, 5396624), new $Uint64(2784692759, 3346517769)]), $toNativeArray($kindUint64, [new $Uint64(1904350349, 1080487604), new $Uint64(3480865949, 3109405388)]), $toNativeArray($kindUint64, [new $Uint64(3337702616, 1212175664), new $Uint64(2175541218, 2480249279)]), $toNativeArray($kindUint64, [new $Uint64(3098386446, 1515219580), new $Uint64(2719426523, 952827951)]), $toNativeArray($kindUint64, [new $Uint64(2799241233, 4041508124), new $Uint64(3399283154, 117293115)]), $toNativeArray($kindUint64, [new $Uint64(2425309718, 1830659683), new $Uint64(4249103942, 2294100042)]), $toNativeArray($kindUint64, [new $Uint64(2589560398, 70420478), new $Uint64(2655689964, 360070702)]), $toNativeArray($kindUint64, [new $Uint64(1089466849, 2235509245), new $Uint64(3319612455, 450088378)]), $toNativeArray($kindUint64, [new $Uint64(3509317209, 3868128380), new $Uint64(4149515568, 3783835944)]), $toNativeArray($kindUint64, [new $Uint64(2193323256, 806967502), new $Uint64(2593447230, 2364897465)]), $toNativeArray($kindUint64, [new $Uint64(3815395894, 1008709377), new $Uint64(3241809038, 808638183)]), $toNativeArray($kindUint64, [new $Uint64(3695503043, 3408370369), new $Uint64(4052261297, 3158281377)]), $toNativeArray($kindUint64, [new $Uint64(699076666, 1593360569), new $Uint64(2532663311, 363313125)]), $toNativeArray($kindUint64, [new $Uint64(1947587656, 4139184359), new $Uint64(3165829138, 3675366878)]), $toNativeArray($kindUint64, [new $Uint64(287000923, 879013153), new $Uint64(3957286423, 2446724950)]), $toNativeArray($kindUint64, [new $Uint64(3400601049, 12512308), new $Uint64(2473304014, 3139815829)]), $toNativeArray($kindUint64, [new $Uint64(1029525839, 1089382210), new $Uint64(3091630018, 1777286139)]), $toNativeArray($kindUint64, [new $Uint64(213165475, 287985938), new $Uint64(3864537523, 74124026)]), $toNativeArray($kindUint64, [new $Uint64(1206970245, 3938087595), new $Uint64(2415335951, 3804423900)]), $toNativeArray($kindUint64, [new $Uint64(1508712807, 1701384022), new $Uint64(3019169939, 3681788051)]), $toNativeArray($kindUint64, [new $Uint64(812149185, 1052988204), new $Uint64(3773962424, 3528493240)]), $toNativeArray($kindUint64, [new $Uint64(507593240, 3342472187), new $Uint64(2358726515, 2205308275)]), $toNativeArray($kindUint64, [new $Uint64(3855717022, 4178090234), new $Uint64(2948408144, 1682893519)]), $toNativeArray($kindUint64, [new $Uint64(3745904454, 3075129145), new $Uint64(3685510180, 2103616899)]), $toNativeArray($kindUint64, [new $Uint64(1804319372, 848213891), new $Uint64(2303443862, 3462244210)]), $toNativeArray($kindUint64, [new $Uint64(107915567, 1060267364), new $Uint64(2879304828, 2180321615)]), $toNativeArray($kindUint64, [new $Uint64(3356119931, 251592381), new $Uint64(3599131035, 2725402018)]), $toNativeArray($kindUint64, [new $Uint64(3171316780, 3915341622), new $Uint64(2249456897, 1166505349)]), $toNativeArray($kindUint64, [new $Uint64(742920504, 599209732), new $Uint64(2811821121, 2531873511)]), $toNativeArray($kindUint64, [new $Uint64(4149876102, 749012165), new $Uint64(3514776401, 4238583712)]), $toNativeArray($kindUint64, [new $Uint64(2593672563, 3689358075), new $Uint64(2196735251, 1038502084)]), $toNativeArray($kindUint64, [new $Uint64(3242090704, 3537955770), new $Uint64(2745919064, 224385781)]), $toNativeArray($kindUint64, [new $Uint64(831387909, 127477416), new $Uint64(3432398830, 280482227)]), $toNativeArray($kindUint64, [new $Uint64(4260460358, 1233088594), new $Uint64(4290498537, 2498086431)]), $toNativeArray($kindUint64, [new $Uint64(4273400459, 3991905843), new $Uint64(2681561585, 4245658579)]), $toNativeArray($kindUint64, [new $Uint64(4268008750, 3916140480), new $Uint64(3351951982, 2085847752)]), $toNativeArray($kindUint64, [new $Uint64(1040043642, 2747691952), new $Uint64(4189939978, 459826043)]), $toNativeArray($kindUint64, [new $Uint64(113156364, 2791049294), new $Uint64(2618712486, 1361133101)]), $toNativeArray($kindUint64, [new $Uint64(1215187279, 3488811618), new $Uint64(3273390607, 3848900024)]), $toNativeArray($kindUint64, [new $Uint64(1518984099, 3287272698), new $Uint64(4091738259, 3737383206)]), $toNativeArray($kindUint64, [new $Uint64(4170590534, 1517674524), new $Uint64(2557336412, 1798993591)]), $toNativeArray($kindUint64, [new $Uint64(4139496343, 4044576803), new $Uint64(3196670515, 2248741989)]), $toNativeArray($kindUint64, [new $Uint64(1953144957, 3981979180), new $Uint64(3995838144, 1737185663)]), $toNativeArray($kindUint64, [new $Uint64(2831328334, 3025607900), new $Uint64(2497398840, 1085741039)]), $toNativeArray($kindUint64, [new $Uint64(2465418594, 1634526227), new $Uint64(3121748550, 1357176299)]), $toNativeArray($kindUint64, [new $Uint64(2008031418, 4190641431), new $Uint64(3902185687, 3843954022)]), $toNativeArray($kindUint64, [new $Uint64(181277812, 3692892718), new $Uint64(2438866054, 4013084000)]), $toNativeArray($kindUint64, [new $Uint64(226597266, 321148602), new $Uint64(3048582568, 2868871352)]), $toNativeArray($kindUint64, [new $Uint64(283246582, 2548919401), new $Uint64(3810728210, 3586089190)]), $toNativeArray($kindUint64, [new $Uint64(3398254586, 519332801), new $Uint64(2381705131, 3315047567)]), $toNativeArray($kindUint64, [new $Uint64(3174076408, 2796649650), new $Uint64(2977131414, 3070067635)]), $toNativeArray($kindUint64, [new $Uint64(2893853686, 3495812062), new $Uint64(3721414268, 1690100896)]), $toNativeArray($kindUint64, [new $Uint64(1808658554, 1111140715), new $Uint64(2325883917, 3203796708)]), $toNativeArray($kindUint64, [new $Uint64(2260823192, 3536409542), new $Uint64(2907354897, 783520413)]), $toNativeArray($kindUint64, [new $Uint64(3899770815, 125544631), new $Uint64(3634193621, 2053142340)]), $toNativeArray($kindUint64, [new $Uint64(289873111, 1689078130), new $Uint64(2271371013, 1820084875)]), $toNativeArray($kindUint64, [new $Uint64(3583566861, 1037605839), new $Uint64(2839213766, 3348847917)]), $toNativeArray($kindUint64, [new $Uint64(1258233104, 2370749123), new $Uint64(3549017208, 2038576249)]), $toNativeArray($kindUint64, [new $Uint64(3470750250, 1481718202), new $Uint64(2218135755, 1274110155)]), $toNativeArray($kindUint64, [new $Uint64(3264695988, 3999631400), new $Uint64(2772669694, 518895870)]), $toNativeArray($kindUint64, [new $Uint64(1933386338, 704571954), new $Uint64(3465837117, 2796103486)]), $toNativeArray($kindUint64, [new $Uint64(134624637, 1514099295), new $Uint64(2166148198, 2284435591)]), $toNativeArray($kindUint64, [new $Uint64(3389506268, 2966365943), new $Uint64(2707685248, 708060840)]), $toNativeArray($kindUint64, [new $Uint64(4236882835, 3707957429), new $Uint64(3384606560, 885076050)]), $toNativeArray($kindUint64, [new $Uint64(3148619896, 3561204962), new $Uint64(4230758200, 1106345063)]), $toNativeArray($kindUint64, [new $Uint64(3578500171, 2225753101), new $Uint64(2644223875, 691465664)]), $toNativeArray($kindUint64, [new $Uint64(178157918, 1708449553), new $Uint64(3305279843, 4085557553)]), $toNativeArray($kindUint64, [new $Uint64(1296439221, 4283045589), new $Uint64(4131599804, 4033205117)]), $toNativeArray($kindUint64, [new $Uint64(1347145425, 3213774405), new $Uint64(2582249878, 373269550)]), $toNativeArray($kindUint64, [new $Uint64(3831415430, 795992534), new $Uint64(3227812347, 2614070585)]), $toNativeArray($kindUint64, [new $Uint64(1568043815, 3142474316), new $Uint64(4034765434, 2193846408)]), $toNativeArray($kindUint64, [new $Uint64(980027384, 3574659183), new $Uint64(2521728396, 2444895829)]), $toNativeArray($kindUint64, [new $Uint64(2298776055, 173356683), new $Uint64(3152160495, 3056119786)]), $toNativeArray($kindUint64, [new $Uint64(725986420, 3437921326), new $Uint64(3940200619, 2746407909)]), $toNativeArray($kindUint64, [new $Uint64(990612425, 1217181), new $Uint64(2462625387, 1179634031)]), $toNativeArray($kindUint64, [new $Uint64(164523707, 1075263300), new $Uint64(3078281734, 400800715)]), $toNativeArray($kindUint64, [new $Uint64(3426880106, 270337301), new $Uint64(3847852167, 2648484541)]), $toNativeArray($kindUint64, [new $Uint64(2678670978, 1242702637), new $Uint64(2404907604, 3265915574)]), $toNativeArray($kindUint64, [new $Uint64(1200855074, 3700861945), new $Uint64(3006134505, 4082394468)]), $toNativeArray($kindUint64, [new $Uint64(1501068843, 2478593783), new $Uint64(3757668132, 1881767613)]), $toNativeArray($kindUint64, [new $Uint64(1475038939, 1012250202), new $Uint64(2348542582, 3323588406)]), $toNativeArray($kindUint64, [new $Uint64(3991282322, 191570929), new $Uint64(2935678228, 2007001859)]), $toNativeArray($kindUint64, [new $Uint64(3915361078, 2386947309), new $Uint64(3669597785, 2508752324)]), $toNativeArray($kindUint64, [new $Uint64(299617026, 418100244), new $Uint64(2293498615, 4252324763)]), $toNativeArray($kindUint64, [new $Uint64(3595746754, 2670108953), new $Uint64(2866873269, 4241664129)]), $toNativeArray($kindUint64, [new $Uint64(1273457971, 1190152543), new $Uint64(3583591587, 2080854690)]), $toNativeArray($kindUint64, [new $Uint64(1869653056, 206974427), new $Uint64(2239744742, 763663269)]), $toNativeArray($kindUint64, [new $Uint64(3410808144, 258718034), new $Uint64(2799680927, 3102062734)]), $toNativeArray($kindUint64, [new $Uint64(2116026532, 323397543), new $Uint64(3499601159, 2803836594)]), $toNativeArray($kindUint64, [new $Uint64(2396258406, 2349607112), new $Uint64(2187250724, 3363010607)]), $toNativeArray($kindUint64, [new $Uint64(1921581184, 789525242), new $Uint64(2734063405, 4203763259)]), $toNativeArray($kindUint64, [new $Uint64(1328234656, 986906553), new $Uint64(3417579257, 2033478602)]), $toNativeArray($kindUint64, [new $Uint64(3807776968, 1233633192), new $Uint64(4271974071, 3615590076)]), $toNativeArray($kindUint64, [new $Uint64(232376957, 771020745), new $Uint64(2669983794, 3870356534)]), $toNativeArray($kindUint64, [new $Uint64(2437954844, 2037517755), new $Uint64(3337479743, 2690462019)]), $toNativeArray($kindUint64, [new $Uint64(1973701731, 2546897194), new $Uint64(4171849679, 2289335700)]), $toNativeArray($kindUint64, [new $Uint64(3381047230, 1054939834), new $Uint64(2607406049, 3041447548)]), $toNativeArray($kindUint64, [new $Uint64(4226309037, 3466158440), new $Uint64(3259257562, 580583963)]), $toNativeArray($kindUint64, [new $Uint64(4209144473, 1111472579), new $Uint64(4074071952, 2873213602)]), $toNativeArray($kindUint64, [new $Uint64(3704457119, 3379024922), new $Uint64(2546294970, 1795758501)]), $toNativeArray($kindUint64, [new $Uint64(1409345927, 3150039328), new $Uint64(3182868713, 97214479)]), $toNativeArray($kindUint64, [new $Uint64(687940585, 2863807336), new $Uint64(3978585891, 1195259923)]), $toNativeArray($kindUint64, [new $Uint64(4188059250, 179266849), new $Uint64(2486616182, 210166539)]), $toNativeArray($kindUint64, [new $Uint64(4161332238, 2371567209), new $Uint64(3108270227, 2410191822)]), $toNativeArray($kindUint64, [new $Uint64(3054181650, 816975364), new $Uint64(3885337784, 1938997954)]), $toNativeArray($kindUint64, [new $Uint64(2982605355, 1584351426), new $Uint64(2428336115, 1211873721)]), $toNativeArray($kindUint64, [new $Uint64(507031222, 906697459), new $Uint64(3035420144, 441100328)]), $toNativeArray($kindUint64, [new $Uint64(633789027, 3280855472), new $Uint64(3794275180, 551375410)]), $toNativeArray($kindUint64, [new $Uint64(1469859966, 1513663758), new $Uint64(2371421987, 2492093279)]), $toNativeArray($kindUint64, [new $Uint64(763583133, 4039563345), new $Uint64(2964277484, 2041374775)]), $toNativeArray($kindUint64, [new $Uint64(4175704389, 1828228709), new $Uint64(3705346855, 2551718468)]), $toNativeArray($kindUint64, [new $Uint64(462331595, 1679513855), new $Uint64(2315841784, 3205436779)]), $toNativeArray($kindUint64, [new $Uint64(3799139966, 1025650495), new $Uint64(2894802230, 4006795973)]), $toNativeArray($kindUint64, [new $Uint64(1527699485, 3429546767), new $Uint64(3618502788, 2861011319)]), $toNativeArray($kindUint64, [new $Uint64(2565424914, 2680337641), new $Uint64(2261564242, 3935615722)]), $toNativeArray($kindUint64, [new $Uint64(1059297495, 1202938404), new $Uint64(2826955303, 2772036005)]), $toNativeArray($kindUint64, [new $Uint64(2397863693, 429931181), new $Uint64(3533694129, 2391303182)]), $toNativeArray($kindUint64, [new $Uint64(424922984, 805577900), new $Uint64(2208558830, 4178919049)]), $toNativeArray($kindUint64, [new $Uint64(1604895554, 1006972375), new $Uint64(2760698538, 3076165163)]), $toNativeArray($kindUint64, [new $Uint64(932377618, 3406199117), new $Uint64(3450873173, 1697722806)]), $toNativeArray($kindUint64, [new $Uint64(3803961483, 3202616272), new $Uint64(2156795733, 1597947665)]), $toNativeArray($kindUint64, [new $Uint64(1533726382, 2929528516), new $Uint64(2695994666, 3071176406)]), $toNativeArray($kindUint64, [new $Uint64(4064641626, 1514426997), new $Uint64(3369993333, 1691486859)]), $toNativeArray($kindUint64, [new $Uint64(4007060208, 4040517394), new $Uint64(4212491666, 3188100398)]), $toNativeArray($kindUint64, [new $Uint64(1430670806, 2525323371), new $Uint64(2632807291, 3066304573)]), $toNativeArray($kindUint64, [new $Uint64(2862080332, 1009170566), new $Uint64(3291009114, 2759138892)]), $toNativeArray($kindUint64, [new $Uint64(3577600415, 1261463208), new $Uint64(4113761393, 1301439967)]), $toNativeArray($kindUint64, [new $Uint64(3846612995, 2399027241), new $Uint64(2571100870, 3497754539)]), $toNativeArray($kindUint64, [new $Uint64(3734524420, 1925042227), new $Uint64(3213876088, 2224709526)]), $toNativeArray($kindUint64, [new $Uint64(2520671877, 2406302784), new $Uint64(4017345110, 2780886908)]), $toNativeArray($kindUint64, [new $Uint64(3722903571, 2040810152), new $Uint64(2510840694, 664312493)]), $toNativeArray($kindUint64, [new $Uint64(1432403992, 1477270866), new $Uint64(3138550867, 2977874265)]), $toNativeArray($kindUint64, [new $Uint64(2864246814, 1846588582), new $Uint64(3923188584, 2648601007)]), $toNativeArray($kindUint64, [new $Uint64(3400766995, 80376040), new $Uint64(2451992865, 1655375629)]), $toNativeArray($kindUint64, [new $Uint64(1029733271, 3321695522), new $Uint64(3064991081, 3142961361)]), $toNativeArray($kindUint64, [new $Uint64(2360908413, 3078377578), new $Uint64(3831238852, 707476229)]), $toNativeArray($kindUint64, [new $Uint64(2012438670, 2460856898), new $Uint64(2394524282, 2589656291)]), $toNativeArray($kindUint64, [new $Uint64(1441806514, 928587475), new $Uint64(2993155353, 1089586716)]), $toNativeArray($kindUint64, [new $Uint64(1802258142, 3308217992), new $Uint64(3741444191, 2435725219)]), $toNativeArray($kindUint64, [new $Uint64(589540427, 993894421), new $Uint64(2338402619, 3132940998)]), $toNativeArray($kindUint64, [new $Uint64(2884409182, 168626202), new $Uint64(2923003274, 2842434423)]), $toNativeArray($kindUint64, [new $Uint64(2531769653, 2358266401), new $Uint64(3653754093, 1405559381)]), $toNativeArray($kindUint64, [new $Uint64(2119226945, 2010787412), new $Uint64(2283596308, 1415345525)]), $toNativeArray($kindUint64, [new $Uint64(3722775505, 3587226089), new $Uint64(2854495385, 1769181906)]), $toNativeArray($kindUint64, [new $Uint64(2505985734, 1262807140), new $Uint64(3568119231, 3285219207)]), $toNativeArray($kindUint64, [new $Uint64(3176853819, 4010479934), new $Uint64(2230074519, 3663874740)]), $toNativeArray($kindUint64, [new $Uint64(3971067274, 3939358094), new $Uint64(2787593149, 3506101601)]), $toNativeArray($kindUint64, [new $Uint64(1742608621, 2776713970), new $Uint64(3484491437, 1161401530)]), $toNativeArray($kindUint64, [new $Uint64(2162872212, 2272317143), new $Uint64(2177807148, 1262746868)]), $toNativeArray($kindUint64, [new $Uint64(2703590265, 2840396429), new $Uint64(2722258935, 1578433585)]), $toNativeArray($kindUint64, [new $Uint64(158262360, 329270064), new $Uint64(3402823669, 899300158)]), $toNativeArray($kindUint64, [new $Uint64(2345311598, 411587580), new $Uint64(4253529586, 2197867021)]), $toNativeArray($kindUint64, [new $Uint64(2002690660, 3478467709), new $Uint64(2658455991, 2447408712)]), $toNativeArray($kindUint64, [new $Uint64(2503363326, 53117341), new $Uint64(3323069989, 1985519066)]), $toNativeArray($kindUint64, [new $Uint64(981720509, 2213880324), new $Uint64(4153837486, 3555640657)]), $toNativeArray($kindUint64, [new $Uint64(3297929878, 1920546114), new $Uint64(2596148429, 1148533586)]), $toNativeArray($kindUint64, [new $Uint64(1974928700, 253198995), new $Uint64(3245185536, 2509408807)]), $toNativeArray($kindUint64, [new $Uint64(1394919051, 316498744), new $Uint64(4056481920, 3136761009)]), $toNativeArray($kindUint64, [new $Uint64(3556178966, 3955908099), new $Uint64(2535301200, 1960475630)]), $toNativeArray($kindUint64, [new $Uint64(2297740060, 2797401476), new $Uint64(3169126500, 2450594538)]), $toNativeArray($kindUint64, [new $Uint64(724691427, 3496751845), new $Uint64(3961408125, 3063243173)]), $toNativeArray($kindUint64, [new $Uint64(989803054, 1648598991), new $Uint64(2475880078, 2451397895)]), $toNativeArray($kindUint64, [new $Uint64(163511993, 4208232386), new $Uint64(3094850098, 916763721)]), $toNativeArray($kindUint64, [new $Uint64(1278131816, 2039065011), new $Uint64(3868562622, 3293438299)]), $toNativeArray($kindUint64, [new $Uint64(261961473, 1274415632), new $Uint64(2417851639, 984657113)]), $toNativeArray($kindUint64, [new $Uint64(1401193665, 2666761364), new $Uint64(3022314549, 157079567)]), $toNativeArray($kindUint64, [new $Uint64(677750258, 112226233), new $Uint64(3777893186, 1270091283)]), $toNativeArray($kindUint64, [new $Uint64(4181690295, 1143883219), new $Uint64(2361183241, 1867548875)]), $toNativeArray($kindUint64, [new $Uint64(4153371045, 356112200), new $Uint64(2951479051, 3408177918)]), $toNativeArray($kindUint64, [new $Uint64(3044230158, 1518882075), new $Uint64(3689348814, 3186480574)]), $toNativeArray($kindUint64, [new $Uint64(828902024, 4170526768), new $Uint64(2305843009, 917808535)]), $toNativeArray($kindUint64, [new $Uint64(4257353003, 918191165), new $Uint64(2882303761, 2221002492)]), $toNativeArray($kindUint64, [new $Uint64(1026723958, 73997132), new $Uint64(3602879701, 3849994940)]), $toNativeArray($kindUint64, [new $Uint64(2789186121, 3267473679), new $Uint64(2251799813, 2943117749)]), $toNativeArray($kindUint64, [new $Uint64(265257180, 863116627), new $Uint64(2814749767, 457671715)]), $toNativeArray($kindUint64, [new $Uint64(3552796947, 1078895784), new $Uint64(3518437208, 3793315115)]), $toNativeArray($kindUint64, [new $Uint64(1683627180, 137438953), new $Uint64(2199023255, 2370821947)]), $toNativeArray($kindUint64, [new $Uint64(1030792151, 171798691), new $Uint64(2748779069, 1889785610)]), $toNativeArray($kindUint64, [new $Uint64(3435973836, 3435973836), new $Uint64(3435973836, 3435973836)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2147483648, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2684354560, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3355443200, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(4194304000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2621440000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3276800000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(4096000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2560000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3200000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(4000000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2500000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3125000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3906250000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2441406250, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3051757812, 2147483648)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3814697265, 2684354560)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2384185791, 67108864)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2980232238, 3305111552)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3725290298, 1983905792)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2328306436, 2313682944)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2910383045, 2892103680)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3637978807, 393904128)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2273736754, 1856802816)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2842170943, 173519872)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3552713678, 3438125312)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2220446049, 1075086496)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2775557561, 2417599944)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3469446951, 4095741754)]), $toNativeArray($kindUint64, [new $Uint64(1073741824, 0), new $Uint64(2168404344, 4170451332)]), $toNativeArray($kindUint64, [new $Uint64(1342177280, 0), new $Uint64(2710505431, 918096869)]), $toNativeArray($kindUint64, [new $Uint64(2751463424, 0), new $Uint64(3388131789, 73879262)]), $toNativeArray($kindUint64, [new $Uint64(1291845632, 0), new $Uint64(4235164736, 1166090902)]), $toNativeArray($kindUint64, [new $Uint64(4028628992, 0), new $Uint64(2646977960, 728806813)]), $toNativeArray($kindUint64, [new $Uint64(1814560768, 0), new $Uint64(3308722450, 911008517)]), $toNativeArray($kindUint64, [new $Uint64(3341942784, 0), new $Uint64(4135903062, 3286244294)]), $toNativeArray($kindUint64, [new $Uint64(1014972416, 0), new $Uint64(2584939414, 980160860)]), $toNativeArray($kindUint64, [new $Uint64(1268715520, 0), new $Uint64(3231174267, 3372684723)]), $toNativeArray($kindUint64, [new $Uint64(512152576, 0), new $Uint64(4038967834, 3142114080)]), $toNativeArray($kindUint64, [new $Uint64(320095360, 0), new $Uint64(2524354896, 3037563124)]), $toNativeArray($kindUint64, [new $Uint64(400119200, 0), new $Uint64(3155443620, 3796953905)]), $toNativeArray($kindUint64, [new $Uint64(1573890824, 0), new $Uint64(3944304526, 451225085)]), $toNativeArray($kindUint64, [new $Uint64(1520552677, 0), new $Uint64(2465190328, 3503241150)]), $toNativeArray($kindUint64, [new $Uint64(4048174494, 1073741824), new $Uint64(3081487911, 84084141)]), $toNativeArray($kindUint64, [new $Uint64(1838992645, 3489660928), new $Uint64(3851859888, 3326330649)]), $toNativeArray($kindUint64, [new $Uint64(3833724963, 2717908992), new $Uint64(2407412430, 2078956655)]), $toNativeArray($kindUint64, [new $Uint64(3718414380, 2323644416), new $Uint64(3009265538, 451212171)]), $toNativeArray($kindUint64, [new $Uint64(3574276151, 2904555520), new $Uint64(3761581922, 2711498862)]), $toNativeArray($kindUint64, [new $Uint64(1160180770, 3425959936), new $Uint64(2350988701, 2768428613)]), $toNativeArray($kindUint64, [new $Uint64(2523967787, 2134966272), new $Uint64(2938735877, 239310294)]), $toNativeArray($kindUint64, [new $Uint64(1007476086, 1594966016), new $Uint64(3673419846, 1372879692)]), $toNativeArray($kindUint64, [new $Uint64(2777156201, 4218079232), new $Uint64(2295887403, 4079275279)]), $toNativeArray($kindUint64, [new $Uint64(2397703428, 2051373568), new $Uint64(2869859254, 4025352275)]), $toNativeArray($kindUint64, [new $Uint64(1923387461, 2564216960), new $Uint64(3587324068, 2884206696)]), $toNativeArray($kindUint64, [new $Uint64(1202117163, 2139506512), new $Uint64(2242077542, 3950112833)]), $toNativeArray($kindUint64, [new $Uint64(2576388278, 1600641316), new $Uint64(2802596928, 2790157393)]), $toNativeArray($kindUint64, [new $Uint64(4294227171, 4148285293), new $Uint64(3503246160, 3487696741)]), $toNativeArray($kindUint64, [new $Uint64(3220762894, 2055807396), new $Uint64(2189528850, 2179810463)]), $toNativeArray($kindUint64, [new $Uint64(2952211794, 422275597), new $Uint64(2736911063, 577279431)]), $toNativeArray($kindUint64, [new $Uint64(2616522918, 2675328144), new $Uint64(3421138828, 3942824761)]), $toNativeArray($kindUint64, [new $Uint64(49428176, 1196676532), new $Uint64(4276423536, 633563656)]), $toNativeArray($kindUint64, [new $Uint64(30892610, 747922832), new $Uint64(2672764710, 395977285)]), $toNativeArray($kindUint64, [new $Uint64(1112357586, 3082387189), new $Uint64(3340955887, 2642455254)]), $toNativeArray($kindUint64, [new $Uint64(3537930631, 1705500338), new $Uint64(4176194859, 2229327243)]), $toNativeArray($kindUint64, [new $Uint64(1674335732, 2676550447), new $Uint64(2610121787, 856458615)]), $toNativeArray($kindUint64, [new $Uint64(1019177841, 3345688059), new $Uint64(3262652233, 4291798741)]), $toNativeArray($kindUint64, [new $Uint64(2347714126, 960884602), new $Uint64(4078315292, 2143522954)]), $toNativeArray($kindUint64, [new $Uint64(2541063152, 3821778348), new $Uint64(2548947057, 3487185494)]), $toNativeArray($kindUint64, [new $Uint64(1028845293, 482255639), new $Uint64(3186183822, 1137756396)]), $toNativeArray($kindUint64, [new $Uint64(1286056616, 1676561373), new $Uint64(3982729777, 3569679143)]), $toNativeArray($kindUint64, [new $Uint64(2414398121, 1047850858), new $Uint64(2489206111, 620436728)]), $toNativeArray($kindUint64, [new $Uint64(3017997651, 2383555396), new $Uint64(3111507638, 3996771382)]), $toNativeArray($kindUint64, [new $Uint64(1625013416, 1905702422), new $Uint64(3889384548, 2848480580)]), $toNativeArray($kindUint64, [new $Uint64(3163117033, 1191064013), new $Uint64(2430865342, 3927784010)]), $toNativeArray($kindUint64, [new $Uint64(1806412643, 2562571841), new $Uint64(3038581678, 2762246365)]), $toNativeArray($kindUint64, [new $Uint64(3331757628, 2129472977), new $Uint64(3798227098, 1305324308)]), $toNativeArray($kindUint64, [new $Uint64(4229832165, 3478404258), new $Uint64(2373891936, 1889569516)]), $toNativeArray($kindUint64, [new $Uint64(992322911, 1126779851), new $Uint64(2967364920, 2361961896)]), $toNativeArray($kindUint64, [new $Uint64(1240403639, 334732990), new $Uint64(3709206150, 2952452370)]), $toNativeArray($kindUint64, [new $Uint64(1848994098, 1819820855), new $Uint64(2318253844, 771540907)]), $toNativeArray($kindUint64, [new $Uint64(1237500799, 127292420), new $Uint64(2897817305, 964426134)]), $toNativeArray($kindUint64, [new $Uint64(3694359646, 3380340998), new $Uint64(3622271631, 2279274491)]), $toNativeArray($kindUint64, [new $Uint64(1772103867, 1038971299), new $Uint64(2263919769, 3035159293)]), $toNativeArray($kindUint64, [new $Uint64(3288871658, 224972300), new $Uint64(2829899712, 572723644)]), $toNativeArray($kindUint64, [new $Uint64(4111089572, 2428699024), new $Uint64(3537374640, 715904555)]), $toNativeArray($kindUint64, [new $Uint64(2032560070, 3665420538), new $Uint64(2210859150, 447440347)]), $toNativeArray($kindUint64, [new $Uint64(1466958264, 2434292024), new $Uint64(2763573937, 2706784082)]), $toNativeArray($kindUint64, [new $Uint64(3981181478, 3042865030), new $Uint64(3454467422, 162254630)]), $toNativeArray($kindUint64, [new $Uint64(1414496600, 828048820), new $Uint64(2159042138, 3322634616)]), $toNativeArray($kindUint64, [new $Uint64(1768120750, 1035061025), new $Uint64(2698802673, 2005809622)]), $toNativeArray($kindUint64, [new $Uint64(62667289, 3441309929), new $Uint64(3373503341, 3581003852)]), $toNativeArray($kindUint64, [new $Uint64(78334112, 1080411939), new $Uint64(4216879177, 1255029343)]), $toNativeArray($kindUint64, [new $Uint64(1659571556, 675257462), new $Uint64(2635549485, 3468747899)]), $toNativeArray($kindUint64, [new $Uint64(1000722621, 844071828), new $Uint64(3294436857, 1114709402)]), $toNativeArray($kindUint64, [new $Uint64(3398386924, 2128831609), new $Uint64(4118046071, 2467128576)]), $toNativeArray($kindUint64, [new $Uint64(2123991827, 3478003403), new $Uint64(2573778794, 3152568096)]), $toNativeArray($kindUint64, [new $Uint64(2654989784, 3273762430), new $Uint64(3217223493, 1793226472)]), $toNativeArray($kindUint64, [new $Uint64(3318737230, 4092203038), new $Uint64(4021529366, 3315274914)]), $toNativeArray($kindUint64, [new $Uint64(3147952593, 1483885074), new $Uint64(2513455854, 998304997)]), $toNativeArray($kindUint64, [new $Uint64(713715269, 2928598167), new $Uint64(3141819817, 3395364895)]), $toNativeArray($kindUint64, [new $Uint64(4113369559, 439522237), new $Uint64(3927274772, 1022980646)]), $toNativeArray($kindUint64, [new $Uint64(1497114150, 1885314134), new $Uint64(2454546732, 2786846552)]), $toNativeArray($kindUint64, [new $Uint64(1871392688, 209159020), new $Uint64(3068183415, 3483558190)]), $toNativeArray($kindUint64, [new $Uint64(191757212, 261448775), new $Uint64(3835229269, 3280705914)]), $toNativeArray($kindUint64, [new $Uint64(1193590081, 2310889132), new $Uint64(2397018293, 2587312108)]), $toNativeArray($kindUint64, [new $Uint64(1491987601, 3962353239), new $Uint64(2996272867, 12914663)]), $toNativeArray($kindUint64, [new $Uint64(791242678, 1731716077), new $Uint64(3745341083, 3237368801)]), $toNativeArray($kindUint64, [new $Uint64(3178881234, 8580724), new $Uint64(2340838177, 1486484588)]), $toNativeArray($kindUint64, [new $Uint64(3973601542, 2158209553), new $Uint64(2926047721, 2931847559)]), $toNativeArray($kindUint64, [new $Uint64(3893260104, 550278293), new $Uint64(3657559652, 443583977)]), $toNativeArray($kindUint64, [new $Uint64(822674829, 343923933), new $Uint64(2285974782, 2424723634)]), $toNativeArray($kindUint64, [new $Uint64(3175827184, 1503646741), new $Uint64(2857468478, 883420894)]), $toNativeArray($kindUint64, [new $Uint64(1822300332, 1879558426), new $Uint64(3571835597, 3251759766)]), $toNativeArray($kindUint64, [new $Uint64(65195883, 3322207664), new $Uint64(2232397248, 2569220766)]), $toNativeArray($kindUint64, [new $Uint64(2228978502, 3079017756), new $Uint64(2790496560, 3211525957)]), $toNativeArray($kindUint64, [new $Uint64(3859964952, 1701288547), new $Uint64(3488120700, 4014407446)]), $toNativeArray($kindUint64, [new $Uint64(1338736271, 1063305342), new $Uint64(2180075438, 361521006)]), $toNativeArray($kindUint64, [new $Uint64(3820903987, 255389853), new $Uint64(2725094297, 2599384905)]), $toNativeArray($kindUint64, [new $Uint64(1554904511, 3540462789), new $Uint64(3406367872, 28005660)]), $toNativeArray($kindUint64, [new $Uint64(1943630639, 3351836662), new $Uint64(4257959840, 35007075)]), $toNativeArray($kindUint64, [new $Uint64(677898237, 3705510650), new $Uint64(2661224900, 21879422)]), $toNativeArray($kindUint64, [new $Uint64(2994856445, 1410662840), new $Uint64(3326531125, 27349277)]), $toNativeArray($kindUint64, [new $Uint64(522345084, 2837070374), new $Uint64(4158163906, 1107928421)]), $toNativeArray($kindUint64, [new $Uint64(863336589, 3920652632), new $Uint64(2598852441, 1766197087)]), $toNativeArray($kindUint64, [new $Uint64(5428913, 1679590318), new $Uint64(3248565551, 3281488183)]), $toNativeArray($kindUint64, [new $Uint64(3228011613, 3173229722), new $Uint64(4060706939, 3028118404)]), $toNativeArray($kindUint64, [new $Uint64(4164990906, 2520139488), new $Uint64(2537941837, 1355703090)]), $toNativeArray($kindUint64, [new $Uint64(3058754985, 1002690712), new $Uint64(3172427296, 2768370687)]), $toNativeArray($kindUint64, [new $Uint64(2749701907, 2327105214), new $Uint64(3965534120, 3460463359)]), $toNativeArray($kindUint64, [new $Uint64(3329176428, 917569847), new $Uint64(2478458825, 2162789599)]), $toNativeArray($kindUint64, [new $Uint64(3087728711, 1146962308), new $Uint64(3098073531, 3777228823)]), $toNativeArray($kindUint64, [new $Uint64(2785919065, 359961061), new $Uint64(3872591914, 3647794205)]), $toNativeArray($kindUint64, [new $Uint64(2278070327, 2909330223), new $Uint64(2420369946, 3353613202)]), $toNativeArray($kindUint64, [new $Uint64(700104261, 2562920955), new $Uint64(3025462433, 2044532855)]), $toNativeArray($kindUint64, [new $Uint64(4096355798, 4277393018), new $Uint64(3781828041, 3629407892)]), $toNativeArray($kindUint64, [new $Uint64(412738726, 1599628812), new $Uint64(2363642526, 657767197)]), $toNativeArray($kindUint64, [new $Uint64(1589665231, 4147019663), new $Uint64(2954553157, 2969692644)]), $toNativeArray($kindUint64, [new $Uint64(1987081539, 4110032755), new $Uint64(3693191447, 490890333)]), $toNativeArray($kindUint64, [new $Uint64(1778796874, 2031899560), new $Uint64(2308244654, 1917419194)]), $toNativeArray($kindUint64, [new $Uint64(76012445, 392390802), new $Uint64(2885305818, 249290345)]), $toNativeArray($kindUint64, [new $Uint64(1168757380, 1564230326), new $Uint64(3606632272, 2459096579)]), $toNativeArray($kindUint64, [new $Uint64(193602450, 3125127602), new $Uint64(2254145170, 1536935362)]), $toNativeArray($kindUint64, [new $Uint64(2389486711, 1758925854), new $Uint64(2817681462, 4068652850)]), $toNativeArray($kindUint64, [new $Uint64(839374741, 1124915494), new $Uint64(3522101828, 2938332415)]), $toNativeArray($kindUint64, [new $Uint64(2135221949, 1239943096), new $Uint64(2201313642, 3983941407)]), $toNativeArray($kindUint64, [new $Uint64(1595285612, 2623670694), new $Uint64(2751642053, 2832443111)]), $toNativeArray($kindUint64, [new $Uint64(920365191, 3279588367), new $Uint64(3439552567, 319328417)]), $toNativeArray($kindUint64, [new $Uint64(3259582804, 3660355465), new $Uint64(2149720354, 1810192996)]), $toNativeArray($kindUint64, [new $Uint64(4074478506, 280477036), new $Uint64(2687150443, 115257597)]), $toNativeArray($kindUint64, [new $Uint64(1871872660, 2498079943), new $Uint64(3358938053, 3365297469)]), $toNativeArray($kindUint64, [new $Uint64(3413582649, 3122599929), new $Uint64(4198672567, 985396364)]), $toNativeArray($kindUint64, [new $Uint64(4280972804, 341012219), new $Uint64(2624170354, 2226485463)]), $toNativeArray($kindUint64, [new $Uint64(4277474181, 426265274), new $Uint64(3280212943, 635623181)]), $toNativeArray($kindUint64, [new $Uint64(2125617254, 1606573417), new $Uint64(4100266178, 4015754449)]), $toNativeArray($kindUint64, [new $Uint64(4012865343, 4225333857), new $Uint64(2562666361, 3583588354)]), $toNativeArray($kindUint64, [new $Uint64(2868598031, 4207925498), new $Uint64(3203332952, 1258259971)]), $toNativeArray($kindUint64, [new $Uint64(2512005715, 4186165048), new $Uint64(4004166190, 1572824964)]), $toNativeArray($kindUint64, [new $Uint64(3717487220, 2079482243), new $Uint64(2502603868, 4204241074)]), $toNativeArray($kindUint64, [new $Uint64(2499375377, 2599352804), new $Uint64(3128254836, 960334047)]), $toNativeArray($kindUint64, [new $Uint64(2050477398, 27965533), new $Uint64(3910318545, 1200417559)]), $toNativeArray($kindUint64, [new $Uint64(2892161109, 3238703930), new $Uint64(2443949090, 3434615534)]), $toNativeArray($kindUint64, [new $Uint64(1467717739, 827154441), new $Uint64(3054936363, 2145785770)]), $toNativeArray($kindUint64, [new $Uint64(3982130821, 4255168523), new $Uint64(3818670454, 1608490388)]), $toNativeArray($kindUint64, [new $Uint64(341348115, 3196351239), new $Uint64(2386669033, 4226531965)]), $toNativeArray($kindUint64, [new $Uint64(1500426968, 2921697224), new $Uint64(2983336292, 2061939484)]), $toNativeArray($kindUint64, [new $Uint64(1875533710, 3652121531), new $Uint64(3729170365, 2577424355)]), $toNativeArray($kindUint64, [new $Uint64(635337657, 1208834132), new $Uint64(2330731478, 2147761134)]), $toNativeArray($kindUint64, [new $Uint64(2941655719, 2584784490), new $Uint64(2913414348, 537217769)]), $toNativeArray($kindUint64, [new $Uint64(455844177, 2157238788), new $Uint64(3641767935, 671522212)]), $toNativeArray($kindUint64, [new $Uint64(2432386258, 4032628802), new $Uint64(2276104959, 2030314118)]), $toNativeArray($kindUint64, [new $Uint64(892999175, 2893302355), new $Uint64(2845131199, 1464150824)]), $toNativeArray($kindUint64, [new $Uint64(1116248969, 2542886120), new $Uint64(3556413999, 756446706)]), $toNativeArray($kindUint64, [new $Uint64(1771397429, 4273658385), new $Uint64(2222758749, 2083391927)]), $toNativeArray($kindUint64, [new $Uint64(1140504963, 2120847509), new $Uint64(2778448436, 3677981733)]), $toNativeArray($kindUint64, [new $Uint64(2499373028, 1577317563), new $Uint64(3473060546, 302509870)]), $toNativeArray($kindUint64, [new $Uint64(488366318, 3133307125), new $Uint64(2170662841, 1262810493)]), $toNativeArray($kindUint64, [new $Uint64(1684199722, 1769150258), new $Uint64(2713328551, 2652254940)]), $toNativeArray($kindUint64, [new $Uint64(2105249653, 63954174), new $Uint64(3391660689, 2241576851)]), $toNativeArray($kindUint64, [new $Uint64(1557820242, 1153684542), new $Uint64(4239575861, 3875712888)]), $toNativeArray($kindUint64, [new $Uint64(973637651, 1794794663), new $Uint64(2649734913, 2959191467)]), $toNativeArray($kindUint64, [new $Uint64(143305240, 1169751504), new $Uint64(3312168642, 477763862)]), $toNativeArray($kindUint64, [new $Uint64(2326615198, 1462189381), new $Uint64(4140210802, 2744688475)]), $toNativeArray($kindUint64, [new $Uint64(917263586, 4135093835), new $Uint64(2587631751, 2789172121)]), $toNativeArray($kindUint64, [new $Uint64(2220321307, 3021383645), new $Uint64(3234539689, 2412723327)]), $toNativeArray($kindUint64, [new $Uint64(1701659810, 2702987733), new $Uint64(4043174611, 4089645983)]), $toNativeArray($kindUint64, [new $Uint64(2674150117, 2763109157), new $Uint64(2526984132, 2019157827)]), $toNativeArray($kindUint64, [new $Uint64(2268945823, 232660974), new $Uint64(3158730165, 2523947284)]), $toNativeArray($kindUint64, [new $Uint64(2836182278, 3512051690), new $Uint64(3948412706, 4228675929)]), $toNativeArray($kindUint64, [new $Uint64(162001188, 1121290482), new $Uint64(2467757941, 3716664280)]), $toNativeArray($kindUint64, [new $Uint64(202501485, 1401613103), new $Uint64(3084697427, 1424604878)]), $toNativeArray($kindUint64, [new $Uint64(2400610504, 2825758202), new $Uint64(3855871784, 707014273)]), $toNativeArray($kindUint64, [new $Uint64(4184736125, 1766098876), new $Uint64(2409919865, 441883920)]), $toNativeArray($kindUint64, [new $Uint64(935952860, 3281365420), new $Uint64(3012399831, 1626096725)]), $toNativeArray($kindUint64, [new $Uint64(2243682899, 4101706775), new $Uint64(3765499789, 958879082)]), $toNativeArray($kindUint64, [new $Uint64(2476043636, 2026695822), new $Uint64(2353437368, 1136170338)]), $toNativeArray($kindUint64, [new $Uint64(947570897, 2533369778), new $Uint64(2941796710, 1420212923)]), $toNativeArray($kindUint64, [new $Uint64(110721797, 4240454046), new $Uint64(3677245887, 3922749802)]), $toNativeArray($kindUint64, [new $Uint64(1142942947, 3187154691), new $Uint64(2298278679, 4062331362)]), $toNativeArray($kindUint64, [new $Uint64(3576162332, 2910201539), new $Uint64(2872848349, 4004172378)]), $toNativeArray($kindUint64, [new $Uint64(2322719267, 3637751924), new $Uint64(3591060437, 1783990001)]), $toNativeArray($kindUint64, [new $Uint64(4136054102, 1736724041), new $Uint64(2244412773, 1651864662)]), $toNativeArray($kindUint64, [new $Uint64(3022583980, 23421403), new $Uint64(2805515966, 3138572652)]), $toNativeArray($kindUint64, [new $Uint64(3778229975, 29276754), new $Uint64(3506894958, 1775732167)]), $toNativeArray($kindUint64, [new $Uint64(3972006470, 1628910707), new $Uint64(2191809349, 36090780)]), $toNativeArray($kindUint64, [new $Uint64(670040791, 4183622032), new $Uint64(2739761686, 1118855300)]), $toNativeArray($kindUint64, [new $Uint64(837550989, 4155785716), new $Uint64(3424702107, 3546052773)]), $toNativeArray($kindUint64, [new $Uint64(2120680561, 1973506673), new $Uint64(4280877634, 3358824142)]), $toNativeArray($kindUint64, [new $Uint64(251683526, 3917796230), new $Uint64(2675548521, 3173006913)]), $toNativeArray($kindUint64, [new $Uint64(1388346232, 2749761640), new $Uint64(3344435652, 745033169)]), $toNativeArray($kindUint64, [new $Uint64(2809174614, 3437202050), new $Uint64(4180544565, 931291461)]), $toNativeArray($kindUint64, [new $Uint64(2292605046, 1074509457), new $Uint64(2612840353, 1118928075)]), $toNativeArray($kindUint64, [new $Uint64(1792014483, 3490620469), new $Uint64(3266050441, 2472401918)]), $toNativeArray($kindUint64, [new $Uint64(92534456, 3289533763), new $Uint64(4082563051, 4164244222)]), $toNativeArray($kindUint64, [new $Uint64(3279059507, 2055958602), new $Uint64(2551601907, 2065781726)]), $toNativeArray($kindUint64, [new $Uint64(1951340736, 1496206428), new $Uint64(3189502384, 1508485334)]), $toNativeArray($kindUint64, [new $Uint64(291692272, 1870258035), new $Uint64(3986877980, 1885606668)]), $toNativeArray($kindUint64, [new $Uint64(2329791318, 1168911272), new $Uint64(2491798737, 3325987815)]), $toNativeArray($kindUint64, [new $Uint64(1838497323, 3608622738), new $Uint64(3114748422, 936259297)]), $toNativeArray($kindUint64, [new $Uint64(3371863478, 3437036599), new $Uint64(3893435527, 3317807769)]), $toNativeArray($kindUint64, [new $Uint64(496801938, 1074406050), new $Uint64(2433397204, 3684242592)]), $toNativeArray($kindUint64, [new $Uint64(621002422, 3490491211), new $Uint64(3041746506, 310335944)]), $toNativeArray($kindUint64, [new $Uint64(776253028, 2215630365), new $Uint64(3802183132, 2535403578)]), $toNativeArray($kindUint64, [new $Uint64(1558899966, 3532252626), new $Uint64(2376364457, 3732110884)]), $toNativeArray($kindUint64, [new $Uint64(1948624958, 2267832135), new $Uint64(2970455572, 1443913133)]), $toNativeArray($kindUint64, [new $Uint64(3509523022, 687306521), new $Uint64(3713069465, 1804891416)]), $toNativeArray($kindUint64, [new $Uint64(2193451888, 3650792047), new $Uint64(2320668415, 3812411695)]), $toNativeArray($kindUint64, [new $Uint64(1668073037, 268522763), new $Uint64(2900835519, 3691772795)]), $toNativeArray($kindUint64, [new $Uint64(1011349472, 1409395278), new $Uint64(3626044399, 3540974170)]), $toNativeArray($kindUint64, [new $Uint64(1705835244, 880872049), new $Uint64(2266277749, 3823721592)]), $toNativeArray($kindUint64, [new $Uint64(2132294055, 1101090061), new $Uint64(2832847187, 1558426518)]), $toNativeArray($kindUint64, [new $Uint64(517883921, 302620752), new $Uint64(3541058984, 874291324)]), $toNativeArray($kindUint64, [new $Uint64(2471161098, 2873492530), new $Uint64(2213161865, 546432077)]), $toNativeArray($kindUint64, [new $Uint64(4162693197, 1444382015), new $Uint64(2766452331, 1756781920)]), $toNativeArray($kindUint64, [new $Uint64(908399200, 2879219342), new $Uint64(3458065414, 1122235577)]), $toNativeArray($kindUint64, [new $Uint64(3252104060, 1799512089), new $Uint64(2161290883, 3922622707)]), $toNativeArray($kindUint64, [new $Uint64(2991388251, 2249390111), new $Uint64(2701613604, 3829536560)]), $toNativeArray($kindUint64, [new $Uint64(3739235314, 1737995815), new $Uint64(3377017006, 491953404)]), $toNativeArray($kindUint64, [new $Uint64(379076847, 25011121), new $Uint64(4221271257, 2762425404)]), $toNativeArray($kindUint64, [new $Uint64(2384406677, 1626244686), new $Uint64(2638294536, 115903141)]), $toNativeArray($kindUint64, [new $Uint64(4054250170, 3106547682), new $Uint64(3297868170, 144878926)]), $toNativeArray($kindUint64, [new $Uint64(2920329065, 1735700955), new $Uint64(4122335212, 2328582306)]), $toNativeArray($kindUint64, [new $Uint64(2898947489, 3769167657), new $Uint64(2576459507, 3602847589)]), $toNativeArray($kindUint64, [new $Uint64(402458890, 1490234099), new $Uint64(3220574384, 3429817663)]), $toNativeArray($kindUint64, [new $Uint64(3724299084, 4010276272), new $Uint64(4025717980, 4287272078)]), $toNativeArray($kindUint64, [new $Uint64(1253945104, 358939022), new $Uint64(2516073738, 532061401)]), $toNativeArray($kindUint64, [new $Uint64(2641173204, 448673777), new $Uint64(3145092172, 2812560399)]), $toNativeArray($kindUint64, [new $Uint64(2227724681, 560842221), new $Uint64(3931365215, 3515700499)]), $toNativeArray($kindUint64, [new $Uint64(855457013, 3034880948), new $Uint64(2457103259, 3807925548)]), $toNativeArray($kindUint64, [new $Uint64(1069321267, 572375713), new $Uint64(3071379074, 3686165111)]), $toNativeArray($kindUint64, [new $Uint64(262909759, 3936695114), new $Uint64(3839223843, 2460222741)]), $toNativeArray($kindUint64, [new $Uint64(701189511, 4071047182), new $Uint64(2399514902, 1000768301)]), $toNativeArray($kindUint64, [new $Uint64(1950228713, 4015067154), new $Uint64(2999393627, 3398444024)]), $toNativeArray($kindUint64, [new $Uint64(2437785892, 1797608470), new $Uint64(3749242034, 3174313206)]), $toNativeArray($kindUint64, [new $Uint64(449874358, 3270988942), new $Uint64(2343276271, 3057687578)]), $toNativeArray($kindUint64, [new $Uint64(2709826596, 1941252529), new $Uint64(2929095339, 2748367648)]), $toNativeArray($kindUint64, [new $Uint64(3387283245, 2426565662), new $Uint64(3661369174, 2361717736)]), $toNativeArray($kindUint64, [new $Uint64(2117052028, 2053474450), new $Uint64(2288355734, 402331761)]), $toNativeArray($kindUint64, [new $Uint64(3720056859, 2566843063), new $Uint64(2860444667, 2650398349)]), $toNativeArray($kindUint64, [new $Uint64(1428845602, 2134812005), new $Uint64(3575555834, 2239256113)]), $toNativeArray($kindUint64, [new $Uint64(3577383061, 2407999327), new $Uint64(2234722396, 2473276894)]), $toNativeArray($kindUint64, [new $Uint64(2324245178, 4083740983), new $Uint64(2793402995, 3091596118)]), $toNativeArray($kindUint64, [new $Uint64(757822825, 2957192581), new $Uint64(3491753744, 2790753324)]), $toNativeArray($kindUint64, [new $Uint64(2621122914, 237632627), new $Uint64(2182346090, 1744220827)]), $toNativeArray($kindUint64, [new $Uint64(2202661818, 2444524431), new $Uint64(2727932613, 32792386)]), $toNativeArray($kindUint64, [new $Uint64(605843625, 908171891), new $Uint64(3409915766, 1114732307)]), $toNativeArray($kindUint64, [new $Uint64(3978530003, 2208956688), new $Uint64(4262394707, 3540899031)]), $toNativeArray($kindUint64, [new $Uint64(4097193988, 843727018), new $Uint64(2663996692, 1676190982)]), $toNativeArray($kindUint64, [new $Uint64(2974008837, 1054658773), new $Uint64(3329995865, 2095238728)]), $toNativeArray($kindUint64, [new $Uint64(3717511046, 2392065290), new $Uint64(4162494831, 3692790234)]), $toNativeArray($kindUint64, [new $Uint64(3397186228, 421298982), new $Uint64(2601559269, 3918606632)]), $toNativeArray($kindUint64, [new $Uint64(4246482785, 526623728), new $Uint64(3251949087, 1677032818)]), $toNativeArray($kindUint64, [new $Uint64(3160619833, 1732021484), new $Uint64(4064936359, 1022549199)]), $toNativeArray($kindUint64, [new $Uint64(3586000131, 3766867987), new $Uint64(2540585224, 2249705985)]), $toNativeArray($kindUint64, [new $Uint64(1261274692, 3634843160), new $Uint64(3175731530, 2812132482)]), $toNativeArray($kindUint64, [new $Uint64(3724077014, 248586654), new $Uint64(3969664413, 1367681954)]), $toNativeArray($kindUint64, [new $Uint64(3401289957, 3376592131), new $Uint64(2481040258, 1391672133)]), $toNativeArray($kindUint64, [new $Uint64(1030386975, 999514691), new $Uint64(3101300322, 3887073815)]), $toNativeArray($kindUint64, [new $Uint64(214241895, 175651540), new $Uint64(3876625403, 2711358621)]), $toNativeArray($kindUint64, [new $Uint64(670772096, 1720394949), new $Uint64(2422890877, 1157728226)]), $toNativeArray($kindUint64, [new $Uint64(2985948768, 2150493686), new $Uint64(3028613596, 2520902106)]), $toNativeArray($kindUint64, [new $Uint64(1584952312, 2688117107), new $Uint64(3785766995, 3151127633)]), $toNativeArray($kindUint64, [new $Uint64(3674949755, 1680073192), new $Uint64(2366104372, 1432583858)]), $toNativeArray($kindUint64, [new $Uint64(2446203546, 1026349666), new $Uint64(2957630465, 1790729823)]), $toNativeArray($kindUint64, [new $Uint64(1984012608, 3430420731), new $Uint64(3697038081, 3312154103)]), $toNativeArray($kindUint64, [new $Uint64(2850620616, 2144012957), new $Uint64(2310648801, 459483578)]), $toNativeArray($kindUint64, [new $Uint64(1415792122, 2680016196), new $Uint64(2888311001, 1648096297)]), $toNativeArray($kindUint64, [new $Uint64(2843481977, 1202536597), new $Uint64(3610388751, 3133862195)]), $toNativeArray($kindUint64, [new $Uint64(1240305323, 3435939933), new $Uint64(2256492969, 3569276608)]), $toNativeArray($kindUint64, [new $Uint64(1550381654, 3221183092), new $Uint64(2820616212, 1240370288)]), $toNativeArray($kindUint64, [new $Uint64(1937977068, 1878995217), new $Uint64(3525770265, 1550462860)]), $toNativeArray($kindUint64, [new $Uint64(3358719315, 3321855659), new $Uint64(2203606415, 3653393847)]), $toNativeArray($kindUint64, [new $Uint64(3124657320, 3078577749), new $Uint64(2754508019, 3493000485)]), $toNativeArray($kindUint64, [new $Uint64(684596178, 3848222187), new $Uint64(3443135024, 3292508783)]), $toNativeArray($kindUint64, [new $Uint64(2038485347, 3478880691), new $Uint64(2151959390, 2057817989)]), $toNativeArray($kindUint64, [new $Uint64(3621848508, 3274859039), new $Uint64(2689949238, 424788838)]), $toNativeArray($kindUint64, [new $Uint64(2379826987, 4093573799), new $Uint64(3362436547, 2678469696)]), $toNativeArray($kindUint64, [new $Uint64(2974783734, 4043225425), new $Uint64(4203045684, 2274345296)]), $toNativeArray($kindUint64, [new $Uint64(1859239834, 1453274067), new $Uint64(2626903552, 3568949458)]), $toNativeArray($kindUint64, [new $Uint64(176566144, 3964076232), new $Uint64(3283629441, 166219527)]), $toNativeArray($kindUint64, [new $Uint64(3441933153, 660127994), new $Uint64(4104536801, 1281516232)]), $toNativeArray($kindUint64, [new $Uint64(2151208220, 3096934556), new $Uint64(2565335500, 3485302205)]), $toNativeArray($kindUint64, [new $Uint64(3762752099, 3871168195), new $Uint64(3206669376, 61660460)]), $toNativeArray($kindUint64, [new $Uint64(408472828, 3765218420), new $Uint64(4008336720, 77075576)]), $toNativeArray($kindUint64, [new $Uint64(255295518, 205777864), new $Uint64(2505210450, 48172235)]), $toNativeArray($kindUint64, [new $Uint64(3540344869, 2404705978), new $Uint64(3131513062, 2207698941)]), $toNativeArray($kindUint64, [new $Uint64(1204205614, 4079624297), new $Uint64(3914391328, 612140029)]), $toNativeArray($kindUint64, [new $Uint64(1289499421, 1476023361), new $Uint64(2446494580, 382587518)]), $toNativeArray($kindUint64, [new $Uint64(3759357924, 2918771026), new $Uint64(3058118225, 478234397)]), $toNativeArray($kindUint64, [new $Uint64(1477971933, 3648463782), new $Uint64(3822647781, 1671534821)]), $toNativeArray($kindUint64, [new $Uint64(1460603370, 2817160776), new $Uint64(2389154863, 1581580175)]), $toNativeArray($kindUint64, [new $Uint64(752012389, 1373967322), new $Uint64(2986443579, 903233395)]), $toNativeArray($kindUint64, [new $Uint64(4161240958, 2791200977), new $Uint64(3733054474, 55299919)]), $toNativeArray($kindUint64, [new $Uint64(4211388335, 670758786), new $Uint64(2333159046, 1108304273)]), $toNativeArray($kindUint64, [new $Uint64(2043009946, 4059673955), new $Uint64(2916448807, 3532863990)]), $toNativeArray($kindUint64, [new $Uint64(406278785, 2927108796), new $Uint64(3645561009, 3342338164)]), $toNativeArray($kindUint64, [new $Uint64(2401407889, 218830261), new $Uint64(2278475631, 478348616)]), $toNativeArray($kindUint64, [new $Uint64(3001759861, 1347279650), new $Uint64(2848094538, 3819161242)]), $toNativeArray($kindUint64, [new $Uint64(1604716178, 2757841387), new $Uint64(3560118173, 2626467905)]), $toNativeArray($kindUint64, [new $Uint64(3687302171, 2797392691), new $Uint64(2225073858, 2178413352)]), $toNativeArray($kindUint64, [new $Uint64(314160418, 2422999040), new $Uint64(2781342323, 575533043)]), $toNativeArray($kindUint64, [new $Uint64(3613925995, 881265152), new $Uint64(3476677903, 3940641775)]), $toNativeArray($kindUint64, [new $Uint64(3869316483, 13919808), new $Uint64(2172923689, 4073513845)]), $toNativeArray($kindUint64, [new $Uint64(1615420131, 3238625232), new $Uint64(2716154612, 1870666835)]), $toNativeArray($kindUint64, [new $Uint64(945533340, 2974539716), new $Uint64(3395193265, 2338333544)]), $toNativeArray($kindUint64, [new $Uint64(1181916675, 3718174645), new $Uint64(4243991581, 3996658754)]), $toNativeArray($kindUint64, [new $Uint64(1812439746, 1786988241), new $Uint64(2652494738, 3034782633)]), $toNativeArray($kindUint64, [new $Uint64(3339291507, 86251653), new $Uint64(3315618423, 1645994643)]), $toNativeArray($kindUint64, [new $Uint64(3100372559, 3329040039), new $Uint64(4144523029, 983751480)]), $toNativeArray($kindUint64, [new $Uint64(1937732849, 3691262760), new $Uint64(2590326893, 1151715587)]), $toNativeArray($kindUint64, [new $Uint64(1348424238, 1392852978), new $Uint64(3237908616, 2513386308)]), $toNativeArray($kindUint64, [new $Uint64(1685530297, 3888549871), new $Uint64(4047385770, 3141732885)]), $toNativeArray($kindUint64, [new $Uint64(1590327348, 819730933), new $Uint64(2529616106, 3037324877)]), $toNativeArray($kindUint64, [new $Uint64(3061651009, 1024663666), new $Uint64(3162020133, 1649172448)]), $toNativeArray($kindUint64, [new $Uint64(3827063761, 2354571407), new $Uint64(3952525166, 3135207384)]), $toNativeArray($kindUint64, [new $Uint64(2391914850, 4155961689), new $Uint64(2470328229, 885762791)]), $toNativeArray($kindUint64, [new $Uint64(1916151739, 3047468464), new $Uint64(3087910286, 2180945313)]), $toNativeArray($kindUint64, [new $Uint64(3468931498, 2735593756), new $Uint64(3859887858, 578697993)]), $toNativeArray($kindUint64, [new $Uint64(557469450, 2783487921), new $Uint64(2412429911, 1435428070)]), $toNativeArray($kindUint64, [new $Uint64(2844320461, 1331876253), new $Uint64(3015537389, 720543263)]), $toNativeArray($kindUint64, [new $Uint64(2481658752, 2738587141), new $Uint64(3769421736, 1974420903)]), $toNativeArray($kindUint64, [new $Uint64(3161649456, 1711616963), new $Uint64(2355888585, 1234013064)]), $toNativeArray($kindUint64, [new $Uint64(3952061820, 2139521204), new $Uint64(2944860731, 2616258154)]), $toNativeArray($kindUint64, [new $Uint64(2792593627, 2674401505), new $Uint64(3681075914, 2196580869)]), $toNativeArray($kindUint64, [new $Uint64(2282241929, 1134630028), new $Uint64(2300672446, 2446604867)]), $toNativeArray($kindUint64, [new $Uint64(1779060587, 2492029360), new $Uint64(2875840558, 910772436)]), $toNativeArray($kindUint64, [new $Uint64(2223825734, 2041294876), new $Uint64(3594800697, 3285949193)]), $toNativeArray($kindUint64, [new $Uint64(4074245644, 202067473), new $Uint64(2246750436, 443105509)]), $toNativeArray($kindUint64, [new $Uint64(1871581583, 252584341), new $Uint64(2808438045, 553881887)]), $toNativeArray($kindUint64, [new $Uint64(1265735154, 3536955899), new $Uint64(3510547556, 1766094183)])]); + leftcheats = new sliceType$2([new leftCheat.ptr(0, ""), new leftCheat.ptr(1, "5"), new leftCheat.ptr(1, "25"), new leftCheat.ptr(1, "125"), new leftCheat.ptr(2, "625"), new leftCheat.ptr(2, "3125"), new leftCheat.ptr(2, "15625"), new leftCheat.ptr(3, "78125"), new leftCheat.ptr(3, "390625"), new leftCheat.ptr(3, "1953125"), new leftCheat.ptr(4, "9765625"), new leftCheat.ptr(4, "48828125"), new leftCheat.ptr(4, "244140625"), new leftCheat.ptr(4, "1220703125"), new leftCheat.ptr(5, "6103515625"), new leftCheat.ptr(5, "30517578125"), new leftCheat.ptr(5, "152587890625"), new leftCheat.ptr(6, "762939453125"), new leftCheat.ptr(6, "3814697265625"), new leftCheat.ptr(6, "19073486328125"), new leftCheat.ptr(7, "95367431640625"), new leftCheat.ptr(7, "476837158203125"), new leftCheat.ptr(7, "2384185791015625"), new leftCheat.ptr(7, "11920928955078125"), new leftCheat.ptr(8, "59604644775390625"), new leftCheat.ptr(8, "298023223876953125"), new leftCheat.ptr(8, "1490116119384765625"), new leftCheat.ptr(9, "7450580596923828125"), new leftCheat.ptr(9, "37252902984619140625"), new leftCheat.ptr(9, "186264514923095703125"), new leftCheat.ptr(10, "931322574615478515625"), new leftCheat.ptr(10, "4656612873077392578125"), new leftCheat.ptr(10, "23283064365386962890625"), new leftCheat.ptr(10, "116415321826934814453125"), new leftCheat.ptr(11, "582076609134674072265625"), new leftCheat.ptr(11, "2910383045673370361328125"), new leftCheat.ptr(11, "14551915228366851806640625"), new leftCheat.ptr(12, "72759576141834259033203125"), new leftCheat.ptr(12, "363797880709171295166015625"), new leftCheat.ptr(12, "1818989403545856475830078125"), new leftCheat.ptr(13, "9094947017729282379150390625"), new leftCheat.ptr(13, "45474735088646411895751953125"), new leftCheat.ptr(13, "227373675443232059478759765625"), new leftCheat.ptr(13, "1136868377216160297393798828125"), new leftCheat.ptr(14, "5684341886080801486968994140625"), new leftCheat.ptr(14, "28421709430404007434844970703125"), new leftCheat.ptr(14, "142108547152020037174224853515625"), new leftCheat.ptr(15, "710542735760100185871124267578125"), new leftCheat.ptr(15, "3552713678800500929355621337890625"), new leftCheat.ptr(15, "17763568394002504646778106689453125"), new leftCheat.ptr(16, "88817841970012523233890533447265625"), new leftCheat.ptr(16, "444089209850062616169452667236328125"), new leftCheat.ptr(16, "2220446049250313080847263336181640625"), new leftCheat.ptr(16, "11102230246251565404236316680908203125"), new leftCheat.ptr(17, "55511151231257827021181583404541015625"), new leftCheat.ptr(17, "277555756156289135105907917022705078125"), new leftCheat.ptr(17, "1387778780781445675529539585113525390625"), new leftCheat.ptr(18, "6938893903907228377647697925567626953125"), new leftCheat.ptr(18, "34694469519536141888238489627838134765625"), new leftCheat.ptr(18, "173472347597680709441192448139190673828125"), new leftCheat.ptr(19, "867361737988403547205962240695953369140625")]); + $pkg.ErrRange = errors.New("value out of range"); + $pkg.ErrSyntax = errors.New("invalid syntax"); + optimize = true; + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["crypto"] = (function() { + var $pkg = {}, $init, hash, io, strconv, funcType, sliceType$1, hashes, RegisterHash; + hash = $packages["hash"]; + io = $packages["io"]; + strconv = $packages["strconv"]; + funcType = $funcType([], [hash.Hash], false); + sliceType$1 = $sliceType(funcType); + RegisterHash = function(h, f) { + var f, h; + if (h >= 20) { + $panic(new $String("crypto: RegisterHash of unknown hash function")); + } + ((h < 0 || h >= hashes.$length) ? ($throwRuntimeError("index out of range"), undefined) : hashes.$array[hashes.$offset + h] = f); + }; + $pkg.RegisterHash = RegisterHash; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = hash.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + hashes = $makeSlice(sliceType$1, 20); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/abi"] = (function() { + var $pkg = {}, $init, goarch, FuncPCABI0; + goarch = $packages["internal/goarch"]; + FuncPCABI0 = function() { + $throwRuntimeError("native function not implemented: internal/abi.FuncPCABI0"); + }; + $pkg.FuncPCABI0 = FuncPCABI0; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = goarch.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/goexperiment"] = (function() { + var $pkg = {}, $init; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["unicode"] = (function() { - var $pkg = {}, $init, CaseRange, d, arrayType, sliceType$3, _CaseRanges, to, To, ToLower; + var $pkg = {}, $init, CaseRange, d, sliceType$3, arrayType, _CaseRanges, To, ToLower, to; CaseRange = $pkg.CaseRange = $newType(0, $kindStruct, "unicode.CaseRange", true, "unicode", true, function(Lo_, Hi_, Delta_) { this.$val = this; if (arguments.length === 0) { @@ -12928,8 +14858,26 @@ $packages["unicode"] = (function() { this.Delta = Delta_; }); d = $pkg.d = $newType(12, $kindArray, "unicode.d", true, "unicode", false, null); - arrayType = $arrayType($Int32, 3); sliceType$3 = $sliceType(CaseRange); + arrayType = $arrayType($Int32, 3); + To = function(_case, r) { + var _case, _tuple, r; + _tuple = to(_case, r, $pkg.CaseRanges); + r = _tuple[0]; + return r; + }; + $pkg.To = To; + ToLower = function(r) { + var r; + if (r <= 127) { + if (65 <= r && r <= 90) { + r = r + (32) >> 0; + } + return r; + } + return To(1, r); + }; + $pkg.ToLower = ToLower; to = function(_case, r, caseRange) { var _case, _q, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, caseRange, cr, delta, foundMapping, hi, lo, m, mappedRune, r, x; mappedRune = 0; @@ -12974,30 +14922,12 @@ $packages["unicode"] = (function() { foundMapping = _tmp$7; return [mappedRune, foundMapping]; }; - To = function(_case, r) { - var _case, _tuple, r; - _tuple = to(_case, r, $pkg.CaseRanges); - r = _tuple[0]; - return r; - }; - $pkg.To = To; - ToLower = function(r) { - var r; - if (r <= 127) { - if (65 <= r && r <= 90) { - r = r + (32) >> 0; - } - return r; - } - return To(1, r); - }; - $pkg.ToLower = ToLower; CaseRange.init("", [{prop: "Lo", name: "Lo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Delta", name: "Delta", embedded: false, exported: true, typ: d, tag: ""}]); d.init($Int32, 3); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _CaseRanges = new sliceType$3([new CaseRange.ptr(65, 90, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(97, 122, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(181, 181, $toNativeArray($kindInt32, [743, 0, 743])), new CaseRange.ptr(192, 214, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(216, 222, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(224, 246, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(248, 254, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(255, 255, $toNativeArray($kindInt32, [121, 0, 121])), new CaseRange.ptr(256, 303, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(304, 304, $toNativeArray($kindInt32, [0, -199, 0])), new CaseRange.ptr(305, 305, $toNativeArray($kindInt32, [-232, 0, -232])), new CaseRange.ptr(306, 311, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(313, 328, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(330, 375, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(376, 376, $toNativeArray($kindInt32, [0, -121, 0])), new CaseRange.ptr(377, 382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(383, 383, $toNativeArray($kindInt32, [-300, 0, -300])), new CaseRange.ptr(384, 384, $toNativeArray($kindInt32, [195, 0, 195])), new CaseRange.ptr(385, 385, $toNativeArray($kindInt32, [0, 210, 0])), new CaseRange.ptr(386, 389, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(390, 390, $toNativeArray($kindInt32, [0, 206, 0])), new CaseRange.ptr(391, 392, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(393, 394, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(395, 396, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(398, 398, $toNativeArray($kindInt32, [0, 79, 0])), new CaseRange.ptr(399, 399, $toNativeArray($kindInt32, [0, 202, 0])), new CaseRange.ptr(400, 400, $toNativeArray($kindInt32, [0, 203, 0])), new CaseRange.ptr(401, 402, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(403, 403, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(404, 404, $toNativeArray($kindInt32, [0, 207, 0])), new CaseRange.ptr(405, 405, $toNativeArray($kindInt32, [97, 0, 97])), new CaseRange.ptr(406, 406, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(407, 407, $toNativeArray($kindInt32, [0, 209, 0])), new CaseRange.ptr(408, 409, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(410, 410, $toNativeArray($kindInt32, [163, 0, 163])), new CaseRange.ptr(412, 412, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(413, 413, $toNativeArray($kindInt32, [0, 213, 0])), new CaseRange.ptr(414, 414, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(415, 415, $toNativeArray($kindInt32, [0, 214, 0])), new CaseRange.ptr(416, 421, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(422, 422, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(423, 424, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(425, 425, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(428, 429, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(430, 430, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(431, 432, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(433, 434, $toNativeArray($kindInt32, [0, 217, 0])), new CaseRange.ptr(435, 438, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(439, 439, $toNativeArray($kindInt32, [0, 219, 0])), new CaseRange.ptr(440, 441, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(444, 445, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(447, 447, $toNativeArray($kindInt32, [56, 0, 56])), new CaseRange.ptr(452, 452, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(453, 453, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(454, 454, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(455, 455, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(456, 456, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(457, 457, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(458, 458, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(459, 459, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(460, 460, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(461, 476, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(477, 477, $toNativeArray($kindInt32, [-79, 0, -79])), new CaseRange.ptr(478, 495, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(497, 497, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(498, 498, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(499, 499, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(500, 501, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(502, 502, $toNativeArray($kindInt32, [0, -97, 0])), new CaseRange.ptr(503, 503, $toNativeArray($kindInt32, [0, -56, 0])), new CaseRange.ptr(504, 543, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(544, 544, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(546, 563, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(570, 570, $toNativeArray($kindInt32, [0, 10795, 0])), new CaseRange.ptr(571, 572, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(573, 573, $toNativeArray($kindInt32, [0, -163, 0])), new CaseRange.ptr(574, 574, $toNativeArray($kindInt32, [0, 10792, 0])), new CaseRange.ptr(575, 576, $toNativeArray($kindInt32, [10815, 0, 10815])), new CaseRange.ptr(577, 578, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(579, 579, $toNativeArray($kindInt32, [0, -195, 0])), new CaseRange.ptr(580, 580, $toNativeArray($kindInt32, [0, 69, 0])), new CaseRange.ptr(581, 581, $toNativeArray($kindInt32, [0, 71, 0])), new CaseRange.ptr(582, 591, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(592, 592, $toNativeArray($kindInt32, [10783, 0, 10783])), new CaseRange.ptr(593, 593, $toNativeArray($kindInt32, [10780, 0, 10780])), new CaseRange.ptr(594, 594, $toNativeArray($kindInt32, [10782, 0, 10782])), new CaseRange.ptr(595, 595, $toNativeArray($kindInt32, [-210, 0, -210])), new CaseRange.ptr(596, 596, $toNativeArray($kindInt32, [-206, 0, -206])), new CaseRange.ptr(598, 599, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(601, 601, $toNativeArray($kindInt32, [-202, 0, -202])), new CaseRange.ptr(603, 603, $toNativeArray($kindInt32, [-203, 0, -203])), new CaseRange.ptr(604, 604, $toNativeArray($kindInt32, [42319, 0, 42319])), new CaseRange.ptr(608, 608, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(609, 609, $toNativeArray($kindInt32, [42315, 0, 42315])), new CaseRange.ptr(611, 611, $toNativeArray($kindInt32, [-207, 0, -207])), new CaseRange.ptr(613, 613, $toNativeArray($kindInt32, [42280, 0, 42280])), new CaseRange.ptr(614, 614, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(616, 616, $toNativeArray($kindInt32, [-209, 0, -209])), new CaseRange.ptr(617, 617, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(618, 618, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(619, 619, $toNativeArray($kindInt32, [10743, 0, 10743])), new CaseRange.ptr(620, 620, $toNativeArray($kindInt32, [42305, 0, 42305])), new CaseRange.ptr(623, 623, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(625, 625, $toNativeArray($kindInt32, [10749, 0, 10749])), new CaseRange.ptr(626, 626, $toNativeArray($kindInt32, [-213, 0, -213])), new CaseRange.ptr(629, 629, $toNativeArray($kindInt32, [-214, 0, -214])), new CaseRange.ptr(637, 637, $toNativeArray($kindInt32, [10727, 0, 10727])), new CaseRange.ptr(640, 640, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(643, 643, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(647, 647, $toNativeArray($kindInt32, [42282, 0, 42282])), new CaseRange.ptr(648, 648, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(649, 649, $toNativeArray($kindInt32, [-69, 0, -69])), new CaseRange.ptr(650, 651, $toNativeArray($kindInt32, [-217, 0, -217])), new CaseRange.ptr(652, 652, $toNativeArray($kindInt32, [-71, 0, -71])), new CaseRange.ptr(658, 658, $toNativeArray($kindInt32, [-219, 0, -219])), new CaseRange.ptr(669, 669, $toNativeArray($kindInt32, [42261, 0, 42261])), new CaseRange.ptr(670, 670, $toNativeArray($kindInt32, [42258, 0, 42258])), new CaseRange.ptr(837, 837, $toNativeArray($kindInt32, [84, 0, 84])), new CaseRange.ptr(880, 883, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(886, 887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(891, 893, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(895, 895, $toNativeArray($kindInt32, [0, 116, 0])), new CaseRange.ptr(902, 902, $toNativeArray($kindInt32, [0, 38, 0])), new CaseRange.ptr(904, 906, $toNativeArray($kindInt32, [0, 37, 0])), new CaseRange.ptr(908, 908, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(910, 911, $toNativeArray($kindInt32, [0, 63, 0])), new CaseRange.ptr(913, 929, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(931, 939, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(940, 940, $toNativeArray($kindInt32, [-38, 0, -38])), new CaseRange.ptr(941, 943, $toNativeArray($kindInt32, [-37, 0, -37])), new CaseRange.ptr(945, 961, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(962, 962, $toNativeArray($kindInt32, [-31, 0, -31])), new CaseRange.ptr(963, 971, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(972, 972, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(973, 974, $toNativeArray($kindInt32, [-63, 0, -63])), new CaseRange.ptr(975, 975, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(976, 976, $toNativeArray($kindInt32, [-62, 0, -62])), new CaseRange.ptr(977, 977, $toNativeArray($kindInt32, [-57, 0, -57])), new CaseRange.ptr(981, 981, $toNativeArray($kindInt32, [-47, 0, -47])), new CaseRange.ptr(982, 982, $toNativeArray($kindInt32, [-54, 0, -54])), new CaseRange.ptr(983, 983, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(984, 1007, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1008, 1008, $toNativeArray($kindInt32, [-86, 0, -86])), new CaseRange.ptr(1009, 1009, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1010, 1010, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(1011, 1011, $toNativeArray($kindInt32, [-116, 0, -116])), new CaseRange.ptr(1012, 1012, $toNativeArray($kindInt32, [0, -60, 0])), new CaseRange.ptr(1013, 1013, $toNativeArray($kindInt32, [-96, 0, -96])), new CaseRange.ptr(1015, 1016, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1017, 1017, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(1018, 1019, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1021, 1023, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(1024, 1039, $toNativeArray($kindInt32, [0, 80, 0])), new CaseRange.ptr(1040, 1071, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(1072, 1103, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(1104, 1119, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1120, 1153, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1162, 1215, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1216, 1216, $toNativeArray($kindInt32, [0, 15, 0])), new CaseRange.ptr(1217, 1230, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1231, 1231, $toNativeArray($kindInt32, [-15, 0, -15])), new CaseRange.ptr(1232, 1327, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1329, 1366, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(1377, 1414, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(4256, 4293, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4295, 4295, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4301, 4301, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(5024, 5103, $toNativeArray($kindInt32, [0, 38864, 0])), new CaseRange.ptr(5104, 5109, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(5112, 5117, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(7296, 7296, $toNativeArray($kindInt32, [-6254, 0, -6254])), new CaseRange.ptr(7297, 7297, $toNativeArray($kindInt32, [-6253, 0, -6253])), new CaseRange.ptr(7298, 7298, $toNativeArray($kindInt32, [-6244, 0, -6244])), new CaseRange.ptr(7299, 7300, $toNativeArray($kindInt32, [-6242, 0, -6242])), new CaseRange.ptr(7301, 7301, $toNativeArray($kindInt32, [-6243, 0, -6243])), new CaseRange.ptr(7302, 7302, $toNativeArray($kindInt32, [-6236, 0, -6236])), new CaseRange.ptr(7303, 7303, $toNativeArray($kindInt32, [-6181, 0, -6181])), new CaseRange.ptr(7304, 7304, $toNativeArray($kindInt32, [35266, 0, 35266])), new CaseRange.ptr(7545, 7545, $toNativeArray($kindInt32, [35332, 0, 35332])), new CaseRange.ptr(7549, 7549, $toNativeArray($kindInt32, [3814, 0, 3814])), new CaseRange.ptr(7680, 7829, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7835, 7835, $toNativeArray($kindInt32, [-59, 0, -59])), new CaseRange.ptr(7838, 7838, $toNativeArray($kindInt32, [0, -7615, 0])), new CaseRange.ptr(7840, 7935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7936, 7943, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7944, 7951, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7952, 7957, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7960, 7965, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7968, 7975, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7976, 7983, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7984, 7991, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7992, 7999, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8000, 8005, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8008, 8013, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8017, 8017, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8019, 8019, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8021, 8021, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8023, 8023, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8025, 8025, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8027, 8027, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8029, 8029, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8031, 8031, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8032, 8039, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8040, 8047, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8048, 8049, $toNativeArray($kindInt32, [74, 0, 74])), new CaseRange.ptr(8050, 8053, $toNativeArray($kindInt32, [86, 0, 86])), new CaseRange.ptr(8054, 8055, $toNativeArray($kindInt32, [100, 0, 100])), new CaseRange.ptr(8056, 8057, $toNativeArray($kindInt32, [128, 0, 128])), new CaseRange.ptr(8058, 8059, $toNativeArray($kindInt32, [112, 0, 112])), new CaseRange.ptr(8060, 8061, $toNativeArray($kindInt32, [126, 0, 126])), new CaseRange.ptr(8064, 8071, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8072, 8079, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8080, 8087, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8088, 8095, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8096, 8103, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8104, 8111, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8112, 8113, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8115, 8115, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8120, 8121, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8122, 8123, $toNativeArray($kindInt32, [0, -74, 0])), new CaseRange.ptr(8124, 8124, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8126, 8126, $toNativeArray($kindInt32, [-7205, 0, -7205])), new CaseRange.ptr(8131, 8131, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8136, 8139, $toNativeArray($kindInt32, [0, -86, 0])), new CaseRange.ptr(8140, 8140, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8144, 8145, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8152, 8153, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8154, 8155, $toNativeArray($kindInt32, [0, -100, 0])), new CaseRange.ptr(8160, 8161, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8165, 8165, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(8168, 8169, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8170, 8171, $toNativeArray($kindInt32, [0, -112, 0])), new CaseRange.ptr(8172, 8172, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(8179, 8179, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8184, 8185, $toNativeArray($kindInt32, [0, -128, 0])), new CaseRange.ptr(8186, 8187, $toNativeArray($kindInt32, [0, -126, 0])), new CaseRange.ptr(8188, 8188, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8486, 8486, $toNativeArray($kindInt32, [0, -7517, 0])), new CaseRange.ptr(8490, 8490, $toNativeArray($kindInt32, [0, -8383, 0])), new CaseRange.ptr(8491, 8491, $toNativeArray($kindInt32, [0, -8262, 0])), new CaseRange.ptr(8498, 8498, $toNativeArray($kindInt32, [0, 28, 0])), new CaseRange.ptr(8526, 8526, $toNativeArray($kindInt32, [-28, 0, -28])), new CaseRange.ptr(8544, 8559, $toNativeArray($kindInt32, [0, 16, 0])), new CaseRange.ptr(8560, 8575, $toNativeArray($kindInt32, [-16, 0, -16])), new CaseRange.ptr(8579, 8580, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(9398, 9423, $toNativeArray($kindInt32, [0, 26, 0])), new CaseRange.ptr(9424, 9449, $toNativeArray($kindInt32, [-26, 0, -26])), new CaseRange.ptr(11264, 11310, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(11312, 11358, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(11360, 11361, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11362, 11362, $toNativeArray($kindInt32, [0, -10743, 0])), new CaseRange.ptr(11363, 11363, $toNativeArray($kindInt32, [0, -3814, 0])), new CaseRange.ptr(11364, 11364, $toNativeArray($kindInt32, [0, -10727, 0])), new CaseRange.ptr(11365, 11365, $toNativeArray($kindInt32, [-10795, 0, -10795])), new CaseRange.ptr(11366, 11366, $toNativeArray($kindInt32, [-10792, 0, -10792])), new CaseRange.ptr(11367, 11372, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11373, 11373, $toNativeArray($kindInt32, [0, -10780, 0])), new CaseRange.ptr(11374, 11374, $toNativeArray($kindInt32, [0, -10749, 0])), new CaseRange.ptr(11375, 11375, $toNativeArray($kindInt32, [0, -10783, 0])), new CaseRange.ptr(11376, 11376, $toNativeArray($kindInt32, [0, -10782, 0])), new CaseRange.ptr(11378, 11379, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11381, 11382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11390, 11391, $toNativeArray($kindInt32, [0, -10815, 0])), new CaseRange.ptr(11392, 11491, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11499, 11502, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11506, 11507, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11520, 11557, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11559, 11559, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11565, 11565, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(42560, 42605, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42624, 42651, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42786, 42799, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42802, 42863, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42873, 42876, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42877, 42877, $toNativeArray($kindInt32, [0, -35332, 0])), new CaseRange.ptr(42878, 42887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42891, 42892, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42893, 42893, $toNativeArray($kindInt32, [0, -42280, 0])), new CaseRange.ptr(42896, 42899, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42902, 42921, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42922, 42922, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42923, 42923, $toNativeArray($kindInt32, [0, -42319, 0])), new CaseRange.ptr(42924, 42924, $toNativeArray($kindInt32, [0, -42315, 0])), new CaseRange.ptr(42925, 42925, $toNativeArray($kindInt32, [0, -42305, 0])), new CaseRange.ptr(42926, 42926, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42928, 42928, $toNativeArray($kindInt32, [0, -42258, 0])), new CaseRange.ptr(42929, 42929, $toNativeArray($kindInt32, [0, -42282, 0])), new CaseRange.ptr(42930, 42930, $toNativeArray($kindInt32, [0, -42261, 0])), new CaseRange.ptr(42931, 42931, $toNativeArray($kindInt32, [0, 928, 0])), new CaseRange.ptr(42932, 42935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(43859, 43859, $toNativeArray($kindInt32, [-928, 0, -928])), new CaseRange.ptr(43888, 43967, $toNativeArray($kindInt32, [-38864, 0, -38864])), new CaseRange.ptr(65313, 65338, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(65345, 65370, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(66560, 66599, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66600, 66639, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(66736, 66771, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66776, 66811, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(68736, 68786, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(68800, 68850, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(71840, 71871, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(71872, 71903, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(125184, 125217, $toNativeArray($kindInt32, [0, 34, 0])), new CaseRange.ptr(125218, 125251, $toNativeArray($kindInt32, [-34, 0, -34]))]); + _CaseRanges = new sliceType$3([new CaseRange.ptr(65, 90, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(97, 122, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(181, 181, $toNativeArray($kindInt32, [743, 0, 743])), new CaseRange.ptr(192, 214, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(216, 222, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(224, 246, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(248, 254, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(255, 255, $toNativeArray($kindInt32, [121, 0, 121])), new CaseRange.ptr(256, 303, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(304, 304, $toNativeArray($kindInt32, [0, -199, 0])), new CaseRange.ptr(305, 305, $toNativeArray($kindInt32, [-232, 0, -232])), new CaseRange.ptr(306, 311, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(313, 328, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(330, 375, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(376, 376, $toNativeArray($kindInt32, [0, -121, 0])), new CaseRange.ptr(377, 382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(383, 383, $toNativeArray($kindInt32, [-300, 0, -300])), new CaseRange.ptr(384, 384, $toNativeArray($kindInt32, [195, 0, 195])), new CaseRange.ptr(385, 385, $toNativeArray($kindInt32, [0, 210, 0])), new CaseRange.ptr(386, 389, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(390, 390, $toNativeArray($kindInt32, [0, 206, 0])), new CaseRange.ptr(391, 392, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(393, 394, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(395, 396, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(398, 398, $toNativeArray($kindInt32, [0, 79, 0])), new CaseRange.ptr(399, 399, $toNativeArray($kindInt32, [0, 202, 0])), new CaseRange.ptr(400, 400, $toNativeArray($kindInt32, [0, 203, 0])), new CaseRange.ptr(401, 402, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(403, 403, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(404, 404, $toNativeArray($kindInt32, [0, 207, 0])), new CaseRange.ptr(405, 405, $toNativeArray($kindInt32, [97, 0, 97])), new CaseRange.ptr(406, 406, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(407, 407, $toNativeArray($kindInt32, [0, 209, 0])), new CaseRange.ptr(408, 409, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(410, 410, $toNativeArray($kindInt32, [163, 0, 163])), new CaseRange.ptr(412, 412, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(413, 413, $toNativeArray($kindInt32, [0, 213, 0])), new CaseRange.ptr(414, 414, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(415, 415, $toNativeArray($kindInt32, [0, 214, 0])), new CaseRange.ptr(416, 421, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(422, 422, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(423, 424, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(425, 425, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(428, 429, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(430, 430, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(431, 432, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(433, 434, $toNativeArray($kindInt32, [0, 217, 0])), new CaseRange.ptr(435, 438, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(439, 439, $toNativeArray($kindInt32, [0, 219, 0])), new CaseRange.ptr(440, 441, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(444, 445, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(447, 447, $toNativeArray($kindInt32, [56, 0, 56])), new CaseRange.ptr(452, 452, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(453, 453, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(454, 454, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(455, 455, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(456, 456, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(457, 457, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(458, 458, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(459, 459, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(460, 460, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(461, 476, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(477, 477, $toNativeArray($kindInt32, [-79, 0, -79])), new CaseRange.ptr(478, 495, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(497, 497, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(498, 498, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(499, 499, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(500, 501, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(502, 502, $toNativeArray($kindInt32, [0, -97, 0])), new CaseRange.ptr(503, 503, $toNativeArray($kindInt32, [0, -56, 0])), new CaseRange.ptr(504, 543, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(544, 544, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(546, 563, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(570, 570, $toNativeArray($kindInt32, [0, 10795, 0])), new CaseRange.ptr(571, 572, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(573, 573, $toNativeArray($kindInt32, [0, -163, 0])), new CaseRange.ptr(574, 574, $toNativeArray($kindInt32, [0, 10792, 0])), new CaseRange.ptr(575, 576, $toNativeArray($kindInt32, [10815, 0, 10815])), new CaseRange.ptr(577, 578, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(579, 579, $toNativeArray($kindInt32, [0, -195, 0])), new CaseRange.ptr(580, 580, $toNativeArray($kindInt32, [0, 69, 0])), new CaseRange.ptr(581, 581, $toNativeArray($kindInt32, [0, 71, 0])), new CaseRange.ptr(582, 591, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(592, 592, $toNativeArray($kindInt32, [10783, 0, 10783])), new CaseRange.ptr(593, 593, $toNativeArray($kindInt32, [10780, 0, 10780])), new CaseRange.ptr(594, 594, $toNativeArray($kindInt32, [10782, 0, 10782])), new CaseRange.ptr(595, 595, $toNativeArray($kindInt32, [-210, 0, -210])), new CaseRange.ptr(596, 596, $toNativeArray($kindInt32, [-206, 0, -206])), new CaseRange.ptr(598, 599, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(601, 601, $toNativeArray($kindInt32, [-202, 0, -202])), new CaseRange.ptr(603, 603, $toNativeArray($kindInt32, [-203, 0, -203])), new CaseRange.ptr(604, 604, $toNativeArray($kindInt32, [42319, 0, 42319])), new CaseRange.ptr(608, 608, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(609, 609, $toNativeArray($kindInt32, [42315, 0, 42315])), new CaseRange.ptr(611, 611, $toNativeArray($kindInt32, [-207, 0, -207])), new CaseRange.ptr(613, 613, $toNativeArray($kindInt32, [42280, 0, 42280])), new CaseRange.ptr(614, 614, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(616, 616, $toNativeArray($kindInt32, [-209, 0, -209])), new CaseRange.ptr(617, 617, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(618, 618, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(619, 619, $toNativeArray($kindInt32, [10743, 0, 10743])), new CaseRange.ptr(620, 620, $toNativeArray($kindInt32, [42305, 0, 42305])), new CaseRange.ptr(623, 623, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(625, 625, $toNativeArray($kindInt32, [10749, 0, 10749])), new CaseRange.ptr(626, 626, $toNativeArray($kindInt32, [-213, 0, -213])), new CaseRange.ptr(629, 629, $toNativeArray($kindInt32, [-214, 0, -214])), new CaseRange.ptr(637, 637, $toNativeArray($kindInt32, [10727, 0, 10727])), new CaseRange.ptr(640, 640, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(642, 642, $toNativeArray($kindInt32, [42307, 0, 42307])), new CaseRange.ptr(643, 643, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(647, 647, $toNativeArray($kindInt32, [42282, 0, 42282])), new CaseRange.ptr(648, 648, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(649, 649, $toNativeArray($kindInt32, [-69, 0, -69])), new CaseRange.ptr(650, 651, $toNativeArray($kindInt32, [-217, 0, -217])), new CaseRange.ptr(652, 652, $toNativeArray($kindInt32, [-71, 0, -71])), new CaseRange.ptr(658, 658, $toNativeArray($kindInt32, [-219, 0, -219])), new CaseRange.ptr(669, 669, $toNativeArray($kindInt32, [42261, 0, 42261])), new CaseRange.ptr(670, 670, $toNativeArray($kindInt32, [42258, 0, 42258])), new CaseRange.ptr(837, 837, $toNativeArray($kindInt32, [84, 0, 84])), new CaseRange.ptr(880, 883, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(886, 887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(891, 893, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(895, 895, $toNativeArray($kindInt32, [0, 116, 0])), new CaseRange.ptr(902, 902, $toNativeArray($kindInt32, [0, 38, 0])), new CaseRange.ptr(904, 906, $toNativeArray($kindInt32, [0, 37, 0])), new CaseRange.ptr(908, 908, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(910, 911, $toNativeArray($kindInt32, [0, 63, 0])), new CaseRange.ptr(913, 929, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(931, 939, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(940, 940, $toNativeArray($kindInt32, [-38, 0, -38])), new CaseRange.ptr(941, 943, $toNativeArray($kindInt32, [-37, 0, -37])), new CaseRange.ptr(945, 961, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(962, 962, $toNativeArray($kindInt32, [-31, 0, -31])), new CaseRange.ptr(963, 971, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(972, 972, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(973, 974, $toNativeArray($kindInt32, [-63, 0, -63])), new CaseRange.ptr(975, 975, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(976, 976, $toNativeArray($kindInt32, [-62, 0, -62])), new CaseRange.ptr(977, 977, $toNativeArray($kindInt32, [-57, 0, -57])), new CaseRange.ptr(981, 981, $toNativeArray($kindInt32, [-47, 0, -47])), new CaseRange.ptr(982, 982, $toNativeArray($kindInt32, [-54, 0, -54])), new CaseRange.ptr(983, 983, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(984, 1007, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1008, 1008, $toNativeArray($kindInt32, [-86, 0, -86])), new CaseRange.ptr(1009, 1009, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1010, 1010, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(1011, 1011, $toNativeArray($kindInt32, [-116, 0, -116])), new CaseRange.ptr(1012, 1012, $toNativeArray($kindInt32, [0, -60, 0])), new CaseRange.ptr(1013, 1013, $toNativeArray($kindInt32, [-96, 0, -96])), new CaseRange.ptr(1015, 1016, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1017, 1017, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(1018, 1019, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1021, 1023, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(1024, 1039, $toNativeArray($kindInt32, [0, 80, 0])), new CaseRange.ptr(1040, 1071, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(1072, 1103, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(1104, 1119, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1120, 1153, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1162, 1215, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1216, 1216, $toNativeArray($kindInt32, [0, 15, 0])), new CaseRange.ptr(1217, 1230, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1231, 1231, $toNativeArray($kindInt32, [-15, 0, -15])), new CaseRange.ptr(1232, 1327, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1329, 1366, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(1377, 1414, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(4256, 4293, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4295, 4295, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4301, 4301, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4304, 4346, $toNativeArray($kindInt32, [3008, 0, 0])), new CaseRange.ptr(4349, 4351, $toNativeArray($kindInt32, [3008, 0, 0])), new CaseRange.ptr(5024, 5103, $toNativeArray($kindInt32, [0, 38864, 0])), new CaseRange.ptr(5104, 5109, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(5112, 5117, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(7296, 7296, $toNativeArray($kindInt32, [-6254, 0, -6254])), new CaseRange.ptr(7297, 7297, $toNativeArray($kindInt32, [-6253, 0, -6253])), new CaseRange.ptr(7298, 7298, $toNativeArray($kindInt32, [-6244, 0, -6244])), new CaseRange.ptr(7299, 7300, $toNativeArray($kindInt32, [-6242, 0, -6242])), new CaseRange.ptr(7301, 7301, $toNativeArray($kindInt32, [-6243, 0, -6243])), new CaseRange.ptr(7302, 7302, $toNativeArray($kindInt32, [-6236, 0, -6236])), new CaseRange.ptr(7303, 7303, $toNativeArray($kindInt32, [-6181, 0, -6181])), new CaseRange.ptr(7304, 7304, $toNativeArray($kindInt32, [35266, 0, 35266])), new CaseRange.ptr(7312, 7354, $toNativeArray($kindInt32, [0, -3008, 0])), new CaseRange.ptr(7357, 7359, $toNativeArray($kindInt32, [0, -3008, 0])), new CaseRange.ptr(7545, 7545, $toNativeArray($kindInt32, [35332, 0, 35332])), new CaseRange.ptr(7549, 7549, $toNativeArray($kindInt32, [3814, 0, 3814])), new CaseRange.ptr(7566, 7566, $toNativeArray($kindInt32, [35384, 0, 35384])), new CaseRange.ptr(7680, 7829, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7835, 7835, $toNativeArray($kindInt32, [-59, 0, -59])), new CaseRange.ptr(7838, 7838, $toNativeArray($kindInt32, [0, -7615, 0])), new CaseRange.ptr(7840, 7935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7936, 7943, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7944, 7951, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7952, 7957, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7960, 7965, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7968, 7975, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7976, 7983, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7984, 7991, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7992, 7999, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8000, 8005, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8008, 8013, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8017, 8017, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8019, 8019, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8021, 8021, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8023, 8023, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8025, 8025, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8027, 8027, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8029, 8029, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8031, 8031, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8032, 8039, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8040, 8047, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8048, 8049, $toNativeArray($kindInt32, [74, 0, 74])), new CaseRange.ptr(8050, 8053, $toNativeArray($kindInt32, [86, 0, 86])), new CaseRange.ptr(8054, 8055, $toNativeArray($kindInt32, [100, 0, 100])), new CaseRange.ptr(8056, 8057, $toNativeArray($kindInt32, [128, 0, 128])), new CaseRange.ptr(8058, 8059, $toNativeArray($kindInt32, [112, 0, 112])), new CaseRange.ptr(8060, 8061, $toNativeArray($kindInt32, [126, 0, 126])), new CaseRange.ptr(8064, 8071, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8072, 8079, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8080, 8087, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8088, 8095, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8096, 8103, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8104, 8111, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8112, 8113, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8115, 8115, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8120, 8121, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8122, 8123, $toNativeArray($kindInt32, [0, -74, 0])), new CaseRange.ptr(8124, 8124, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8126, 8126, $toNativeArray($kindInt32, [-7205, 0, -7205])), new CaseRange.ptr(8131, 8131, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8136, 8139, $toNativeArray($kindInt32, [0, -86, 0])), new CaseRange.ptr(8140, 8140, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8144, 8145, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8152, 8153, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8154, 8155, $toNativeArray($kindInt32, [0, -100, 0])), new CaseRange.ptr(8160, 8161, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8165, 8165, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(8168, 8169, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8170, 8171, $toNativeArray($kindInt32, [0, -112, 0])), new CaseRange.ptr(8172, 8172, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(8179, 8179, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8184, 8185, $toNativeArray($kindInt32, [0, -128, 0])), new CaseRange.ptr(8186, 8187, $toNativeArray($kindInt32, [0, -126, 0])), new CaseRange.ptr(8188, 8188, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8486, 8486, $toNativeArray($kindInt32, [0, -7517, 0])), new CaseRange.ptr(8490, 8490, $toNativeArray($kindInt32, [0, -8383, 0])), new CaseRange.ptr(8491, 8491, $toNativeArray($kindInt32, [0, -8262, 0])), new CaseRange.ptr(8498, 8498, $toNativeArray($kindInt32, [0, 28, 0])), new CaseRange.ptr(8526, 8526, $toNativeArray($kindInt32, [-28, 0, -28])), new CaseRange.ptr(8544, 8559, $toNativeArray($kindInt32, [0, 16, 0])), new CaseRange.ptr(8560, 8575, $toNativeArray($kindInt32, [-16, 0, -16])), new CaseRange.ptr(8579, 8580, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(9398, 9423, $toNativeArray($kindInt32, [0, 26, 0])), new CaseRange.ptr(9424, 9449, $toNativeArray($kindInt32, [-26, 0, -26])), new CaseRange.ptr(11264, 11310, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(11312, 11358, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(11360, 11361, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11362, 11362, $toNativeArray($kindInt32, [0, -10743, 0])), new CaseRange.ptr(11363, 11363, $toNativeArray($kindInt32, [0, -3814, 0])), new CaseRange.ptr(11364, 11364, $toNativeArray($kindInt32, [0, -10727, 0])), new CaseRange.ptr(11365, 11365, $toNativeArray($kindInt32, [-10795, 0, -10795])), new CaseRange.ptr(11366, 11366, $toNativeArray($kindInt32, [-10792, 0, -10792])), new CaseRange.ptr(11367, 11372, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11373, 11373, $toNativeArray($kindInt32, [0, -10780, 0])), new CaseRange.ptr(11374, 11374, $toNativeArray($kindInt32, [0, -10749, 0])), new CaseRange.ptr(11375, 11375, $toNativeArray($kindInt32, [0, -10783, 0])), new CaseRange.ptr(11376, 11376, $toNativeArray($kindInt32, [0, -10782, 0])), new CaseRange.ptr(11378, 11379, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11381, 11382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11390, 11391, $toNativeArray($kindInt32, [0, -10815, 0])), new CaseRange.ptr(11392, 11491, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11499, 11502, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11506, 11507, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11520, 11557, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11559, 11559, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11565, 11565, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(42560, 42605, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42624, 42651, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42786, 42799, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42802, 42863, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42873, 42876, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42877, 42877, $toNativeArray($kindInt32, [0, -35332, 0])), new CaseRange.ptr(42878, 42887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42891, 42892, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42893, 42893, $toNativeArray($kindInt32, [0, -42280, 0])), new CaseRange.ptr(42896, 42899, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42900, 42900, $toNativeArray($kindInt32, [48, 0, 48])), new CaseRange.ptr(42902, 42921, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42922, 42922, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42923, 42923, $toNativeArray($kindInt32, [0, -42319, 0])), new CaseRange.ptr(42924, 42924, $toNativeArray($kindInt32, [0, -42315, 0])), new CaseRange.ptr(42925, 42925, $toNativeArray($kindInt32, [0, -42305, 0])), new CaseRange.ptr(42926, 42926, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42928, 42928, $toNativeArray($kindInt32, [0, -42258, 0])), new CaseRange.ptr(42929, 42929, $toNativeArray($kindInt32, [0, -42282, 0])), new CaseRange.ptr(42930, 42930, $toNativeArray($kindInt32, [0, -42261, 0])), new CaseRange.ptr(42931, 42931, $toNativeArray($kindInt32, [0, 928, 0])), new CaseRange.ptr(42932, 42943, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42946, 42947, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42948, 42948, $toNativeArray($kindInt32, [0, -48, 0])), new CaseRange.ptr(42949, 42949, $toNativeArray($kindInt32, [0, -42307, 0])), new CaseRange.ptr(42950, 42950, $toNativeArray($kindInt32, [0, -35384, 0])), new CaseRange.ptr(42951, 42954, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42997, 42998, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(43859, 43859, $toNativeArray($kindInt32, [-928, 0, -928])), new CaseRange.ptr(43888, 43967, $toNativeArray($kindInt32, [-38864, 0, -38864])), new CaseRange.ptr(65313, 65338, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(65345, 65370, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(66560, 66599, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66600, 66639, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(66736, 66771, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66776, 66811, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(68736, 68786, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(68800, 68850, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(71840, 71871, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(71872, 71903, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(93760, 93791, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(93792, 93823, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(125184, 125217, $toNativeArray($kindInt32, [0, 34, 0])), new CaseRange.ptr(125218, 125251, $toNativeArray($kindInt32, [-34, 0, -34]))]); $pkg.CaseRanges = _CaseRanges; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; @@ -13005,85 +14935,58 @@ $packages["unicode"] = (function() { return $pkg; })(); $packages["reflect"] = (function() { - var $pkg = {}, $init, errors, js, math, runtime, strconv, sync, unicode, utf8, uncommonType, funcType, name, nameData, mapIter, Type, Kind, tflag, rtype, typeAlg, method, ChanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, nameOff, typeOff, textOff, StructField, StructTag, fieldScan, Value, flag, ValueError, sliceType$1, ptrType$1, sliceType$2, sliceType$3, ptrType$2, funcType$1, sliceType$4, ptrType$3, ptrType$4, sliceType$5, sliceType$6, sliceType$7, ptrType$5, ptrType$6, structType$3, sliceType$8, sliceType$9, sliceType$10, sliceType$11, ptrType$7, ptrType$8, sliceType$13, sliceType$14, ptrType$9, sliceType$15, ptrType$15, sliceType$17, ptrType$16, funcType$3, funcType$4, funcType$5, ptrType$17, arrayType$12, ptrType$18, initialized, uncommonTypeMap, nameMap, nameOffList, typeOffList, callHelper, jsObjectPtr, selectHelper, kindNames, uint8Type, init, jsType, reflectType, setKindType, newName, newNameOff, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, FuncOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, keyFor, mapaccess, mapassign, mapdelete, mapiterinit, mapiterkey, mapiternext, maplen, cvtDirect, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, methodReceiver, PtrTo, implements$1, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, overflowFloat32, New, convertOp, makeFloat, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I; + var $pkg = {}, $init, errors, js, abi, bytealg, goarch, goexperiment, itoa, unsafeheader, math, runtime, strconv, sync, unicode, utf8, Value, flag, ValueError, MapIter, Type, Kind, tflag, rtype, method, ChanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, nameOff, typeOff, textOff, StructField, StructTag, fieldScan, uncommonType, funcType, name, nameData, hiter, sliceType$1, ptrType$1, sliceType$2, sliceType$3, sliceType$4, ptrType$2, funcType$1, sliceType$6, ptrType$4, sliceType$7, ptrType$7, ptrType$8, sliceType$9, sliceType$10, ptrType$9, sliceType$11, ptrType$10, ptrType$11, sliceType$12, ptrType$12, ptrType$13, funcType$2, sliceType$14, sliceType$15, ptrType$17, structType$3, sliceType$16, ptrType$18, ptrType$19, sliceType$17, sliceType$18, funcType$3, ptrType$22, arrayType$7, ptrType$23, funcType$4, funcType$5, ptrType$25, ptrType$26, uint8Type, kindNames, initialized, nameMap, nameOffList, typeOffList, callHelper, jsObjectPtr, selectHelper, methodName, copyVal, overflowFloat32, convertOp, makeFloat, makeFloat32, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I, PtrTo, PointerTo, implements$1, specialChannelAssignability, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, methodValueCallCodePtr, methodValueCall, init, New, jsType, reflectType, setKindType, newName, newMethodName, resolveReflectName, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, FuncOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, keyFor, mapaccess, mapassign, mapdelete, mapaccess_faststr, mapassign_faststr, mapdelete_faststr, mapiterinit, mapiterkey, mapiterelem, mapiternext, maplen, cvtDirect, cvtSliceArrayPtr, methodReceiver, valueInterface, ifaceE2I, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, methodNameSkip, verifyNotInHeapPtr; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; + abi = $packages["internal/abi"]; + bytealg = $packages["internal/bytealg"]; + goarch = $packages["internal/goarch"]; + goexperiment = $packages["internal/goexperiment"]; + itoa = $packages["internal/itoa"]; + unsafeheader = $packages["internal/unsafeheader"]; math = $packages["math"]; runtime = $packages["runtime"]; strconv = $packages["strconv"]; sync = $packages["sync"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; - uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflect.uncommonType", true, "reflect", false, function(pkgPath_, mcount_, xcount_, moff_, _methods_) { + Value = $pkg.Value = $newType(0, $kindStruct, "reflect.Value", true, "reflect", true, function(typ_, ptr_, flag_) { this.$val = this; if (arguments.length === 0) { - this.pkgPath = 0; - this.mcount = 0; - this.xcount = 0; - this.moff = 0; - this._methods = sliceType$5.nil; + this.typ = ptrType$1.nil; + this.ptr = 0; + this.flag = 0; return; } - this.pkgPath = pkgPath_; - this.mcount = mcount_; - this.xcount = xcount_; - this.moff = moff_; - this._methods = _methods_; + this.typ = typ_; + this.ptr = ptr_; + this.flag = flag_; }); - funcType = $pkg.funcType = $newType(0, $kindStruct, "reflect.funcType", true, "reflect", false, function(rtype_, inCount_, outCount_, _in_, _out_) { + flag = $pkg.flag = $newType(4, $kindUintptr, "reflect.flag", true, "reflect", false, null); + ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflect.ValueError", true, "reflect", true, function(Method_, Kind_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); - this.inCount = 0; - this.outCount = 0; - this._in = sliceType$2.nil; - this._out = sliceType$2.nil; + this.Method = ""; + this.Kind = 0; return; } - this.rtype = rtype_; - this.inCount = inCount_; - this.outCount = outCount_; - this._in = _in_; - this._out = _out_; + this.Method = Method_; + this.Kind = Kind_; }); - name = $pkg.name = $newType(0, $kindStruct, "reflect.name", true, "reflect", false, function(bytes_) { + MapIter = $pkg.MapIter = $newType(0, $kindStruct, "reflect.MapIter", true, "reflect", true, function(m_, hiter_) { this.$val = this; if (arguments.length === 0) { - this.bytes = ptrType$4.nil; + this.m = new Value.ptr(ptrType$1.nil, 0, 0); + this.hiter = new hiter.ptr($ifaceNil, null, null, 0, null); return; } - this.bytes = bytes_; - }); - nameData = $pkg.nameData = $newType(0, $kindStruct, "reflect.nameData", true, "reflect", false, function(name_, tag_, exported_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ""; - this.tag = ""; - this.exported = false; - return; - } - this.name = name_; - this.tag = tag_; - this.exported = exported_; - }); - mapIter = $pkg.mapIter = $newType(0, $kindStruct, "reflect.mapIter", true, "reflect", false, function(t_, m_, keys_, i_) { - this.$val = this; - if (arguments.length === 0) { - this.t = $ifaceNil; - this.m = null; - this.keys = null; - this.i = 0; - return; - } - this.t = t_; this.m = m_; - this.keys = keys_; - this.i = i_; + this.hiter = hiter_; }); Type = $pkg.Type = $newType(8, $kindInterface, "reflect.Type", true, "reflect", true, null); Kind = $pkg.Kind = $newType(4, $kindUint, "reflect.Kind", true, "reflect", true, null); tflag = $pkg.tflag = $newType(1, $kindUint8, "reflect.tflag", true, "reflect", false, null); - rtype = $pkg.rtype = $newType(0, $kindStruct, "reflect.rtype", true, "reflect", false, function(size_, ptrdata_, hash_, tflag_, align_, fieldAlign_, kind_, alg_, gcdata_, str_, ptrToThis_) { + rtype = $pkg.rtype = $newType(0, $kindStruct, "reflect.rtype", true, "reflect", false, function(size_, ptrdata_, hash_, tflag_, align_, fieldAlign_, kind_, equal_, gcdata_, str_, ptrToThis_) { this.$val = this; if (arguments.length === 0) { this.size = 0; @@ -13093,8 +14996,8 @@ $packages["reflect"] = (function() { this.align = 0; this.fieldAlign = 0; this.kind = 0; - this.alg = ptrType$3.nil; - this.gcdata = ptrType$4.nil; + this.equal = $throwNilPointerError; + this.gcdata = ptrType$13.nil; this.str = 0; this.ptrToThis = 0; return; @@ -13106,21 +15009,11 @@ $packages["reflect"] = (function() { this.align = align_; this.fieldAlign = fieldAlign_; this.kind = kind_; - this.alg = alg_; + this.equal = equal_; this.gcdata = gcdata_; this.str = str_; this.ptrToThis = ptrToThis_; }); - typeAlg = $pkg.typeAlg = $newType(0, $kindStruct, "reflect.typeAlg", true, "reflect", false, function(hash_, equal_) { - this.$val = this; - if (arguments.length === 0) { - this.hash = $throwNilPointerError; - this.equal = $throwNilPointerError; - return; - } - this.hash = hash_; - this.equal = equal_; - }); method = $pkg.method = $newType(0, $kindStruct, "reflect.method", true, "reflect", false, function(name_, mtyp_, ifn_, tfn_) { this.$val = this; if (arguments.length === 0) { @@ -13139,7 +15032,7 @@ $packages["reflect"] = (function() { arrayType = $pkg.arrayType = $newType(0, $kindStruct, "reflect.arrayType", true, "reflect", false, function(rtype_, elem_, slice_, len_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); this.elem = ptrType$1.nil; this.slice = ptrType$1.nil; this.len = 0; @@ -13153,7 +15046,7 @@ $packages["reflect"] = (function() { chanType = $pkg.chanType = $newType(0, $kindStruct, "reflect.chanType", true, "reflect", false, function(rtype_, elem_, dir_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); this.elem = ptrType$1.nil; this.dir = 0; return; @@ -13175,47 +15068,43 @@ $packages["reflect"] = (function() { interfaceType = $pkg.interfaceType = $newType(0, $kindStruct, "reflect.interfaceType", true, "reflect", false, function(rtype_, pkgPath_, methods_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); - this.pkgPath = new name.ptr(ptrType$4.nil); - this.methods = sliceType$6.nil; + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); + this.pkgPath = new name.ptr(ptrType$13.nil); + this.methods = sliceType$14.nil; return; } this.rtype = rtype_; this.pkgPath = pkgPath_; this.methods = methods_; }); - mapType = $pkg.mapType = $newType(0, $kindStruct, "reflect.mapType", true, "reflect", false, function(rtype_, key_, elem_, bucket_, keysize_, indirectkey_, valuesize_, indirectvalue_, bucketsize_, reflexivekey_, needkeyupdate_) { + mapType = $pkg.mapType = $newType(0, $kindStruct, "reflect.mapType", true, "reflect", false, function(rtype_, key_, elem_, bucket_, hasher_, keysize_, valuesize_, bucketsize_, flags_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); this.key = ptrType$1.nil; this.elem = ptrType$1.nil; this.bucket = ptrType$1.nil; + this.hasher = $throwNilPointerError; this.keysize = 0; - this.indirectkey = 0; this.valuesize = 0; - this.indirectvalue = 0; this.bucketsize = 0; - this.reflexivekey = false; - this.needkeyupdate = false; + this.flags = 0; return; } this.rtype = rtype_; this.key = key_; this.elem = elem_; this.bucket = bucket_; + this.hasher = hasher_; this.keysize = keysize_; - this.indirectkey = indirectkey_; this.valuesize = valuesize_; - this.indirectvalue = indirectvalue_; this.bucketsize = bucketsize_; - this.reflexivekey = reflexivekey_; - this.needkeyupdate = needkeyupdate_; + this.flags = flags_; }); ptrType = $pkg.ptrType = $newType(0, $kindStruct, "reflect.ptrType", true, "reflect", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); this.elem = ptrType$1.nil; return; } @@ -13225,7 +15114,7 @@ $packages["reflect"] = (function() { sliceType = $pkg.sliceType = $newType(0, $kindStruct, "reflect.sliceType", true, "reflect", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); this.elem = ptrType$1.nil; return; } @@ -13235,7 +15124,7 @@ $packages["reflect"] = (function() { structField = $pkg.structField = $newType(0, $kindStruct, "reflect.structField", true, "reflect", false, function(name_, typ_, offsetEmbed_) { this.$val = this; if (arguments.length === 0) { - this.name = new name.ptr(ptrType$4.nil); + this.name = new name.ptr(ptrType$13.nil); this.typ = ptrType$1.nil; this.offsetEmbed = 0; return; @@ -13247,9 +15136,9 @@ $packages["reflect"] = (function() { structType = $pkg.structType = $newType(0, $kindStruct, "reflect.structType", true, "reflect", false, function(rtype_, pkgPath_, fields_) { this.$val = this; if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); - this.pkgPath = new name.ptr(ptrType$4.nil); - this.fields = sliceType$7.nil; + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); + this.pkgPath = new name.ptr(ptrType$13.nil); + this.fields = sliceType$15.nil; return; } this.rtype = rtype_; @@ -13283,7 +15172,7 @@ $packages["reflect"] = (function() { this.Type = $ifaceNil; this.Tag = ""; this.Offset = 0; - this.Index = sliceType$13.nil; + this.Index = sliceType$6.nil; this.Anonymous = false; return; } @@ -13299,2576 +15188,122 @@ $packages["reflect"] = (function() { fieldScan = $pkg.fieldScan = $newType(0, $kindStruct, "reflect.fieldScan", true, "reflect", false, function(typ_, index_) { this.$val = this; if (arguments.length === 0) { - this.typ = ptrType$9.nil; - this.index = sliceType$13.nil; + this.typ = ptrType$12.nil; + this.index = sliceType$6.nil; return; } this.typ = typ_; this.index = index_; }); - Value = $pkg.Value = $newType(0, $kindStruct, "reflect.Value", true, "reflect", true, function(typ_, ptr_, flag_) { + uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflect.uncommonType", true, "reflect", false, function(pkgPath_, mcount_, xcount_, moff_, _methods_) { this.$val = this; if (arguments.length === 0) { - this.typ = ptrType$1.nil; - this.ptr = 0; - this.flag = 0; + this.pkgPath = 0; + this.mcount = 0; + this.xcount = 0; + this.moff = 0; + this._methods = sliceType$11.nil; return; } - this.typ = typ_; - this.ptr = ptr_; - this.flag = flag_; + this.pkgPath = pkgPath_; + this.mcount = mcount_; + this.xcount = xcount_; + this.moff = moff_; + this._methods = _methods_; }); - flag = $pkg.flag = $newType(4, $kindUintptr, "reflect.flag", true, "reflect", false, null); - ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflect.ValueError", true, "reflect", true, function(Method_, Kind_) { + funcType = $pkg.funcType = $newType(0, $kindStruct, "reflect.funcType", true, "reflect", false, function(rtype_, inCount_, outCount_, _in_, _out_) { this.$val = this; if (arguments.length === 0) { - this.Method = ""; - this.Kind = 0; + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); + this.inCount = 0; + this.outCount = 0; + this._in = sliceType$2.nil; + this._out = sliceType$2.nil; return; } - this.Method = Method_; - this.Kind = Kind_; + this.rtype = rtype_; + this.inCount = inCount_; + this.outCount = outCount_; + this._in = _in_; + this._out = _out_; + }); + name = $pkg.name = $newType(0, $kindStruct, "reflect.name", true, "reflect", false, function(bytes_) { + this.$val = this; + if (arguments.length === 0) { + this.bytes = ptrType$13.nil; + return; + } + this.bytes = bytes_; + }); + nameData = $pkg.nameData = $newType(0, $kindStruct, "reflect.nameData", true, "reflect", false, function(name_, tag_, exported_, pkgPath_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.tag = ""; + this.exported = false; + this.pkgPath = ""; + return; + } + this.name = name_; + this.tag = tag_; + this.exported = exported_; + this.pkgPath = pkgPath_; + }); + hiter = $pkg.hiter = $newType(0, $kindStruct, "reflect.hiter", true, "reflect", false, function(t_, m_, keys_, i_, last_) { + this.$val = this; + if (arguments.length === 0) { + this.t = $ifaceNil; + this.m = null; + this.keys = null; + this.i = 0; + this.last = null; + return; + } + this.t = t_; + this.m = m_; + this.keys = keys_; + this.i = i_; + this.last = last_; }); sliceType$1 = $sliceType(name); ptrType$1 = $ptrType(rtype); sliceType$2 = $sliceType(ptrType$1); - sliceType$3 = $sliceType($emptyInterface); + sliceType$3 = $sliceType($String); + sliceType$4 = $sliceType($emptyInterface); ptrType$2 = $ptrType(js.Object); - funcType$1 = $funcType([sliceType$3], [ptrType$2], true); - sliceType$4 = $sliceType($String); - ptrType$3 = $ptrType(typeAlg); - ptrType$4 = $ptrType($Uint8); - sliceType$5 = $sliceType(method); - sliceType$6 = $sliceType(imethod); - sliceType$7 = $sliceType(structField); - ptrType$5 = $ptrType(uncommonType); - ptrType$6 = $ptrType(nameData); + funcType$1 = $funcType([sliceType$4], [ptrType$2], true); + sliceType$6 = $sliceType($Int); + ptrType$4 = $ptrType(runtime.Func); + sliceType$7 = $sliceType(Value); + ptrType$7 = $ptrType($UnsafePointer); + ptrType$8 = $ptrType(unsafeheader.Slice); + sliceType$9 = $sliceType($Uint8); + sliceType$10 = $sliceType($Int32); + ptrType$9 = $ptrType(uncommonType); + sliceType$11 = $sliceType(method); + ptrType$10 = $ptrType(interfaceType); + ptrType$11 = $ptrType(imethod); + sliceType$12 = $sliceType(fieldScan); + ptrType$12 = $ptrType(structType); + ptrType$13 = $ptrType($Uint8); + funcType$2 = $funcType([], [], false); + sliceType$14 = $sliceType(imethod); + sliceType$15 = $sliceType(structField); + ptrType$17 = $ptrType(nameData); structType$3 = $structType("reflect", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); - sliceType$8 = $sliceType(ptrType$2); - sliceType$9 = $sliceType(Value); - sliceType$10 = $sliceType(Type); - sliceType$11 = $sliceType(sliceType$8); - ptrType$7 = $ptrType(interfaceType); - ptrType$8 = $ptrType(imethod); - sliceType$13 = $sliceType($Int); - sliceType$14 = $sliceType(fieldScan); - ptrType$9 = $ptrType(structType); - sliceType$15 = $sliceType($Uint8); - ptrType$15 = $ptrType($UnsafePointer); - sliceType$17 = $sliceType($Int32); - ptrType$16 = $ptrType(funcType); + sliceType$16 = $sliceType(ptrType$2); + ptrType$18 = $ptrType($String); + ptrType$19 = $ptrType(funcType); + sliceType$17 = $sliceType(Type); + sliceType$18 = $sliceType(sliceType$16); funcType$3 = $funcType([$String], [$Bool], false); - funcType$4 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); - funcType$5 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); - ptrType$17 = $ptrType(structField); - arrayType$12 = $arrayType($Uintptr, 2); - ptrType$18 = $ptrType(ValueError); - init = function() { - var used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; used = $f.used; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - used = (function(i) { - var i; - }); - $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$1 = new uncommonType.ptr(0, 0, 0, 0, sliceType$5.nil), new x$1.constructor.elem(x$1))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$2 = new method.ptr(0, 0, 0, 0), new x$2.constructor.elem(x$2))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$3 = new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, 0), new x$3.constructor.elem(x$3))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$4 = new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil, 0), new x$4.constructor.elem(x$4))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$5 = new funcType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), 0, 0, sliceType$2.nil, sliceType$2.nil), new x$5.constructor.elem(x$5))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$6 = new interfaceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), new name.ptr(ptrType$4.nil), sliceType$6.nil), new x$6.constructor.elem(x$6))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$7 = new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, 0, 0, 0, 0, false, false), new x$7.constructor.elem(x$7))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$8 = new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil), new x$8.constructor.elem(x$8))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$9 = new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil), new x$9.constructor.elem(x$9))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$10 = new structType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), new name.ptr(ptrType$4.nil), sliceType$7.nil), new x$10.constructor.elem(x$10))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$11 = new imethod.ptr(0, 0), new x$11.constructor.elem(x$11))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$12 = new structField.ptr(new name.ptr(ptrType$4.nil), ptrType$1.nil, 0), new x$12.constructor.elem(x$12))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - initialized = true; - uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: init }; } $f.used = used; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; - }; - jsType = function(typ) { - var typ; - return typ.jsType; - }; - reflectType = function(typ) { - var _1, _i, _i$1, _i$2, _i$3, _key, _ref, _ref$1, _ref$2, _ref$3, dir, exported, exported$1, f, fields, i, i$1, i$2, i$3, i$4, i$5, imethods, in$1, m, m$1, m$2, methodSet, methods, offsetEmbed, out, outCount, params, reflectFields, reflectMethods, results, rt, typ, ut, xcount; - if (typ.reflectType === undefined) { - rt = new rtype.ptr(((($parseInt(typ.size) >> 0) >>> 0)), 0, 0, 0, 0, 0, ((($parseInt(typ.kind) >> 0) << 24 >>> 24)), ptrType$3.nil, ptrType$4.nil, newNameOff($clone(newName(internalStr(typ.string), "", !!(typ.exported)), name)), 0); - rt.jsType = typ; - typ.reflectType = rt; - methodSet = $methodSet(typ); - if (!(($parseInt(methodSet.length) === 0)) || !!(typ.named)) { - rt.tflag = (rt.tflag | (1)) >>> 0; - if (!!(typ.named)) { - rt.tflag = (rt.tflag | (4)) >>> 0; - } - reflectMethods = sliceType$5.nil; - i = 0; - while (true) { - if (!(i < $parseInt(methodSet.length))) { break; } - m = methodSet[i]; - exported = internalStr(m.pkg) === ""; - if (!exported) { - i = i + (1) >> 0; - continue; - } - reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m.name), "", exported), name)), newTypeOff(reflectType(m.typ)), 0, 0)); - i = i + (1) >> 0; - } - xcount = ((reflectMethods.$length << 16 >>> 16)); - i$1 = 0; - while (true) { - if (!(i$1 < $parseInt(methodSet.length))) { break; } - m$1 = methodSet[i$1]; - exported$1 = internalStr(m$1.pkg) === ""; - if (exported$1) { - i$1 = i$1 + (1) >> 0; - continue; - } - reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m$1.name), "", exported$1), name)), newTypeOff(reflectType(m$1.typ)), 0, 0)); - i$1 = i$1 + (1) >> 0; - } - ut = new uncommonType.ptr(newNameOff($clone(newName(internalStr(typ.pkg), "", false), name)), (($parseInt(methodSet.length) << 16 >>> 16)), xcount, 0, reflectMethods); - _key = rt; (uncommonTypeMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: ut }; - ut.jsType = typ; - } - _1 = rt.Kind(); - if (_1 === (17)) { - setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem), ptrType$1.nil, ((($parseInt(typ.len) >> 0) >>> 0)))); - } else if (_1 === (18)) { - dir = 3; - if (!!(typ.sendOnly)) { - dir = 2; - } - if (!!(typ.recvOnly)) { - dir = 1; - } - setKindType(rt, new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem), ((dir >>> 0)))); - } else if (_1 === (19)) { - params = typ.params; - in$1 = $makeSlice(sliceType$2, $parseInt(params.length)); - _ref = in$1; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i$2 = _i; - ((i$2 < 0 || i$2 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i$2] = reflectType(params[i$2])); - _i++; - } - results = typ.results; - out = $makeSlice(sliceType$2, $parseInt(results.length)); - _ref$1 = out; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$3 = _i$1; - ((i$3 < 0 || i$3 >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i$3] = reflectType(results[i$3])); - _i$1++; - } - outCount = (($parseInt(results.length) << 16 >>> 16)); - if (!!(typ.variadic)) { - outCount = (outCount | (32768)) >>> 0; - } - setKindType(rt, new funcType.ptr($clone(rt, rtype), (($parseInt(params.length) << 16 >>> 16)), outCount, in$1, out)); - } else if (_1 === (20)) { - methods = typ.methods; - imethods = $makeSlice(sliceType$6, $parseInt(methods.length)); - _ref$2 = imethods; - _i$2 = 0; - while (true) { - if (!(_i$2 < _ref$2.$length)) { break; } - i$4 = _i$2; - m$2 = methods[i$4]; - imethod.copy(((i$4 < 0 || i$4 >= imethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : imethods.$array[imethods.$offset + i$4]), new imethod.ptr(newNameOff($clone(newName(internalStr(m$2.name), "", internalStr(m$2.pkg) === ""), name)), newTypeOff(reflectType(m$2.typ)))); - _i$2++; - } - setKindType(rt, new interfaceType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkg), "", false), name), imethods)); - } else if (_1 === (21)) { - setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, 0, 0, 0, 0, 0, false, false)); - } else if (_1 === (22)) { - setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem))); - } else if (_1 === (23)) { - setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem))); - } else if (_1 === (25)) { - fields = typ.fields; - reflectFields = $makeSlice(sliceType$7, $parseInt(fields.length)); - _ref$3 = reflectFields; - _i$3 = 0; - while (true) { - if (!(_i$3 < _ref$3.$length)) { break; } - i$5 = _i$3; - f = fields[i$5]; - offsetEmbed = ((i$5 >>> 0)) << 1 >>> 0; - if (!!(f.embedded)) { - offsetEmbed = (offsetEmbed | (1)) >>> 0; - } - structField.copy(((i$5 < 0 || i$5 >= reflectFields.$length) ? ($throwRuntimeError("index out of range"), undefined) : reflectFields.$array[reflectFields.$offset + i$5]), new structField.ptr($clone(newName(internalStr(f.name), internalStr(f.tag), !!(f.exported)), name), reflectType(f.typ), offsetEmbed)); - _i$3++; - } - setKindType(rt, new structType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkgPath), "", false), name), reflectFields)); - } - } - return ((typ.reflectType)); - }; - setKindType = function(rt, kindType) { - var kindType, rt; - rt.kindType = kindType; - kindType.rtype = rt; - }; - uncommonType.ptr.prototype.methods = function() { - var t; - t = this; - return t._methods; - }; - uncommonType.prototype.methods = function() { return this.$val.methods(); }; - uncommonType.ptr.prototype.exportedMethods = function() { - var t; - t = this; - return $subslice(t._methods, 0, t.xcount, t.xcount); - }; - uncommonType.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; - rtype.ptr.prototype.uncommon = function() { - var _entry, t; - t = this; - return (_entry = uncommonTypeMap[ptrType$1.keyFor(t)], _entry !== undefined ? _entry.v : ptrType$5.nil); - }; - rtype.prototype.uncommon = function() { return this.$val.uncommon(); }; - funcType.ptr.prototype.in$ = function() { - var t; - t = this; - return t._in; - }; - funcType.prototype.in$ = function() { return this.$val.in$(); }; - funcType.ptr.prototype.out = function() { - var t; - t = this; - return t._out; - }; - funcType.prototype.out = function() { return this.$val.out(); }; - name.ptr.prototype.name = function() { - var _entry, n, s; - s = ""; - n = this; - s = (_entry = nameMap[ptrType$4.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$6.nil).name; - return s; - }; - name.prototype.name = function() { return this.$val.name(); }; - name.ptr.prototype.tag = function() { - var _entry, n, s; - s = ""; - n = this; - s = (_entry = nameMap[ptrType$4.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$6.nil).tag; - return s; - }; - name.prototype.tag = function() { return this.$val.tag(); }; - name.ptr.prototype.pkgPath = function() { - var n; - n = this; - return ""; - }; - name.prototype.pkgPath = function() { return this.$val.pkgPath(); }; - name.ptr.prototype.isExported = function() { - var _entry, n; - n = this; - return (_entry = nameMap[ptrType$4.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$6.nil).exported; - }; - name.prototype.isExported = function() { return this.$val.isExported(); }; - newName = function(n, tag, exported) { - var _key, b, exported, n, tag; - b = $newDataPointer(0, ptrType$4); - _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$4.keyFor(_key)] = { k: _key, v: new nameData.ptr(n, tag, exported) }; - return new name.ptr(b); - }; - rtype.ptr.prototype.nameOff = function(off) { - var off, t, x; - t = this; - return (x = ((off >> 0)), ((x < 0 || x >= nameOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : nameOffList.$array[nameOffList.$offset + x])); - }; - rtype.prototype.nameOff = function(off) { return this.$val.nameOff(off); }; - newNameOff = function(n) { - var i, n; - i = nameOffList.$length; - nameOffList = $append(nameOffList, n); - return ((i >> 0)); - }; - rtype.ptr.prototype.typeOff = function(off) { - var off, t, x; - t = this; - return (x = ((off >> 0)), ((x < 0 || x >= typeOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : typeOffList.$array[typeOffList.$offset + x])); - }; - rtype.prototype.typeOff = function(off) { return this.$val.typeOff(off); }; - newTypeOff = function(t) { - var i, t; - i = typeOffList.$length; - typeOffList = $append(typeOffList, t); - return ((i >> 0)); - }; - internalStr = function(strObj) { - var c, strObj; - c = new structType$3.ptr(""); - c.str = strObj; - return c.str; - }; - isWrapped = function(typ) { - var typ; - return !!(jsType(typ).wrapped); - }; - copyStruct = function(dst, src, typ) { - var dst, fields, i, prop, src, typ; - fields = jsType(typ).fields; - i = 0; - while (true) { - if (!(i < $parseInt(fields.length))) { break; } - prop = $internalize(fields[i].prop, $String); - dst[$externalize(prop, $String)] = src[$externalize(prop, $String)]; - i = i + (1) >> 0; - } - }; - makeValue = function(t, v, fl) { - var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _v = $f._v; _v$1 = $f._v$1; fl = $f.fl; rt = $f.rt; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - rt = _r; - _r$1 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - if (_r$1 === 17) { _v$1 = true; $s = 5; continue s; } - _r$2 = t.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v$1 = _r$2 === 25; case 5: - if (_v$1) { _v = true; $s = 4; continue s; } - _r$3 = t.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _v = _r$3 === 22; case 4: - /* */ if (_v) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (_v) { */ case 2: - _r$4 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - $s = -1; return new Value.ptr(rt, (v), (fl | ((_r$4 >>> 0))) >>> 0); - /* } */ case 3: - _r$5 = t.Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - $s = -1; return new Value.ptr(rt, ($newDataPointer(v, jsType(rt.ptrTo()))), (((fl | ((_r$5 >>> 0))) >>> 0) | 128) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeValue }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._v = _v; $f._v$1 = _v$1; $f.fl = fl; $f.rt = rt; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - MakeSlice = function(typ, len, cap) { - var _r, _r$1, cap, len, typ, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; len = $f.len; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - typ = [typ]; - _r = typ[0].Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 23))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 23))) { */ case 1: - $panic(new $String("reflect.MakeSlice of non-slice type")); - /* } */ case 2: - if (len < 0) { - $panic(new $String("reflect.MakeSlice: negative len")); - } - if (cap < 0) { - $panic(new $String("reflect.MakeSlice: negative cap")); - } - if (len > cap) { - $panic(new $String("reflect.MakeSlice: len > cap")); - } - _r$1 = makeValue(typ[0], $makeSlice(jsType(typ[0]), len, cap, (function(typ) { return function $b() { - var _r$1, _r$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$1 = typ[0].Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = jsType(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $s = -1; return _r$2.zero(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; - }; })(typ)), 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: MakeSlice }; } $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.len = len; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.MakeSlice = MakeSlice; - TypeOf = function(i) { - var i; - if (!initialized) { - return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); - } - if ($interfaceIsEqual(i, $ifaceNil)) { - return $ifaceNil; - } - return reflectType(i.constructor); - }; - $pkg.TypeOf = TypeOf; - ValueOf = function(i) { - var _r, i, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if ($interfaceIsEqual(i, $ifaceNil)) { - $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - } - _r = makeValue(reflectType(i.constructor), i.$val, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: ValueOf }; } $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.ValueOf = ValueOf; - FuncOf = function(in$1, out, variadic) { - var _i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; _v$1 = $f._v$1; i = $f.i; i$1 = $f.i$1; in$1 = $f.in$1; jsIn = $f.jsIn; jsOut = $f.jsOut; out = $f.out; v = $f.v; v$1 = $f.v$1; variadic = $f.variadic; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if (!(variadic)) { _v = false; $s = 3; continue s; } - if (in$1.$length === 0) { _v$1 = true; $s = 4; continue s; } - _r = (x = in$1.$length - 1 >> 0, ((x < 0 || x >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x])).Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v$1 = !((_r === 23)); case 4: - _v = _v$1; case 3: - /* */ if (_v) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_v) { */ case 1: - $panic(new $String("reflect.FuncOf: last arg of variadic func must be slice")); - /* } */ case 2: - jsIn = $makeSlice(sliceType$8, in$1.$length); - _ref = in$1; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - ((i < 0 || i >= jsIn.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsIn.$array[jsIn.$offset + i] = jsType(v)); - _i++; - } - jsOut = $makeSlice(sliceType$8, out.$length); - _ref$1 = out; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - v$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); - ((i$1 < 0 || i$1 >= jsOut.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsOut.$array[jsOut.$offset + i$1] = jsType(v$1)); - _i$1++; - } - $s = -1; return reflectType($funcType($externalize(jsIn, sliceType$8), $externalize(jsOut, sliceType$8), $externalize(variadic, $Bool))); - /* */ } return; } if ($f === undefined) { $f = { $blk: FuncOf }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f._v$1 = _v$1; $f.i = i; $f.i$1 = i$1; $f.in$1 = in$1; $f.jsIn = jsIn; $f.jsOut = jsOut; $f.out = out; $f.v = v; $f.v$1 = v$1; $f.variadic = variadic; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.FuncOf = FuncOf; - rtype.ptr.prototype.ptrTo = function() { - var t; - t = this; - return reflectType($ptrType(jsType(t))); - }; - rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; - SliceOf = function(t) { - var t; - return reflectType($sliceType(jsType(t))); - }; - $pkg.SliceOf = SliceOf; - Zero = function(typ) { - var _r, typ, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = makeValue(typ, jsType(typ).zero(), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Zero }; } $f._r = _r; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Zero = Zero; - unsafe_New = function(typ) { - var _1, typ; - _1 = typ.Kind(); - if (_1 === (25)) { - return (new (jsType(typ).ptr)()); - } else if (_1 === (17)) { - return (jsType(typ).zero()); - } else { - return ($newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo()))); - } - }; - makeInt = function(f, bits, t) { - var _1, _r, bits, f, ptr, t, typ, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; bits = $f.bits; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - typ = _r; - ptr = unsafe_New(typ); - _1 = typ.Kind(); - if (_1 === (3)) { - (ptr).$set(((bits.$low << 24 >> 24))); - } else if (_1 === (4)) { - (ptr).$set(((bits.$low << 16 >> 16))); - } else if ((_1 === (2)) || (_1 === (5))) { - (ptr).$set(((bits.$low >> 0))); - } else if (_1 === (6)) { - (ptr).$set((new $Int64(bits.$high, bits.$low))); - } else if (_1 === (8)) { - (ptr).$set(((bits.$low << 24 >>> 24))); - } else if (_1 === (9)) { - (ptr).$set(((bits.$low << 16 >>> 16))); - } else if ((_1 === (7)) || (_1 === (10)) || (_1 === (12))) { - (ptr).$set(((bits.$low >>> 0))); - } else if (_1 === (11)) { - (ptr).$set((bits)); - } - $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeInt }; } $f._1 = _1; $f._r = _r; $f.bits = bits; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; - }; - typedmemmove = function(t, dst, src) { - var dst, src, t; - dst.$set(src.$get()); - }; - keyFor = function(t, key) { - var k, key, kv, t; - kv = key; - if (!(kv.$get === undefined)) { - kv = kv.$get(); - } - k = $internalize(jsType(t.Key()).keyFor(kv), $String); - return [kv, k]; - }; - mapaccess = function(t, m, key) { - var _tuple, entry, k, key, m, t; - _tuple = keyFor(t, key); - k = _tuple[1]; - entry = m[$externalize(k, $String)]; - if (entry === undefined) { - return 0; - } - return ($newDataPointer(entry.v, jsType(PtrTo(t.Elem())))); - }; - mapassign = function(t, m, key, val) { - var _r, _tuple, entry, et, jsVal, k, key, kv, m, newVal, t, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; entry = $f.entry; et = $f.et; jsVal = $f.jsVal; k = $f.k; key = $f.key; kv = $f.kv; m = $f.m; newVal = $f.newVal; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _tuple = keyFor(t, key); - kv = _tuple[0]; - k = _tuple[1]; - jsVal = val.$get(); - et = t.Elem(); - _r = et.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (_r === 25) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r === 25) { */ case 1: - newVal = jsType(et).zero(); - copyStruct(newVal, jsVal, et); - jsVal = newVal; - /* } */ case 2: - entry = new ($global.Object)(); - entry.k = kv; - entry.v = jsVal; - m[$externalize(k, $String)] = entry; - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: mapassign }; } $f._r = _r; $f._tuple = _tuple; $f.entry = entry; $f.et = et; $f.jsVal = jsVal; $f.k = k; $f.key = key; $f.kv = kv; $f.m = m; $f.newVal = newVal; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - mapdelete = function(t, m, key) { - var _tuple, k, key, m, t; - _tuple = keyFor(t, key); - k = _tuple[1]; - delete m[$externalize(k, $String)]; - }; - mapiterinit = function(t, m) { - var m, t; - return ((new mapIter.ptr(t, m, $keys(m), 0))); - }; - mapiterkey = function(it) { - var _r, _r$1, _r$2, it, iter, k, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; it = $f.it; iter = $f.iter; k = $f.k; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - iter = ((it)); - k = iter.keys[iter.i]; - _r = iter.t.Key(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = PtrTo(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = jsType(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $s = -1; return ($newDataPointer(iter.m[$externalize($internalize(k, $String), $String)].k, _r$2)); - /* */ } return; } if ($f === undefined) { $f = { $blk: mapiterkey }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.it = it; $f.iter = iter; $f.k = k; $f.$s = $s; $f.$r = $r; return $f; - }; - mapiternext = function(it) { - var it, iter; - iter = ((it)); - iter.i = iter.i + (1) >> 0; - }; - maplen = function(m) { - var m; - return $parseInt($keys(m).length); - }; - cvtDirect = function(v, typ) { - var _1, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, k, slice, srcVal, typ, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; k = $f.k; slice = $f.slice; srcVal = $f.srcVal; typ = $f.typ; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - srcVal = $clone(v, Value).object(); - /* */ if (srcVal === jsType(v.typ).nil) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (srcVal === jsType(v.typ).nil) { */ case 1: - _r = makeValue(typ, jsType(typ).nil, v.flag); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } */ case 2: - val = null; - _r$1 = typ.Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - k = _r$1; - _1 = k; - /* */ if (_1 === (23)) { $s = 6; continue; } - /* */ if (_1 === (22)) { $s = 7; continue; } - /* */ if (_1 === (25)) { $s = 8; continue; } - /* */ if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24))) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_1 === (23)) { */ case 6: - slice = new (jsType(typ))(srcVal.$array); - slice.$offset = srcVal.$offset; - slice.$length = srcVal.$length; - slice.$capacity = srcVal.$capacity; - val = $newDataPointer(slice, jsType(PtrTo(typ))); - $s = 11; continue; - /* } else if (_1 === (22)) { */ case 7: - _r$2 = typ.Elem(); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = _r$2.Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (_r$3 === 25) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if (_r$3 === 25) { */ case 12: - _r$4 = typ.Elem(); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ if ($interfaceIsEqual(_r$4, v.typ.Elem())) { $s = 16; continue; } - /* */ $s = 17; continue; - /* if ($interfaceIsEqual(_r$4, v.typ.Elem())) { */ case 16: - val = srcVal; - /* break; */ $s = 4; continue; - /* } */ case 17: - val = new (jsType(typ))(); - _arg = val; - _arg$1 = srcVal; - _r$5 = typ.Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _arg$2 = _r$5; - $r = copyStruct(_arg, _arg$1, _arg$2); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* break; */ $s = 4; continue; - /* } */ case 13: - val = new (jsType(typ))(srcVal.$get, srcVal.$set); - $s = 11; continue; - /* } else if (_1 === (25)) { */ case 8: - val = new (jsType(typ).ptr)(); - copyStruct(val, srcVal, typ); - $s = 11; continue; - /* } else if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24))) { */ case 9: - val = v.ptr; - $s = 11; continue; - /* } else { */ case 10: - $panic(new ValueError.ptr("reflect.Convert", k)); - /* } */ case 11: - case 4: - _r$6 = typ.common(); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$7 = typ.Kind(); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - $s = -1; return new Value.ptr(_r$6, (val), (((new flag(v.flag).ro() | ((v.flag & 128) >>> 0)) >>> 0) | ((_r$7 >>> 0))) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtDirect }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.k = k; $f.slice = slice; $f.srcVal = srcVal; $f.typ = typ; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - valueInterface = function(v, safe) { - var _r, safe, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; safe = $f.safe; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if (v.flag === 0) { - $panic(new ValueError.ptr("reflect.Value.Interface", 0)); - } - if (safe && !((((v.flag & 96) >>> 0) === 0))) { - $panic(new $String("reflect.Value.Interface: cannot return value obtained from unexported field or method")); - } - /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: - _r = makeMethodValue("Interface", $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - v = _r; - /* } */ case 2: - if (isWrapped(v.typ)) { - $s = -1; return ((new (jsType(v.typ))($clone(v, Value).object()))); - } - $s = -1; return (($clone(v, Value).object())); - /* */ } return; } if ($f === undefined) { $f = { $blk: valueInterface }; } $f._r = _r; $f.safe = safe; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - ifaceE2I = function(t, src, dst) { - var dst, src, t; - dst.$set(src); - }; - methodName = function() { - return "?FIXME?"; - }; - makeMethodValue = function(op, v) { - var _r, _tuple, fn, fv, op, rcvr, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; fn = $f.fn; fv = $f.fv; op = $f.op; rcvr = $f.rcvr; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fn = [fn]; - rcvr = [rcvr]; - if (((v.flag & 512) >>> 0) === 0) { - $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); - } - _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); - fn[0] = _tuple[2]; - rcvr[0] = $clone(v, Value).object(); - if (isWrapped(v.typ)) { - rcvr[0] = new (jsType(v.typ))(rcvr[0]); - } - fv = js.MakeFunc((function(fn, rcvr) { return function(this$1, arguments$1) { - var arguments$1, this$1; - return new $jsObjectPtr(fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$8))); - }; })(fn, rcvr)); - _r = $clone(v, Value).Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return new Value.ptr(_r, (fv), (new flag(v.flag).ro() | 19) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeMethodValue }; } $f._r = _r; $f._tuple = _tuple; $f.fn = fn; $f.fv = fv; $f.op = op; $f.rcvr = rcvr; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.ptr.prototype.pointers = function() { - var _1, t; - t = this; - _1 = t.Kind(); - if ((_1 === (22)) || (_1 === (21)) || (_1 === (18)) || (_1 === (19)) || (_1 === (25)) || (_1 === (17))) { - return true; - } else { - return false; - } - }; - rtype.prototype.pointers = function() { return this.$val.pointers(); }; - rtype.ptr.prototype.Comparable = function() { - var _1, _r, _r$1, i, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; i = $f.i; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - _1 = t.Kind(); - /* */ if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { $s = 2; continue; } - /* */ if (_1 === (17)) { $s = 3; continue; } - /* */ if (_1 === (25)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { */ case 2: - $s = -1; return false; - /* } else if (_1 === (17)) { */ case 3: - _r = t.Elem().Comparable(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } else if (_1 === (25)) { */ case 4: - i = 0; - /* while (true) { */ case 7: - /* if (!(i < t.NumField())) { break; } */ if(!(i < t.NumField())) { $s = 8; continue; } - _r$1 = t.Field(i).Type.Comparable(); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (!_r$1) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (!_r$1) { */ case 9: - $s = -1; return false; - /* } */ case 10: - i = i + (1) >> 0; - /* } */ $s = 7; continue; case 8: - /* } */ case 5: - case 1: - $s = -1; return true; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Comparable }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; - rtype.ptr.prototype.Method = function(i) { - var _i, _i$1, _r, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; arg = $f.arg; fl = $f.fl; fn = $f.fn; ft = $f.ft; i = $f.i; in$1 = $f.in$1; m = $f.m; methods = $f.methods; mt = $f.mt; mtyp = $f.mtyp; out = $f.out; p = $f.p; pname = $f.pname; prop = $f.prop; ret = $f.ret; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - prop = [prop]; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - t = this; - if (t.Kind() === 20) { - tt = (t.kindType); - Method.copy(m, tt.Method(i)); - $s = -1; return m; - } - methods = t.exportedMethods(); - if (i < 0 || i >= methods.$length) { - $panic(new $String("reflect: Method index out of range")); - } - p = $clone(((i < 0 || i >= methods.$length) ? ($throwRuntimeError("index out of range"), undefined) : methods.$array[methods.$offset + i]), method); - pname = $clone(t.nameOff(p.name), name); - m.Name = $clone(pname, name).name(); - fl = 19; - mtyp = t.typeOff(p.mtyp); - ft = (mtyp.kindType); - in$1 = $makeSlice(sliceType$10, 0, (1 + ft.in$().$length >> 0)); - in$1 = $append(in$1, t); - _ref = ft.in$(); - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - in$1 = $append(in$1, arg); - _i++; - } - out = $makeSlice(sliceType$10, 0, ft.out().$length); - _ref$1 = ft.out(); - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - ret = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); - out = $append(out, ret); - _i$1++; - } - _r = FuncOf(in$1, out, ft.rtype.IsVariadic()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - mt = _r; - m.Type = mt; - prop[0] = $internalize($methodSet(t.jsType)[i].prop, $String); - fn = js.MakeFunc((function(prop) { return function(this$1, arguments$1) { - var arguments$1, rcvr, this$1; - rcvr = (0 >= arguments$1.$length ? ($throwRuntimeError("index out of range"), undefined) : arguments$1.$array[arguments$1.$offset + 0]); - return new $jsObjectPtr(rcvr[$externalize(prop[0], $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$8))); - }; })(prop)); - m.Func = new Value.ptr($assertType(mt, ptrType$1), (fn), fl); - m.Index = i; - Method.copy(m, m); - $s = -1; return m; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Method }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.arg = arg; $f.fl = fl; $f.fn = fn; $f.ft = ft; $f.i = i; $f.in$1 = in$1; $f.m = m; $f.methods = methods; $f.mt = mt; $f.mtyp = mtyp; $f.out = out; $f.p = p; $f.pname = pname; $f.prop = prop; $f.ret = ret; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.Method = function(i) { return this.$val.Method(i); }; - Value.ptr.prototype.object = function() { - var _1, newVal, v, val; - v = this; - if ((v.typ.Kind() === 17) || (v.typ.Kind() === 25)) { - return v.ptr; - } - if (!((((v.flag & 128) >>> 0) === 0))) { - val = v.ptr.$get(); - if (!(val === $ifaceNil) && !(val.constructor === jsType(v.typ))) { - switch (0) { default: - _1 = v.typ.Kind(); - if ((_1 === (11)) || (_1 === (6))) { - val = new (jsType(v.typ))(val.$high, val.$low); - } else if ((_1 === (15)) || (_1 === (16))) { - val = new (jsType(v.typ))(val.$real, val.$imag); - } else if (_1 === (23)) { - if (val === val.constructor.nil) { - val = jsType(v.typ).nil; - break; - } - newVal = new (jsType(v.typ))(val.$array); - newVal.$offset = val.$offset; - newVal.$length = val.$length; - newVal.$capacity = val.$capacity; - val = newVal; - } - } - } - return val; - } - return v.ptr; - }; - Value.prototype.object = function() { return this.$val.object(); }; - Value.ptr.prototype.assignTo = function(context, dst, target) { - var _r, _r$1, _r$2, context, dst, fl, target, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; context = $f.context; dst = $f.dst; fl = $f.fl; target = $f.target; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: - _r = makeMethodValue(context, $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - v = _r; - /* } */ case 2: - _r$1 = directlyAssignable(dst, v.typ); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (_r$1) { $s = 5; continue; } - /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (_r$1) { */ case 5: - fl = (((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0; - fl = (fl | (((dst.Kind() >>> 0)))) >>> 0; - $s = -1; return new Value.ptr(dst, v.ptr, fl); - /* } else if (implements$1(dst, v.typ)) { */ case 6: - if (target === 0) { - target = unsafe_New(dst); - } - _r$2 = valueInterface($clone(v, Value), false); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - x = _r$2; - if (dst.NumMethod() === 0) { - (target).$set(x); - } else { - ifaceE2I(dst, x, target); - } - $s = -1; return new Value.ptr(dst, target, 148); - /* } */ case 7: - case 4: - $panic(new $String(context + ": value of type " + v.typ.String() + " is not assignable to type " + dst.String())); - $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.assignTo }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.context = context; $f.dst = dst; $f.fl = fl; $f.target = target; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.assignTo = function(context, dst, target) { return this.$val.assignTo(context, dst, target); }; - Value.ptr.prototype.Cap = function() { - var _1, k, v; - v = this; - k = new flag(v.flag).kind(); - _1 = k; - if (_1 === (17)) { - return v.typ.Len(); - } else if ((_1 === (18)) || (_1 === (23))) { - return $parseInt($clone(v, Value).object().$capacity) >> 0; - } - $panic(new ValueError.ptr("reflect.Value.Cap", k)); - }; - Value.prototype.Cap = function() { return this.$val.Cap(); }; - wrapJsObject = function(typ, val) { - var typ, val; - if ($interfaceIsEqual(typ, jsObjectPtr)) { - return new (jsType(jsObjectPtr))(val); - } - return val; - }; - unwrapJsObject = function(typ, val) { - var typ, val; - if ($interfaceIsEqual(typ, jsObjectPtr)) { - return val.object; - } - return val; - }; - Value.ptr.prototype.Elem = function() { - var _1, _r, fl, k, tt, typ, v, val, val$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; fl = $f.fl; k = $f.k; tt = $f.tt; typ = $f.typ; v = $f.v; val = $f.val; val$1 = $f.val$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - k = new flag(v.flag).kind(); - _1 = k; - /* */ if (_1 === (20)) { $s = 2; continue; } - /* */ if (_1 === (22)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (_1 === (20)) { */ case 2: - val = $clone(v, Value).object(); - if (val === $ifaceNil) { - $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - } - typ = reflectType(val.constructor); - _r = makeValue(typ, val.$val, new flag(v.flag).ro()); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } else if (_1 === (22)) { */ case 3: - if ($clone(v, Value).IsNil()) { - $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - } - val$1 = $clone(v, Value).object(); - tt = (v.typ.kindType); - fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; - fl = (fl | (((tt.elem.Kind() >>> 0)))) >>> 0; - $s = -1; return new Value.ptr(tt.elem, (wrapJsObject(tt.elem, val$1)), fl); - /* } else { */ case 4: - $panic(new ValueError.ptr("reflect.Value.Elem", k)); - /* } */ case 5: - case 1: - $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Elem }; } $f._1 = _1; $f._r = _r; $f.fl = fl; $f.k = k; $f.tt = tt; $f.typ = typ; $f.v = v; $f.val = val; $f.val$1 = val$1; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Elem = function() { return this.$val.Elem(); }; - Value.ptr.prototype.Field = function(i) { - var _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; field = $f.field; fl = $f.fl; i = $f.i; jsTag = $f.jsTag; o = $f.o; prop = $f.prop; s = $f.s; tag = $f.tag; tt = $f.tt; typ = $f.typ; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - jsTag = [jsTag]; - prop = [prop]; - s = [s]; - typ = [typ]; - v = this; - if (!((new flag(v.flag).kind() === 25))) { - $panic(new ValueError.ptr("reflect.Value.Field", new flag(v.flag).kind())); - } - tt = (v.typ.kindType); - if (((i >>> 0)) >= ((tt.fields.$length >>> 0))) { - $panic(new $String("reflect: Field index out of range")); - } - prop[0] = $internalize(jsType(v.typ).fields[i].prop, $String); - field = (x = tt.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - typ[0] = field.typ; - fl = (((v.flag & 416) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; - if (!$clone(field.name, name).isExported()) { - if (field.embedded()) { - fl = (fl | (64)) >>> 0; - } else { - fl = (fl | (32)) >>> 0; - } - } - tag = $clone((x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).name, name).tag(); - /* */ if (!(tag === "") && !((i === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!(tag === "") && !((i === 0))) { */ case 1: - jsTag[0] = getJsTag(tag); - /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!(jsTag[0] === "")) { */ case 3: - /* while (true) { */ case 5: - o = [o]; - _r = $clone(v, Value).Field(0); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - v = _r; - /* */ if (v.typ === jsObjectPtr) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (v.typ === jsObjectPtr) { */ case 8: - o[0] = $clone(v, Value).object().object; - $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { - return $internalize(o[0][$externalize(jsTag[0], $String)], jsType(typ[0])); - }; })(jsTag, o, prop, s, typ), (function(jsTag, o, prop, s, typ) { return function(x$2) { - var x$2; - o[0][$externalize(jsTag[0], $String)] = $externalize(x$2, jsType(typ[0])); - }; })(jsTag, o, prop, s, typ))), fl); - /* } */ case 9: - /* */ if (v.typ.Kind() === 22) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (v.typ.Kind() === 22) { */ case 10: - _r$1 = $clone(v, Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - v = _r$1; - /* } */ case 11: - /* } */ $s = 5; continue; case 6: - /* } */ case 4: - /* } */ case 2: - s[0] = v.ptr; - /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 13: - $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { - return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); - }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { - var x$2; - s[0][$externalize(prop[0], $String)] = unwrapJsObject(typ[0], x$2); - }; })(jsTag, prop, s, typ))), fl); - /* } */ case 14: - _r$2 = makeValue(typ[0], wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]), fl); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $s = -1; return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Field }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.field = field; $f.fl = fl; $f.i = i; $f.jsTag = jsTag; $f.o = o; $f.prop = prop; $f.s = s; $f.tag = tag; $f.tt = tt; $f.typ = typ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Field = function(i) { return this.$val.Field(i); }; - getJsTag = function(tag) { - var _tuple, i, name$1, qvalue, tag, value; - while (true) { - if (!(!(tag === ""))) { break; } - i = 0; - while (true) { - if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } - i = i + (1) >> 0; - } - tag = $substring(tag, i); - if (tag === "") { - break; - } - i = 0; - while (true) { - if (!(i < tag.length && !((tag.charCodeAt(i) === 32)) && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)))) { break; } - i = i + (1) >> 0; - } - if ((i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { - break; - } - name$1 = ($substring(tag, 0, i)); - tag = $substring(tag, (i + 1 >> 0)); - i = 1; - while (true) { - if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } - if (tag.charCodeAt(i) === 92) { - i = i + (1) >> 0; - } - i = i + (1) >> 0; - } - if (i >= tag.length) { - break; - } - qvalue = ($substring(tag, 0, (i + 1 >> 0))); - tag = $substring(tag, (i + 1 >> 0)); - if (name$1 === "js") { - _tuple = strconv.Unquote(qvalue); - value = _tuple[0]; - return value; - } - } - return ""; - }; - Value.ptr.prototype.Index = function(i) { - var _1, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; a = $f.a; a$1 = $f.a$1; c = $f.c; fl = $f.fl; fl$1 = $f.fl$1; fl$2 = $f.fl$2; i = $f.i; k = $f.k; s = $f.s; str = $f.str; tt = $f.tt; tt$1 = $f.tt$1; typ = $f.typ; typ$1 = $f.typ$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - a = [a]; - a$1 = [a$1]; - c = [c]; - i = [i]; - typ = [typ]; - typ$1 = [typ$1]; - v = this; - k = new flag(v.flag).kind(); - _1 = k; - /* */ if (_1 === (17)) { $s = 2; continue; } - /* */ if (_1 === (23)) { $s = 3; continue; } - /* */ if (_1 === (24)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_1 === (17)) { */ case 2: - tt = (v.typ.kindType); - if (i[0] < 0 || i[0] > ((tt.len >> 0))) { - $panic(new $String("reflect: array index out of range")); - } - typ[0] = tt.elem; - fl = (((((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; - a[0] = v.ptr; - /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 7: - $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { - return wrapJsObject(typ[0], a[0][i[0]]); - }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { - var x; - a[0][i[0]] = unwrapJsObject(typ[0], x); - }; })(a, a$1, c, i, typ, typ$1))), fl); - /* } */ case 8: - _r = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } else if (_1 === (23)) { */ case 3: - s = $clone(v, Value).object(); - if (i[0] < 0 || i[0] >= ($parseInt(s.$length) >> 0)) { - $panic(new $String("reflect: slice index out of range")); - } - tt$1 = (v.typ.kindType); - typ$1[0] = tt$1.elem; - fl$1 = (((384 | new flag(v.flag).ro()) >>> 0) | ((typ$1[0].Kind() >>> 0))) >>> 0; - i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; - a$1[0] = s.$array; - /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 10: - $s = -1; return new Value.ptr(typ$1[0], (new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { - return wrapJsObject(typ$1[0], a$1[0][i[0]]); - }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { - var x; - a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); - }; })(a, a$1, c, i, typ, typ$1))), fl$1); - /* } */ case 11: - _r$1 = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[0][i[0]]), fl$1); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* } else if (_1 === (24)) { */ case 4: - str = (v.ptr).$get(); - if (i[0] < 0 || i[0] >= str.length) { - $panic(new $String("reflect: string index out of range")); - } - fl$2 = (((new flag(v.flag).ro() | 8) >>> 0) | 128) >>> 0; - c[0] = str.charCodeAt(i[0]); - $s = -1; return new Value.ptr(uint8Type, ((c.$ptr || (c.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))), fl$2); - /* } else { */ case 5: - $panic(new ValueError.ptr("reflect.Value.Index", k)); - /* } */ case 6: - case 1: - $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Index }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.a$1 = a$1; $f.c = c; $f.fl = fl; $f.fl$1 = fl$1; $f.fl$2 = fl$2; $f.i = i; $f.k = k; $f.s = s; $f.str = str; $f.tt = tt; $f.tt$1 = tt$1; $f.typ = typ; $f.typ$1 = typ$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Index = function(i) { return this.$val.Index(i); }; - Value.ptr.prototype.InterfaceData = function() { - var v; - v = this; - $panic(errors.New("InterfaceData is not supported by GopherJS")); - }; - Value.prototype.InterfaceData = function() { return this.$val.InterfaceData(); }; - Value.ptr.prototype.IsNil = function() { - var _1, k, v; - v = this; - k = new flag(v.flag).kind(); - _1 = k; - if ((_1 === (22)) || (_1 === (23))) { - return $clone(v, Value).object() === jsType(v.typ).nil; - } else if (_1 === (18)) { - return $clone(v, Value).object() === $chanNil; - } else if (_1 === (19)) { - return $clone(v, Value).object() === $throwNilPointerError; - } else if (_1 === (21)) { - return $clone(v, Value).object() === false; - } else if (_1 === (20)) { - return $clone(v, Value).object() === $ifaceNil; - } else { - $panic(new ValueError.ptr("reflect.Value.IsNil", k)); - } - }; - Value.prototype.IsNil = function() { return this.$val.IsNil(); }; - Value.ptr.prototype.Len = function() { - var _1, k, v; - v = this; - k = new flag(v.flag).kind(); - _1 = k; - if ((_1 === (17)) || (_1 === (24))) { - return $parseInt($clone(v, Value).object().length); - } else if (_1 === (23)) { - return $parseInt($clone(v, Value).object().$length) >> 0; - } else if (_1 === (18)) { - return $parseInt($clone(v, Value).object().$buffer.length) >> 0; - } else if (_1 === (21)) { - return $parseInt($keys($clone(v, Value).object()).length); - } else { - $panic(new ValueError.ptr("reflect.Value.Len", k)); - } - }; - Value.prototype.Len = function() { return this.$val.Len(); }; - Value.ptr.prototype.Pointer = function() { - var _1, k, v; - v = this; - k = new flag(v.flag).kind(); - _1 = k; - if ((_1 === (18)) || (_1 === (21)) || (_1 === (22)) || (_1 === (26))) { - if ($clone(v, Value).IsNil()) { - return 0; - } - return $clone(v, Value).object(); - } else if (_1 === (19)) { - if ($clone(v, Value).IsNil()) { - return 0; - } - return 1; - } else if (_1 === (23)) { - if ($clone(v, Value).IsNil()) { - return 0; - } - return $clone(v, Value).object().$array; - } else { - $panic(new ValueError.ptr("reflect.Value.Pointer", k)); - } - }; - Value.prototype.Pointer = function() { return this.$val.Pointer(); }; - Value.ptr.prototype.Set = function(x) { - var _1, _r, _r$1, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(x.flag).mustBeExported(); - _r = $clone(x, Value).assignTo("reflect.Set", v.typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - x = _r; - /* */ if (!((((v.flag & 128) >>> 0) === 0))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((((v.flag & 128) >>> 0) === 0))) { */ case 2: - _1 = v.typ.Kind(); - /* */ if (_1 === (17)) { $s = 5; continue; } - /* */ if (_1 === (20)) { $s = 6; continue; } - /* */ if (_1 === (25)) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (_1 === (17)) { */ case 5: - jsType(v.typ).copy(v.ptr, x.ptr); - $s = 9; continue; - /* } else if (_1 === (20)) { */ case 6: - _r$1 = valueInterface($clone(x, Value), false); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - v.ptr.$set(_r$1); - $s = 9; continue; - /* } else if (_1 === (25)) { */ case 7: - copyStruct(v.ptr, x.ptr, v.typ); - $s = 9; continue; - /* } else { */ case 8: - v.ptr.$set($clone(x, Value).object()); - /* } */ case 9: - case 4: - $s = -1; return; - /* } */ case 3: - v.ptr = x.ptr; - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Set }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Set = function(x) { return this.$val.Set(x); }; - Value.ptr.prototype.SetBytes = function(x) { - var _r, _r$1, _v, slice, typedSlice, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; slice = $f.slice; typedSlice = $f.typedSlice; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(23); - _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 8))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 8))) { */ case 1: - $panic(new $String("reflect.Value.SetBytes of non-byte slice")); - /* } */ case 2: - slice = x; - if (!(v.typ.Name() === "")) { _v = true; $s = 6; continue s; } - _r$1 = v.typ.Elem().Name(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _v = !(_r$1 === ""); case 6: - /* */ if (_v) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_v) { */ case 4: - typedSlice = new (jsType(v.typ))(slice.$array); - typedSlice.$offset = slice.$offset; - typedSlice.$length = slice.$length; - typedSlice.$capacity = slice.$capacity; - slice = typedSlice; - /* } */ case 5: - v.ptr.$set(slice); - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetBytes }; } $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.slice = slice; $f.typedSlice = typedSlice; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; - Value.ptr.prototype.SetCap = function(n) { - var n, newSlice, s, v; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(23); - s = v.ptr.$get(); - if (n < ($parseInt(s.$length) >> 0) || n > ($parseInt(s.$capacity) >> 0)) { - $panic(new $String("reflect: slice capacity out of range in SetCap")); - } - newSlice = new (jsType(v.typ))(s.$array); - newSlice.$offset = s.$offset; - newSlice.$length = s.$length; - newSlice.$capacity = n; - v.ptr.$set(newSlice); - }; - Value.prototype.SetCap = function(n) { return this.$val.SetCap(n); }; - Value.ptr.prototype.SetLen = function(n) { - var n, newSlice, s, v; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(23); - s = v.ptr.$get(); - if (n < 0 || n > ($parseInt(s.$capacity) >> 0)) { - $panic(new $String("reflect: slice length out of range in SetLen")); - } - newSlice = new (jsType(v.typ))(s.$array); - newSlice.$offset = s.$offset; - newSlice.$length = n; - newSlice.$capacity = s.$capacity; - v.ptr.$set(newSlice); - }; - Value.prototype.SetLen = function(n) { return this.$val.SetLen(n); }; - Value.ptr.prototype.Slice = function(i, j) { - var _1, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; i = $f.i; j = $f.j; kind = $f.kind; s = $f.s; str = $f.str; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - cap = 0; - typ = $ifaceNil; - s = null; - kind = new flag(v.flag).kind(); - _1 = kind; - /* */ if (_1 === (17)) { $s = 2; continue; } - /* */ if (_1 === (23)) { $s = 3; continue; } - /* */ if (_1 === (24)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_1 === (17)) { */ case 2: - if (((v.flag & 256) >>> 0) === 0) { - $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); - } - tt = (v.typ.kindType); - cap = ((tt.len >> 0)); - typ = SliceOf(tt.elem); - s = new (jsType(typ))($clone(v, Value).object()); - $s = 6; continue; - /* } else if (_1 === (23)) { */ case 3: - typ = v.typ; - s = $clone(v, Value).object(); - cap = $parseInt(s.$capacity) >> 0; - $s = 6; continue; - /* } else if (_1 === (24)) { */ case 4: - str = (v.ptr).$get(); - if (i < 0 || j < i || j > str.length) { - $panic(new $String("reflect.Value.Slice: string slice index out of bounds")); - } - _r = ValueOf(new $String($substring(str, i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } else { */ case 5: - $panic(new ValueError.ptr("reflect.Value.Slice", kind)); - /* } */ case 6: - case 1: - if (i < 0 || j < i || j > cap) { - $panic(new $String("reflect.Value.Slice: slice index out of bounds")); - } - _r$1 = makeValue(typ, $subslice(s, i, j), new flag(v.flag).ro()); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.i = i; $f.j = j; $f.kind = kind; $f.s = s; $f.str = str; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Slice = function(i, j) { return this.$val.Slice(i, j); }; - Value.ptr.prototype.Slice3 = function(i, j, k) { - var _1, _r, cap, i, j, k, kind, s, tt, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; cap = $f.cap; i = $f.i; j = $f.j; k = $f.k; kind = $f.kind; s = $f.s; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - cap = 0; - typ = $ifaceNil; - s = null; - kind = new flag(v.flag).kind(); - _1 = kind; - if (_1 === (17)) { - if (((v.flag & 256) >>> 0) === 0) { - $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); - } - tt = (v.typ.kindType); - cap = ((tt.len >> 0)); - typ = SliceOf(tt.elem); - s = new (jsType(typ))($clone(v, Value).object()); - } else if (_1 === (23)) { - typ = v.typ; - s = $clone(v, Value).object(); - cap = $parseInt(s.$capacity) >> 0; - } else { - $panic(new ValueError.ptr("reflect.Value.Slice3", kind)); - } - if (i < 0 || j < i || k < j || k > cap) { - $panic(new $String("reflect.Value.Slice3: slice index out of bounds")); - } - _r = makeValue(typ, $subslice(s, i, j, k), new flag(v.flag).ro()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice3 }; } $f._1 = _1; $f._r = _r; $f.cap = cap; $f.i = i; $f.j = j; $f.k = k; $f.kind = kind; $f.s = s; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Slice3 = function(i, j, k) { return this.$val.Slice3(i, j, k); }; - Value.ptr.prototype.Close = function() { - var v; - v = this; - new flag(v.flag).mustBe(18); - new flag(v.flag).mustBeExported(); - $close($clone(v, Value).object()); - }; - Value.prototype.Close = function() { return this.$val.Close(); }; - chanrecv = function(ch, nb, val) { - var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, ch, comms, nb, received, recvRes, selectRes, selected, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; ch = $f.ch; comms = $f.comms; nb = $f.nb; received = $f.received; recvRes = $f.recvRes; selectRes = $f.selectRes; selected = $f.selected; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - selected = false; - received = false; - comms = new sliceType$11([new sliceType$8([ch])]); - if (nb) { - comms = $append(comms, new sliceType$8([])); - } - _r = selectHelper(new sliceType$3([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - selectRes = _r; - if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { - _tmp = false; - _tmp$1 = false; - selected = _tmp; - received = _tmp$1; - $s = -1; return [selected, received]; - } - recvRes = selectRes[1]; - val.$set(recvRes[0]); - _tmp$2 = true; - _tmp$3 = !!(recvRes[1]); - selected = _tmp$2; - received = _tmp$3; - $s = -1; return [selected, received]; - /* */ } return; } if ($f === undefined) { $f = { $blk: chanrecv }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.received = received; $f.recvRes = recvRes; $f.selectRes = selectRes; $f.selected = selected; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - chansend = function(ch, val, nb) { - var _r, ch, comms, nb, selectRes, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ch = $f.ch; comms = $f.comms; nb = $f.nb; selectRes = $f.selectRes; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - comms = new sliceType$11([new sliceType$8([ch, val.$get()])]); - if (nb) { - comms = $append(comms, new sliceType$8([])); - } - _r = selectHelper(new sliceType$3([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - selectRes = _r; - if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { - $s = -1; return false; - } - $s = -1; return true; - /* */ } return; } if ($f === undefined) { $f = { $blk: chansend }; } $f._r = _r; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.selectRes = selectRes; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - methodReceiver = function(op, v, i) { - var _$38, fn, i, m, m$1, ms, op, prop, rcvr, t, tt, v, x; - _$38 = ptrType$1.nil; - t = ptrType$1.nil; - fn = 0; - prop = ""; - if (v.typ.Kind() === 20) { - tt = (v.typ.kindType); - if (i < 0 || i >= tt.methods.$length) { - $panic(new $String("reflect: internal error: invalid method index")); - } - m = (x = tt.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - if (!$clone(tt.rtype.nameOff(m.name), name).isExported()) { - $panic(new $String("reflect: " + op + " of unexported method")); - } - t = tt.rtype.typeOff(m.typ); - prop = $clone(tt.rtype.nameOff(m.name), name).name(); - } else { - ms = v.typ.exportedMethods(); - if (((i >>> 0)) >= ((ms.$length >>> 0))) { - $panic(new $String("reflect: internal error: invalid method index")); - } - m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); - if (!$clone(v.typ.nameOff(m$1.name), name).isExported()) { - $panic(new $String("reflect: " + op + " of unexported method")); - } - t = v.typ.typeOff(m$1.mtyp); - prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); - } - rcvr = $clone(v, Value).object(); - if (isWrapped(v.typ)) { - rcvr = new (jsType(v.typ))(rcvr); - } - fn = (rcvr[$externalize(prop, $String)]); - return [_$38, t, fn]; - }; - Value.ptr.prototype.call = function(op, in$1) { - var _1, _arg, _arg$1, _arg$2, _arg$3, _i, _i$1, _i$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, arg, argsArray, elem, fn, i, i$1, i$2, i$3, in$1, isSlice, m, n, nin, nout, op, origIn, rcvr, results, ret, slice, t, targ, v, x, x$1, x$2, xt, xt$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; arg = $f.arg; argsArray = $f.argsArray; elem = $f.elem; fn = $f.fn; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; in$1 = $f.in$1; isSlice = $f.isSlice; m = $f.m; n = $f.n; nin = $f.nin; nout = $f.nout; op = $f.op; origIn = $f.origIn; rcvr = $f.rcvr; results = $f.results; ret = $f.ret; slice = $f.slice; t = $f.t; targ = $f.targ; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; xt = $f.xt; xt$1 = $f.xt$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - t = ptrType$1.nil; - fn = 0; - rcvr = null; - if (!((((v.flag & 512) >>> 0) === 0))) { - _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); - t = _tuple[1]; - fn = _tuple[2]; - rcvr = $clone(v, Value).object(); - if (isWrapped(v.typ)) { - rcvr = new (jsType(v.typ))(rcvr); - } - } else { - t = v.typ; - fn = ($clone(v, Value).object()); - rcvr = undefined; - } - if (fn === 0) { - $panic(new $String("reflect.Value.Call: call of nil function")); - } - isSlice = op === "CallSlice"; - n = t.NumIn(); - if (isSlice) { - if (!t.IsVariadic()) { - $panic(new $String("reflect: CallSlice of non-variadic function")); - } - if (in$1.$length < n) { - $panic(new $String("reflect: CallSlice with too few input arguments")); - } - if (in$1.$length > n) { - $panic(new $String("reflect: CallSlice with too many input arguments")); - } - } else { - if (t.IsVariadic()) { - n = n - (1) >> 0; - } - if (in$1.$length < n) { - $panic(new $String("reflect: Call with too few input arguments")); - } - if (!t.IsVariadic() && in$1.$length > n) { - $panic(new $String("reflect: Call with too many input arguments")); - } - } - _ref = in$1; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - if ($clone(x, Value).Kind() === 0) { - $panic(new $String("reflect: " + op + " using zero Value argument")); - } - _i++; - } - i = 0; - /* while (true) { */ case 1: - /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } - _tmp = $clone(((i < 0 || i >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i]), Value).Type(); - _tmp$1 = t.In(i); - xt = _tmp; - targ = _tmp$1; - _r = xt.AssignableTo(targ); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!_r) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!_r) { */ case 3: - _r$1 = xt.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = targ.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $panic(new $String("reflect: " + op + " using " + _r$1 + " as type " + _r$2)); - /* } */ case 4: - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - /* */ if (!isSlice && t.IsVariadic()) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (!isSlice && t.IsVariadic()) { */ case 8: - m = in$1.$length - n >> 0; - _r$3 = MakeSlice(t.In(n), m, m); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - slice = _r$3; - _r$4 = t.In(n).Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - elem = _r$4; - i$1 = 0; - /* while (true) { */ case 12: - /* if (!(i$1 < m)) { break; } */ if(!(i$1 < m)) { $s = 13; continue; } - x$2 = (x$1 = n + i$1 >> 0, ((x$1 < 0 || x$1 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x$1])); - xt$1 = $clone(x$2, Value).Type(); - _r$5 = xt$1.AssignableTo(elem); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - /* */ if (!_r$5) { $s = 14; continue; } - /* */ $s = 15; continue; - /* if (!_r$5) { */ case 14: - _r$6 = xt$1.String(); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$7 = elem.String(); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - $panic(new $String("reflect: cannot use " + _r$6 + " as type " + _r$7 + " in " + op)); - /* } */ case 15: - _r$8 = $clone(slice, Value).Index(i$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - $r = $clone(_r$8, Value).Set($clone(x$2, Value)); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - i$1 = i$1 + (1) >> 0; - /* } */ $s = 12; continue; case 13: - origIn = in$1; - in$1 = $makeSlice(sliceType$9, (n + 1 >> 0)); - $copySlice($subslice(in$1, 0, n), origIn); - ((n < 0 || n >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + n] = slice); - /* } */ case 9: - nin = in$1.$length; - if (!((nin === t.NumIn()))) { - $panic(new $String("reflect.Value.Call: wrong argument count")); - } - nout = t.NumOut(); - argsArray = new ($global.Array)(t.NumIn()); - _ref$1 = in$1; - _i$1 = 0; - /* while (true) { */ case 21: - /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 22; continue; } - i$2 = _i$1; - arg = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); - _arg = t.In(i$2); - _r$9 = t.In(i$2).common(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - _arg$1 = _r$9; - _arg$2 = 0; - _r$10 = $clone(arg, Value).assignTo("reflect.Value.Call", _arg$1, _arg$2); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } - _r$11 = $clone(_r$10, Value).object(); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } - _arg$3 = _r$11; - _r$12 = unwrapJsObject(_arg, _arg$3); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } - argsArray[i$2] = _r$12; - _i$1++; - /* } */ $s = 21; continue; case 22: - _r$13 = callHelper(new sliceType$3([new $jsObjectPtr(fn), new $jsObjectPtr(rcvr), new $jsObjectPtr(argsArray)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } - results = _r$13; - _1 = nout; - /* */ if (_1 === (0)) { $s = 29; continue; } - /* */ if (_1 === (1)) { $s = 30; continue; } - /* */ $s = 31; continue; - /* if (_1 === (0)) { */ case 29: - $s = -1; return sliceType$9.nil; - /* } else if (_1 === (1)) { */ case 30: - _r$14 = makeValue(t.Out(0), wrapJsObject(t.Out(0), results), 0); /* */ $s = 33; case 33: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } - $s = -1; return new sliceType$9([$clone(_r$14, Value)]); - /* } else { */ case 31: - ret = $makeSlice(sliceType$9, nout); - _ref$2 = ret; - _i$2 = 0; - /* while (true) { */ case 34: - /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 35; continue; } - i$3 = _i$2; - _r$15 = makeValue(t.Out(i$3), wrapJsObject(t.Out(i$3), results[i$3]), 0); /* */ $s = 36; case 36: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } - ((i$3 < 0 || i$3 >= ret.$length) ? ($throwRuntimeError("index out of range"), undefined) : ret.$array[ret.$offset + i$3] = _r$15); - _i$2++; - /* } */ $s = 34; continue; case 35: - $s = -1; return ret; - /* } */ case 32: - case 28: - $s = -1; return sliceType$9.nil; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.call }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.arg = arg; $f.argsArray = argsArray; $f.elem = elem; $f.fn = fn; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.in$1 = in$1; $f.isSlice = isSlice; $f.m = m; $f.n = n; $f.nin = nin; $f.nout = nout; $f.op = op; $f.origIn = origIn; $f.rcvr = rcvr; $f.results = results; $f.ret = ret; $f.slice = slice; $f.t = t; $f.targ = targ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.xt = xt; $f.xt$1 = xt$1; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.call = function(op, in$1) { return this.$val.call(op, in$1); }; - structField.ptr.prototype.offset = function() { - var f; - f = this; - return f.offsetEmbed >>> 1 >>> 0; - }; - structField.prototype.offset = function() { return this.$val.offset(); }; - structField.ptr.prototype.embedded = function() { - var f; - f = this; - return !((((f.offsetEmbed & 1) >>> 0) === 0)); - }; - structField.prototype.embedded = function() { return this.$val.embedded(); }; - Kind.prototype.String = function() { - var k; - k = this.$val; - if (((k >> 0)) < kindNames.$length) { - return ((k < 0 || k >= kindNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + k]); - } - return "kind" + strconv.Itoa(((k >> 0))); - }; - $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; - rtype.ptr.prototype.String = function() { - var s, t; - t = this; - s = $clone(t.nameOff(t.str), name).name(); - if (!((((t.tflag & 2) >>> 0) === 0))) { - return $substring(s, 1); - } - return s; - }; - rtype.prototype.String = function() { return this.$val.String(); }; - rtype.ptr.prototype.Size = function() { - var t; - t = this; - return t.size; - }; - rtype.prototype.Size = function() { return this.$val.Size(); }; - rtype.ptr.prototype.Bits = function() { - var k, t; - t = this; - if (t === ptrType$1.nil) { - $panic(new $String("reflect: Bits of nil Type")); - } - k = t.Kind(); - if (k < 2 || k > 16) { - $panic(new $String("reflect: Bits of non-arithmetic Type " + t.String())); - } - return $imul(((t.size >> 0)), 8); - }; - rtype.prototype.Bits = function() { return this.$val.Bits(); }; - rtype.ptr.prototype.Align = function() { - var t; - t = this; - return ((t.align >> 0)); - }; - rtype.prototype.Align = function() { return this.$val.Align(); }; - rtype.ptr.prototype.FieldAlign = function() { - var t; - t = this; - return ((t.fieldAlign >> 0)); - }; - rtype.prototype.FieldAlign = function() { return this.$val.FieldAlign(); }; - rtype.ptr.prototype.Kind = function() { - var t; - t = this; - return ((((t.kind & 31) >>> 0) >>> 0)); - }; - rtype.prototype.Kind = function() { return this.$val.Kind(); }; - rtype.ptr.prototype.common = function() { - var t; - t = this; - return t; - }; - rtype.prototype.common = function() { return this.$val.common(); }; - rtype.ptr.prototype.exportedMethods = function() { - var t, ut; - t = this; - ut = t.uncommon(); - if (ut === ptrType$5.nil) { - return sliceType$5.nil; - } - return ut.exportedMethods(); - }; - rtype.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; - rtype.ptr.prototype.NumMethod = function() { - var t, tt; - t = this; - if (t.Kind() === 20) { - tt = (t.kindType); - return tt.NumMethod(); - } - return t.exportedMethods().$length; - }; - rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; - rtype.ptr.prototype.MethodByName = function(name$1) { - var _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, i, m, name$1, ok, p, t, tt, ut, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; i = $f.i; m = $f.m; name$1 = $f.name$1; ok = $f.ok; p = $f.p; t = $f.t; tt = $f.tt; ut = $f.ut; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - ok = false; - t = this; - if (t.Kind() === 20) { - tt = (t.kindType); - _tuple = tt.MethodByName(name$1); - Method.copy(m, _tuple[0]); - ok = _tuple[1]; - $s = -1; return [m, ok]; - } - ut = t.uncommon(); - if (ut === ptrType$5.nil) { - _tmp = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - _tmp$1 = false; - Method.copy(m, _tmp); - ok = _tmp$1; - $s = -1; return [m, ok]; - } - _ref = ut.exportedMethods(); - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - i = _i; - p = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), method); - /* */ if ($clone(t.nameOff(p.name), name).name() === name$1) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ($clone(t.nameOff(p.name), name).name() === name$1) { */ case 3: - _r = t.Method(i); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tmp$2 = $clone(_r, Method); - _tmp$3 = true; - Method.copy(m, _tmp$2); - ok = _tmp$3; - $s = -1; return [m, ok]; - /* } */ case 4: - _i++; - /* } */ $s = 1; continue; case 2: - _tmp$4 = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - _tmp$5 = false; - Method.copy(m, _tmp$4); - ok = _tmp$5; - $s = -1; return [m, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.MethodByName }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.i = i; $f.m = m; $f.name$1 = name$1; $f.ok = ok; $f.p = p; $f.t = t; $f.tt = tt; $f.ut = ut; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; - rtype.ptr.prototype.PkgPath = function() { - var t, ut; - t = this; - if (((t.tflag & 4) >>> 0) === 0) { - return ""; - } - ut = t.uncommon(); - if (ut === ptrType$5.nil) { - return ""; - } - return $clone(t.nameOff(ut.pkgPath), name).name(); - }; - rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; - rtype.ptr.prototype.Name = function() { - var i, s, t; - t = this; - if (((t.tflag & 4) >>> 0) === 0) { - return ""; - } - s = t.String(); - i = s.length - 1 >> 0; - while (true) { - if (!(i >= 0)) { break; } - if (s.charCodeAt(i) === 46) { - break; - } - i = i - (1) >> 0; - } - return $substring(s, (i + 1 >> 0)); - }; - rtype.prototype.Name = function() { return this.$val.Name(); }; - rtype.ptr.prototype.ChanDir = function() { - var t, tt; - t = this; - if (!((t.Kind() === 18))) { - $panic(new $String("reflect: ChanDir of non-chan type")); - } - tt = (t.kindType); - return ((tt.dir >> 0)); - }; - rtype.prototype.ChanDir = function() { return this.$val.ChanDir(); }; - rtype.ptr.prototype.IsVariadic = function() { - var t, tt; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: IsVariadic of non-func type")); - } - tt = (t.kindType); - return !((((tt.outCount & 32768) >>> 0) === 0)); - }; - rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; - rtype.ptr.prototype.Elem = function() { - var _1, t, tt, tt$1, tt$2, tt$3, tt$4; - t = this; - _1 = t.Kind(); - if (_1 === (17)) { - tt = (t.kindType); - return toType(tt.elem); - } else if (_1 === (18)) { - tt$1 = (t.kindType); - return toType(tt$1.elem); - } else if (_1 === (21)) { - tt$2 = (t.kindType); - return toType(tt$2.elem); - } else if (_1 === (22)) { - tt$3 = (t.kindType); - return toType(tt$3.elem); - } else if (_1 === (23)) { - tt$4 = (t.kindType); - return toType(tt$4.elem); - } - $panic(new $String("reflect: Elem of invalid type")); - }; - rtype.prototype.Elem = function() { return this.$val.Elem(); }; - rtype.ptr.prototype.Field = function(i) { - var i, t, tt; - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: Field of non-struct type")); - } - tt = (t.kindType); - return tt.Field(i); - }; - rtype.prototype.Field = function(i) { return this.$val.Field(i); }; - rtype.ptr.prototype.FieldByIndex = function(index) { - var _r, index, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; index = $f.index; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: FieldByIndex of non-struct type")); - } - tt = (t.kindType); - _r = tt.FieldByIndex(index); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByIndex }; } $f._r = _r; $f.index = index; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; - rtype.ptr.prototype.FieldByName = function(name$1) { - var _r, name$1, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; name$1 = $f.name$1; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: FieldByName of non-struct type")); - } - tt = (t.kindType); - _r = tt.FieldByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByName }; } $f._r = _r; $f.name$1 = name$1; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; - rtype.ptr.prototype.FieldByNameFunc = function(match) { - var _r, match, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; match = $f.match; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: FieldByNameFunc of non-struct type")); - } - tt = (t.kindType); - _r = tt.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByNameFunc }; } $f._r = _r; $f.match = match; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; - rtype.ptr.prototype.In = function(i) { - var i, t, tt, x; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: In of non-func type")); - } - tt = (t.kindType); - return toType((x = tt.in$(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); - }; - rtype.prototype.In = function(i) { return this.$val.In(i); }; - rtype.ptr.prototype.Key = function() { - var t, tt; - t = this; - if (!((t.Kind() === 21))) { - $panic(new $String("reflect: Key of non-map type")); - } - tt = (t.kindType); - return toType(tt.key); - }; - rtype.prototype.Key = function() { return this.$val.Key(); }; - rtype.ptr.prototype.Len = function() { - var t, tt; - t = this; - if (!((t.Kind() === 17))) { - $panic(new $String("reflect: Len of non-array type")); - } - tt = (t.kindType); - return ((tt.len >> 0)); - }; - rtype.prototype.Len = function() { return this.$val.Len(); }; - rtype.ptr.prototype.NumField = function() { - var t, tt; - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: NumField of non-struct type")); - } - tt = (t.kindType); - return tt.fields.$length; - }; - rtype.prototype.NumField = function() { return this.$val.NumField(); }; - rtype.ptr.prototype.NumIn = function() { - var t, tt; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: NumIn of non-func type")); - } - tt = (t.kindType); - return ((tt.inCount >> 0)); - }; - rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; - rtype.ptr.prototype.NumOut = function() { - var t, tt; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: NumOut of non-func type")); - } - tt = (t.kindType); - return tt.out().$length; - }; - rtype.prototype.NumOut = function() { return this.$val.NumOut(); }; - rtype.ptr.prototype.Out = function(i) { - var i, t, tt, x; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: Out of non-func type")); - } - tt = (t.kindType); - return toType((x = tt.out(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); - }; - rtype.prototype.Out = function(i) { return this.$val.Out(i); }; - ChanDir.prototype.String = function() { - var _1, d; - d = this.$val; - _1 = d; - if (_1 === (2)) { - return "chan<-"; - } else if (_1 === (1)) { - return "<-chan"; - } else if (_1 === (3)) { - return "chan"; - } - return "ChanDir" + strconv.Itoa(((d >> 0))); - }; - $ptrType(ChanDir).prototype.String = function() { return new ChanDir(this.$get()).String(); }; - interfaceType.ptr.prototype.Method = function(i) { - var i, m, p, pname, t, x; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - t = this; - if (i < 0 || i >= t.methods.$length) { - return m; - } - p = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - pname = $clone(t.rtype.nameOff(p.name), name); - m.Name = $clone(pname, name).name(); - if (!$clone(pname, name).isExported()) { - m.PkgPath = $clone(pname, name).pkgPath(); - if (m.PkgPath === "") { - m.PkgPath = $clone(t.pkgPath, name).name(); - } - } - m.Type = toType(t.rtype.typeOff(p.typ)); - m.Index = i; - return m; - }; - interfaceType.prototype.Method = function(i) { return this.$val.Method(i); }; - interfaceType.ptr.prototype.NumMethod = function() { - var t; - t = this; - return t.methods.$length; - }; - interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; - interfaceType.ptr.prototype.MethodByName = function(name$1) { - var _i, _ref, _tmp, _tmp$1, i, m, name$1, ok, p, t, x; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - ok = false; - t = this; - if (t === ptrType$7.nil) { - return [m, ok]; - } - p = ptrType$8.nil; - _ref = t.methods; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - p = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - if ($clone(t.rtype.nameOff(p.name), name).name() === name$1) { - _tmp = $clone(t.Method(i), Method); - _tmp$1 = true; - Method.copy(m, _tmp); - ok = _tmp$1; - return [m, ok]; - } - _i++; - } - return [m, ok]; - }; - interfaceType.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; - StructTag.prototype.Get = function(key) { - var _tuple, key, tag, v; - tag = this.$val; - _tuple = new StructTag(tag).Lookup(key); - v = _tuple[0]; - return v; - }; - $ptrType(StructTag).prototype.Get = function(key) { return new StructTag(this.$get()).Get(key); }; - StructTag.prototype.Lookup = function(key) { - var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, i, key, name$1, ok, qvalue, tag, value, value$1; - value = ""; - ok = false; - tag = this.$val; - while (true) { - if (!(!(tag === ""))) { break; } - i = 0; - while (true) { - if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } - i = i + (1) >> 0; - } - tag = $substring(tag, i); - if (tag === "") { - break; - } - i = 0; - while (true) { - if (!(i < tag.length && tag.charCodeAt(i) > 32 && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)) && !((tag.charCodeAt(i) === 127)))) { break; } - i = i + (1) >> 0; - } - if ((i === 0) || (i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { - break; - } - name$1 = ($substring(tag, 0, i)); - tag = $substring(tag, (i + 1 >> 0)); - i = 1; - while (true) { - if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } - if (tag.charCodeAt(i) === 92) { - i = i + (1) >> 0; - } - i = i + (1) >> 0; - } - if (i >= tag.length) { - break; - } - qvalue = ($substring(tag, 0, (i + 1 >> 0))); - tag = $substring(tag, (i + 1 >> 0)); - if (key === name$1) { - _tuple = strconv.Unquote(qvalue); - value$1 = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - break; - } - _tmp = value$1; - _tmp$1 = true; - value = _tmp; - ok = _tmp$1; - return [value, ok]; - } - } - _tmp$2 = ""; - _tmp$3 = false; - value = _tmp$2; - ok = _tmp$3; - return [value, ok]; - }; - $ptrType(StructTag).prototype.Lookup = function(key) { return new StructTag(this.$get()).Lookup(key); }; - structType.ptr.prototype.Field = function(i) { - var f, i, p, t, tag, x; - f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); - t = this; - if (i < 0 || i >= t.fields.$length) { - $panic(new $String("reflect: Field index out of bounds")); - } - p = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - f.Type = toType(p.typ); - f.Name = $clone(p.name, name).name(); - f.Anonymous = p.embedded(); - if (!$clone(p.name, name).isExported()) { - f.PkgPath = $clone(t.pkgPath, name).name(); - } - tag = $clone(p.name, name).tag(); - if (!(tag === "")) { - f.Tag = (tag); - } - f.Offset = p.offset(); - f.Index = new sliceType$13([i]); - return f; - }; - structType.prototype.Field = function(i) { return this.$val.Field(i); }; - structType.ptr.prototype.FieldByIndex = function(index) { - var _i, _r, _r$1, _r$2, _r$3, _r$4, _ref, _v, f, ft, i, index, t, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _v = $f._v; f = $f.f; ft = $f.ft; i = $f.i; index = $f.index; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); - t = this; - f.Type = toType(t.rtype); - _ref = index; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - i = _i; - x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - /* */ if (i > 0) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (i > 0) { */ case 3: - ft = f.Type; - _r = ft.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - if (!(_r === 22)) { _v = false; $s = 7; continue s; } - _r$1 = ft.Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = _r$1.Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v = _r$2 === 25; case 7: - /* */ if (_v) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (_v) { */ case 5: - _r$3 = ft.Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - ft = _r$3; - /* } */ case 6: - f.Type = ft; - /* } */ case 4: - _r$4 = f.Type.Field(x); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - StructField.copy(f, _r$4); - _i++; - /* } */ $s = 1; continue; case 2: - $s = -1; return f; - /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByIndex }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._v = _v; $f.f = f; $f.ft = ft; $f.i = i; $f.index = index; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structType.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; - structType.ptr.prototype.FieldByNameFunc = function(match) { - var _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _key, _key$1, _key$2, _key$3, _r, _r$1, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, count, current, f, fname, i, index, match, next, nextCount, ntyp, ok, result, scan, styp, t, t$1, visited, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _key$3 = $f._key$3; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; count = $f.count; current = $f.current; f = $f.f; fname = $f.fname; i = $f.i; index = $f.index; match = $f.match; next = $f.next; nextCount = $f.nextCount; ntyp = $f.ntyp; ok = $f.ok; result = $f.result; scan = $f.scan; styp = $f.styp; t = $f.t; t$1 = $f.t$1; visited = $f.visited; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - result = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); - ok = false; - t = this; - current = new sliceType$14([]); - next = new sliceType$14([new fieldScan.ptr(t, sliceType$13.nil)]); - nextCount = false; - visited = $makeMap(ptrType$9.keyFor, []); - /* while (true) { */ case 1: - /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } - _tmp = next; - _tmp$1 = $subslice(current, 0, 0); - current = _tmp; - next = _tmp$1; - count = nextCount; - nextCount = false; - _ref = current; - _i = 0; - /* while (true) { */ case 3: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } - scan = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), fieldScan); - t$1 = scan.typ; - /* */ if ((_entry = visited[ptrType$9.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if ((_entry = visited[ptrType$9.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { */ case 5: - _i++; - /* continue; */ $s = 3; continue; - /* } */ case 6: - _key = t$1; (visited || $throwRuntimeError("assignment to entry in nil map"))[ptrType$9.keyFor(_key)] = { k: _key, v: true }; - _ref$1 = t$1.fields; - _i$1 = 0; - /* while (true) { */ case 7: - /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 8; continue; } - i = _i$1; - f = (x = t$1.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - fname = $clone(f.name, name).name(); - ntyp = ptrType$1.nil; - /* */ if (f.embedded()) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (f.embedded()) { */ case 9: - ntyp = f.typ; - /* */ if (ntyp.Kind() === 22) { $s = 11; continue; } - /* */ $s = 12; continue; - /* if (ntyp.Kind() === 22) { */ case 11: - _r = ntyp.Elem().common(); /* */ $s = 13; case 13: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - ntyp = _r; - /* } */ case 12: - /* } */ case 10: - _r$1 = match(fname); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (_r$1) { $s = 14; continue; } - /* */ $s = 15; continue; - /* if (_r$1) { */ case 14: - if ((_entry$1 = count[ptrType$9.keyFor(t$1)], _entry$1 !== undefined ? _entry$1.v : 0) > 1 || ok) { - _tmp$2 = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); - _tmp$3 = false; - StructField.copy(result, _tmp$2); - ok = _tmp$3; - $s = -1; return [result, ok]; - } - StructField.copy(result, t$1.Field(i)); - result.Index = sliceType$13.nil; - result.Index = $appendSlice(result.Index, scan.index); - result.Index = $append(result.Index, i); - ok = true; - _i$1++; - /* continue; */ $s = 7; continue; - /* } */ case 15: - if (ok || ntyp === ptrType$1.nil || !((ntyp.Kind() === 25))) { - _i$1++; - /* continue; */ $s = 7; continue; - } - styp = (ntyp.kindType); - if ((_entry$2 = nextCount[ptrType$9.keyFor(styp)], _entry$2 !== undefined ? _entry$2.v : 0) > 0) { - _key$1 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$9.keyFor(_key$1)] = { k: _key$1, v: 2 }; - _i$1++; - /* continue; */ $s = 7; continue; - } - if (nextCount === false) { - nextCount = $makeMap(ptrType$9.keyFor, []); - } - _key$2 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$9.keyFor(_key$2)] = { k: _key$2, v: 1 }; - if ((_entry$3 = count[ptrType$9.keyFor(t$1)], _entry$3 !== undefined ? _entry$3.v : 0) > 1) { - _key$3 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$9.keyFor(_key$3)] = { k: _key$3, v: 2 }; - } - index = sliceType$13.nil; - index = $appendSlice(index, scan.index); - index = $append(index, i); - next = $append(next, new fieldScan.ptr(styp, index)); - _i$1++; - /* } */ $s = 7; continue; case 8: - _i++; - /* } */ $s = 3; continue; case 4: - if (ok) { - /* break; */ $s = 2; continue; - } - /* } */ $s = 1; continue; case 2: - $s = -1; return [result, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByNameFunc }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._key$3 = _key$3; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.count = count; $f.current = current; $f.f = f; $f.fname = fname; $f.i = i; $f.index = index; $f.match = match; $f.next = next; $f.nextCount = nextCount; $f.ntyp = ntyp; $f.ok = ok; $f.result = result; $f.scan = scan; $f.styp = styp; $f.t = t; $f.t$1 = t$1; $f.visited = visited; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structType.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; - structType.ptr.prototype.FieldByName = function(name$1) { - var _i, _r, _ref, _tmp, _tmp$1, _tuple, f, hasEmbeds, i, name$1, present, t, tf, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; f = $f.f; hasEmbeds = $f.hasEmbeds; i = $f.i; name$1 = $f.name$1; present = $f.present; t = $f.t; tf = $f.tf; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - name$1 = [name$1]; - f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); - present = false; - t = this; - hasEmbeds = false; - if (!(name$1[0] === "")) { - _ref = t.fields; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - tf = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - if ($clone(tf.name, name).name() === name$1[0]) { - _tmp = $clone(t.Field(i), StructField); - _tmp$1 = true; - StructField.copy(f, _tmp); - present = _tmp$1; - $s = -1; return [f, present]; - } - if (tf.embedded()) { - hasEmbeds = true; - } - _i++; - } - } - if (!hasEmbeds) { - $s = -1; return [f, present]; - } - _r = t.FieldByNameFunc((function(name$1) { return function(s) { - var s; - return s === name$1[0]; - }; })(name$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - StructField.copy(f, _tuple[0]); - present = _tuple[1]; - $s = -1; return [f, present]; - /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByName }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.f = f; $f.hasEmbeds = hasEmbeds; $f.i = i; $f.name$1 = name$1; $f.present = present; $f.t = t; $f.tf = tf; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structType.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; - PtrTo = function(t) { - var t; - return $assertType(t, ptrType$1).ptrTo(); - }; - $pkg.PtrTo = PtrTo; - rtype.ptr.prototype.Implements = function(u) { - var _r, t, u, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if ($interfaceIsEqual(u, $ifaceNil)) { - $panic(new $String("reflect: nil type passed to Type.Implements")); - } - _r = u.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 20))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 20))) { */ case 1: - $panic(new $String("reflect: non-interface type passed to Type.Implements")); - /* } */ case 2: - $s = -1; return implements$1($assertType(u, ptrType$1), t); - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Implements }; } $f._r = _r; $f.t = t; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.Implements = function(u) { return this.$val.Implements(u); }; - rtype.ptr.prototype.AssignableTo = function(u) { - var _r, t, u, uu, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; u = $f.u; uu = $f.uu; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if ($interfaceIsEqual(u, $ifaceNil)) { - $panic(new $String("reflect: nil type passed to Type.AssignableTo")); - } - uu = $assertType(u, ptrType$1); - _r = directlyAssignable(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r || implements$1(uu, t); - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.AssignableTo }; } $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; - rtype.ptr.prototype.ConvertibleTo = function(u) { - var _r, t, u, uu, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; u = $f.u; uu = $f.uu; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if ($interfaceIsEqual(u, $ifaceNil)) { - $panic(new $String("reflect: nil type passed to Type.ConvertibleTo")); - } - uu = $assertType(u, ptrType$1); - _r = convertOp(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return !(_r === $throwNilPointerError); - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.ConvertibleTo }; } $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.ConvertibleTo = function(u) { return this.$val.ConvertibleTo(u); }; - implements$1 = function(T, V) { - var T, V, i, i$1, j, j$1, t, tm, tm$1, tmName, tmName$1, tmPkgPath, tmPkgPath$1, v, v$1, vm, vm$1, vmName, vmName$1, vmPkgPath, vmPkgPath$1, vmethods, x, x$1, x$2; - if (!((T.Kind() === 20))) { - return false; - } - t = (T.kindType); - if (t.methods.$length === 0) { - return true; - } - if (V.Kind() === 20) { - v = (V.kindType); - i = 0; - j = 0; - while (true) { - if (!(j < v.methods.$length)) { break; } - tm = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); - tmName = $clone(t.rtype.nameOff(tm.name), name); - vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])); - vmName = $clone(V.nameOff(vm.name), name); - if ($clone(vmName, name).name() === $clone(tmName, name).name() && V.typeOff(vm.typ) === t.rtype.typeOff(tm.typ)) { - if (!$clone(tmName, name).isExported()) { - tmPkgPath = $clone(tmName, name).pkgPath(); - if (tmPkgPath === "") { - tmPkgPath = $clone(t.pkgPath, name).name(); - } - vmPkgPath = $clone(vmName, name).pkgPath(); - if (vmPkgPath === "") { - vmPkgPath = $clone(v.pkgPath, name).name(); - } - if (!(tmPkgPath === vmPkgPath)) { - j = j + (1) >> 0; - continue; - } - } - i = i + (1) >> 0; - if (i >= t.methods.$length) { - return true; - } - } - j = j + (1) >> 0; - } - return false; - } - v$1 = V.uncommon(); - if (v$1 === ptrType$5.nil) { - return false; - } - i$1 = 0; - vmethods = v$1.methods(); - j$1 = 0; - while (true) { - if (!(j$1 < ((v$1.mcount >> 0)))) { break; } - tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); - tmName$1 = $clone(t.rtype.nameOff(tm$1.name), name); - vm$1 = $clone(((j$1 < 0 || j$1 >= vmethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : vmethods.$array[vmethods.$offset + j$1]), method); - vmName$1 = $clone(V.nameOff(vm$1.name), name); - if ($clone(vmName$1, name).name() === $clone(tmName$1, name).name() && V.typeOff(vm$1.mtyp) === t.rtype.typeOff(tm$1.typ)) { - if (!$clone(tmName$1, name).isExported()) { - tmPkgPath$1 = $clone(tmName$1, name).pkgPath(); - if (tmPkgPath$1 === "") { - tmPkgPath$1 = $clone(t.pkgPath, name).name(); - } - vmPkgPath$1 = $clone(vmName$1, name).pkgPath(); - if (vmPkgPath$1 === "") { - vmPkgPath$1 = $clone(V.nameOff(v$1.pkgPath), name).name(); - } - if (!(tmPkgPath$1 === vmPkgPath$1)) { - j$1 = j$1 + (1) >> 0; - continue; - } - } - i$1 = i$1 + (1) >> 0; - if (i$1 >= t.methods.$length) { - return true; - } - } - j$1 = j$1 + (1) >> 0; - } - return false; - }; - directlyAssignable = function(T, V) { - var T, V, _r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; T = $f.T; V = $f.V; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if (T === V) { - $s = -1; return true; - } - if (!(T.Name() === "") && !(V.Name() === "") || !((T.Kind() === V.Kind()))) { - $s = -1; return false; - } - _r = haveIdenticalUnderlyingType(T, V, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: directlyAssignable }; } $f.T = T; $f.V = V; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; - }; - haveIdenticalType = function(T, V, cmpTags) { - var T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, cmpTags, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; T = $f.T; V = $f.V; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _v = $f._v; cmpTags = $f.cmpTags; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if (cmpTags) { - $s = -1; return $interfaceIsEqual(T, V); - } - _r = T.Name(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = V.Name(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - if (!(_r === _r$1)) { _v = true; $s = 3; continue s; } - _r$2 = T.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = V.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _v = !((_r$2 === _r$3)); case 3: - /* */ if (_v) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_v) { */ case 1: - $s = -1; return false; - /* } */ case 2: - _r$4 = T.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _arg = _r$4; - _r$5 = V.common(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _arg$1 = _r$5; - _r$6 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - $s = -1; return _r$6; - /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalType }; } $f.T = T; $f.V = V; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._v = _v; $f.cmpTags = cmpTags; $f.$s = $s; $f.$r = $r; return $f; - }; - haveIdenticalUnderlyingType = function(T, V, cmpTags) { - var T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _v, _v$1, _v$2, _v$3, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; T = $f.T; V = $f.V; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; cmpTags = $f.cmpTags; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; kind = $f.kind; t = $f.t; t$1 = $f.t$1; t$2 = $f.t$2; tf = $f.tf; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; vf = $f.vf; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if (T === V) { - $s = -1; return true; - } - kind = T.Kind(); - if (!((kind === V.Kind()))) { - $s = -1; return false; - } - if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { - $s = -1; return true; - } - _1 = kind; - /* */ if (_1 === (17)) { $s = 2; continue; } - /* */ if (_1 === (18)) { $s = 3; continue; } - /* */ if (_1 === (19)) { $s = 4; continue; } - /* */ if (_1 === (20)) { $s = 5; continue; } - /* */ if (_1 === (21)) { $s = 6; continue; } - /* */ if ((_1 === (22)) || (_1 === (23))) { $s = 7; continue; } - /* */ if (_1 === (25)) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (_1 === (17)) { */ case 2: - if (!(T.Len() === V.Len())) { _v = false; $s = 10; continue s; } - _r = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r; case 10: - $s = -1; return _v; - /* } else if (_1 === (18)) { */ case 3: - if (!(V.ChanDir() === 3)) { _v$1 = false; $s = 14; continue s; } - _r$1 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _v$1 = _r$1; case 14: - /* */ if (_v$1) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if (_v$1) { */ case 12: - $s = -1; return true; - /* } */ case 13: - if (!(V.ChanDir() === T.ChanDir())) { _v$2 = false; $s = 16; continue s; } - _r$2 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v$2 = _r$2; case 16: - $s = -1; return _v$2; - /* } else if (_1 === (19)) { */ case 4: - t = (T.kindType); - v = (V.kindType); - if (!((t.outCount === v.outCount)) || !((t.inCount === v.inCount))) { - $s = -1; return false; - } - i = 0; - /* while (true) { */ case 18: - /* if (!(i < t.rtype.NumIn())) { break; } */ if(!(i < t.rtype.NumIn())) { $s = 19; continue; } - _r$3 = haveIdenticalType(t.rtype.In(i), v.rtype.In(i), cmpTags); /* */ $s = 22; case 22: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (!_r$3) { $s = 20; continue; } - /* */ $s = 21; continue; - /* if (!_r$3) { */ case 20: - $s = -1; return false; - /* } */ case 21: - i = i + (1) >> 0; - /* } */ $s = 18; continue; case 19: - i$1 = 0; - /* while (true) { */ case 23: - /* if (!(i$1 < t.rtype.NumOut())) { break; } */ if(!(i$1 < t.rtype.NumOut())) { $s = 24; continue; } - _r$4 = haveIdenticalType(t.rtype.Out(i$1), v.rtype.Out(i$1), cmpTags); /* */ $s = 27; case 27: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ if (!_r$4) { $s = 25; continue; } - /* */ $s = 26; continue; - /* if (!_r$4) { */ case 25: - $s = -1; return false; - /* } */ case 26: - i$1 = i$1 + (1) >> 0; - /* } */ $s = 23; continue; case 24: - $s = -1; return true; - /* } else if (_1 === (20)) { */ case 5: - t$1 = (T.kindType); - v$1 = (V.kindType); - if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { - $s = -1; return true; - } - $s = -1; return false; - /* } else if (_1 === (21)) { */ case 6: - _r$5 = haveIdenticalType(T.Key(), V.Key(), cmpTags); /* */ $s = 29; case 29: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - if (!(_r$5)) { _v$3 = false; $s = 28; continue s; } - _r$6 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 30; case 30: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _v$3 = _r$6; case 28: - $s = -1; return _v$3; - /* } else if ((_1 === (22)) || (_1 === (23))) { */ case 7: - _r$7 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 31; case 31: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - $s = -1; return _r$7; - /* } else if (_1 === (25)) { */ case 8: - t$2 = (T.kindType); - v$2 = (V.kindType); - if (!((t$2.fields.$length === v$2.fields.$length))) { - $s = -1; return false; - } - if (!($clone(t$2.pkgPath, name).name() === $clone(v$2.pkgPath, name).name())) { - $s = -1; return false; - } - _ref = t$2.fields; - _i = 0; - /* while (true) { */ case 32: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 33; continue; } - i$2 = _i; - tf = (x = t$2.fields, ((i$2 < 0 || i$2 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i$2])); - vf = (x$1 = v$2.fields, ((i$2 < 0 || i$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$2])); - if (!($clone(tf.name, name).name() === $clone(vf.name, name).name())) { - $s = -1; return false; - } - _r$8 = haveIdenticalType(tf.typ, vf.typ, cmpTags); /* */ $s = 36; case 36: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - /* */ if (!_r$8) { $s = 34; continue; } - /* */ $s = 35; continue; - /* if (!_r$8) { */ case 34: - $s = -1; return false; - /* } */ case 35: - if (cmpTags && !($clone(tf.name, name).tag() === $clone(vf.name, name).tag())) { - $s = -1; return false; - } - if (!((tf.offsetEmbed === vf.offsetEmbed))) { - $s = -1; return false; - } - _i++; - /* } */ $s = 32; continue; case 33: - $s = -1; return true; - /* } */ case 9: - case 1: - $s = -1; return false; - /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalUnderlyingType }; } $f.T = T; $f.V = V; $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f.cmpTags = cmpTags; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.kind = kind; $f.t = t; $f.t$1 = t$1; $f.t$2 = t$2; $f.tf = tf; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.vf = vf; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; - }; - toType = function(t) { - var t; - if (t === ptrType$1.nil) { - return $ifaceNil; - } - return t; - }; - ifaceIndir = function(t) { - var t; - return ((t.kind & 32) >>> 0) === 0; - }; + ptrType$22 = $ptrType(MapIter); + arrayType$7 = $arrayType($Uintptr, 2); + ptrType$23 = $ptrType(ValueError); + funcType$4 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); + funcType$5 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); + ptrType$25 = $ptrType(structField); + ptrType$26 = $ptrType(hiter); flag.prototype.kind = function() { var f; f = this.$val; @@ -15905,10 +15340,20 @@ $packages["reflect"] = (function() { return "reflect: call of " + e.Method + " on " + new Kind(e.Kind).String() + " Value"; }; ValueError.prototype.Error = function() { return this.$val.Error(); }; + methodName = function() { + var _tuple, f, pc; + _tuple = runtime.Caller(2); + pc = _tuple[0]; + f = runtime.FuncForPC(pc); + if (f === ptrType$4.nil) { + return "unknown method"; + } + return f.Name(); + }; flag.prototype.mustBe = function(expected) { var expected, f; f = this.$val; - if (!((new flag(f).kind() === expected))) { + if (!((((((f & 31) >>> 0) >>> 0)) === expected))) { $panic(new ValueError.ptr(methodName(), new flag(f).kind())); } }; @@ -15916,35 +15361,52 @@ $packages["reflect"] = (function() { flag.prototype.mustBeExported = function() { var f; f = this.$val; - if (f === 0) { - $panic(new ValueError.ptr(methodName(), 0)); - } - if (!((((f & 96) >>> 0) === 0))) { - $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); + if ((f === 0) || !((((f & 96) >>> 0) === 0))) { + new flag(f).mustBeExportedSlow(); } }; $ptrType(flag).prototype.mustBeExported = function() { return new flag(this.$get()).mustBeExported(); }; - flag.prototype.mustBeAssignable = function() { + flag.prototype.mustBeExportedSlow = function() { var f; f = this.$val; if (f === 0) { - $panic(new ValueError.ptr(methodName(), 0)); + $panic(new ValueError.ptr(methodNameSkip(), 0)); } if (!((((f & 96) >>> 0) === 0))) { - $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); + $panic(new $String("reflect: " + methodNameSkip() + " using value obtained using unexported field")); } - if (((f & 256) >>> 0) === 0) { - $panic(new $String("reflect: " + methodName() + " using unaddressable value")); + }; + $ptrType(flag).prototype.mustBeExportedSlow = function() { return new flag(this.$get()).mustBeExportedSlow(); }; + flag.prototype.mustBeAssignable = function() { + var f; + f = this.$val; + if (!((((f & 96) >>> 0) === 0)) || (((f & 256) >>> 0) === 0)) { + new flag(f).mustBeAssignableSlow(); } }; $ptrType(flag).prototype.mustBeAssignable = function() { return new flag(this.$get()).mustBeAssignable(); }; + flag.prototype.mustBeAssignableSlow = function() { + var f; + f = this.$val; + if (f === 0) { + $panic(new ValueError.ptr(methodNameSkip(), 0)); + } + if (!((((f & 96) >>> 0) === 0))) { + $panic(new $String("reflect: " + methodNameSkip() + " using value obtained using unexported field")); + } + if (((f & 256) >>> 0) === 0) { + $panic(new $String("reflect: " + methodNameSkip() + " using unaddressable value")); + } + }; + $ptrType(flag).prototype.mustBeAssignableSlow = function() { return new flag(this.$get()).mustBeAssignableSlow(); }; Value.ptr.prototype.Addr = function() { - var v; + var fl, v; v = this; if (((v.flag & 256) >>> 0) === 0) { $panic(new $String("reflect.Value.Addr of unaddressable value")); } - return new Value.ptr(v.typ.ptrTo(), v.ptr, (new flag(v.flag).ro() | 22) >>> 0); + fl = (v.flag & 96) >>> 0; + return new Value.ptr(v.typ.ptrTo(), v.ptr, (fl | 22) >>> 0); }; Value.prototype.Addr = function() { return this.$val.Addr(); }; Value.ptr.prototype.Bool = function() { @@ -15955,8 +15417,8 @@ $packages["reflect"] = (function() { }; Value.prototype.Bool = function() { return this.$val.Bool(); }; Value.ptr.prototype.Bytes = function() { - var _r, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, v, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(23); _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } @@ -15966,12 +15428,12 @@ $packages["reflect"] = (function() { $panic(new $String("reflect.Value.Bytes of non-byte slice")); /* } */ case 2: $s = -1; return (v.ptr).$get(); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Bytes }; } $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Bytes, $c: true, $r, _r, v, $s};return $f; }; Value.prototype.Bytes = function() { return this.$val.Bytes(); }; Value.ptr.prototype.runes = function() { - var _r, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, v, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(23); _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } @@ -15981,7 +15443,7 @@ $packages["reflect"] = (function() { $panic(new $String("reflect.Value.Bytes of non-rune slice")); /* } */ case 2: $s = -1; return (v.ptr).$get(); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.runes }; } $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.runes, $c: true, $r, _r, v, $s};return $f; }; Value.prototype.runes = function() { return this.$val.runes(); }; Value.ptr.prototype.CanAddr = function() { @@ -15997,27 +15459,40 @@ $packages["reflect"] = (function() { }; Value.prototype.CanSet = function() { return this.$val.CanSet(); }; Value.ptr.prototype.Call = function(in$1) { - var _r, in$1, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, in$1, v, $s, $r, $c} = $restore(this, {in$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(19); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).call("Call", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Call }; } $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Call, $c: true, $r, $24r, _r, in$1, v, $s};return $f; }; Value.prototype.Call = function(in$1) { return this.$val.Call(in$1); }; Value.ptr.prototype.CallSlice = function(in$1) { - var _r, in$1, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, in$1, v, $s, $r, $c} = $restore(this, {in$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(19); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).call("CallSlice", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.CallSlice }; } $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.CallSlice, $c: true, $r, $24r, _r, in$1, v, $s};return $f; }; Value.prototype.CallSlice = function(in$1) { return this.$val.CallSlice(in$1); }; + Value.ptr.prototype.CanComplex = function() { + var _1, v; + v = this; + _1 = new flag(v.flag).kind(); + if ((_1 === (15)) || (_1 === (16))) { + return true; + } else { + return false; + } + }; + Value.prototype.CanComplex = function() { return this.$val.CanComplex(); }; Value.ptr.prototype.Complex = function() { var _1, k, v, x; v = this; @@ -16032,49 +15507,99 @@ $packages["reflect"] = (function() { }; Value.prototype.Complex = function() { return this.$val.Complex(); }; Value.ptr.prototype.FieldByIndex = function(index) { - var _i, _r, _r$1, _r$2, _r$3, _ref, _v, i, index, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _v = $f._v; i = $f.i; index = $f.index; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _i, _r, _r$1, _r$2, _r$3, _ref, _v, i, index, v, x, $s, $r, $c} = $restore(this, {index}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; /* */ if (index.$length === 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (index.$length === 1) { */ case 1: _r = $clone(v, Value).Field((0 >= index.$length ? ($throwRuntimeError("index out of range"), undefined) : index.$array[index.$offset + 0])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; + $24r = _r; + $s = 4; case 4: return $24r; /* } */ case 2: new flag(v.flag).mustBe(25); _ref = index; _i = 0; - /* while (true) { */ case 4: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } + /* while (true) { */ case 5: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } i = _i; x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - /* */ if (i > 0) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (i > 0) { */ case 6: - if (!($clone(v, Value).Kind() === 22)) { _v = false; $s = 10; continue s; } - _r$1 = v.typ.Elem().Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _v = _r$1 === 25; case 10: - /* */ if (_v) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (_v) { */ case 8: + /* */ if (i > 0) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (i > 0) { */ case 7: + if (!($clone(v, Value).Kind() === 22)) { _v = false; $s = 11; continue s; } + _r$1 = v.typ.Elem().Kind(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = _r$1 === 25; case 11: + /* */ if (_v) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_v) { */ case 9: if ($clone(v, Value).IsNil()) { $panic(new $String("reflect: indirection through nil pointer to embedded struct")); } - _r$2 = $clone(v, Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$2 = $clone(v, Value).Elem(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } v = _r$2; - /* } */ case 9: - /* } */ case 7: - _r$3 = $clone(v, Value).Field(x); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* } */ case 10: + /* } */ case 8: + _r$3 = $clone(v, Value).Field(x); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } v = _r$3; _i++; - /* } */ $s = 4; continue; case 5: + $s = 5; continue; + case 6: $s = -1; return v; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByIndex }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._v = _v; $f.i = i; $f.index = index; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.FieldByIndex, $c: true, $r, $24r, _i, _r, _r$1, _r$2, _r$3, _ref, _v, i, index, v, x, $s};return $f; }; Value.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; + Value.ptr.prototype.FieldByIndexErr = function(index) { + var {$24r, $24r$1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _v, i, index, v, x, $s, $r, $c} = $restore(this, {index}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + /* */ if (index.$length === 1) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (index.$length === 1) { */ case 1: + _r = $clone(v, Value).Field((0 >= index.$length ? ($throwRuntimeError("index out of range"), undefined) : index.$array[index.$offset + 0])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = [_r, $ifaceNil]; + $s = 4; case 4: return $24r; + /* } */ case 2: + new flag(v.flag).mustBe(25); + _ref = index; + _i = 0; + /* while (true) { */ case 5: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } + i = _i; + x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + /* */ if (i > 0) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (i > 0) { */ case 7: + if (!($clone(v, Value).Kind() === 22)) { _v = false; $s = 11; continue s; } + _r$1 = v.typ.Elem().Kind(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = _r$1 === 25; case 11: + /* */ if (_v) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_v) { */ case 9: + /* */ if ($clone(v, Value).IsNil()) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if ($clone(v, Value).IsNil()) { */ case 13: + _r$2 = v.typ.Elem().Name(); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = errors.New("reflect: indirection through nil pointer to embedded struct field " + _r$2); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r$1 = [new Value.ptr(ptrType$1.nil, 0, 0), _r$3]; + $s = 17; case 17: return $24r$1; + /* } */ case 14: + _r$4 = $clone(v, Value).Elem(); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + v = _r$4; + /* } */ case 10: + /* } */ case 8: + _r$5 = $clone(v, Value).Field(x); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + v = _r$5; + _i++; + $s = 5; continue; + case 6: + $s = -1; return [v, $ifaceNil]; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.FieldByIndexErr, $c: true, $r, $24r, $24r$1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _v, i, index, v, x, $s};return $f; + }; + Value.prototype.FieldByIndexErr = function(index) { return this.$val.FieldByIndexErr(index); }; Value.ptr.prototype.FieldByName = function(name$1) { - var _r, _r$1, _tuple, f, name$1, ok, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; name$1 = $f.name$1; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _r$1, _tuple, f, name$1, ok, v, $s, $r, $c} = $restore(this, {name$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(25); _r = v.typ.FieldByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } @@ -16085,15 +15610,16 @@ $packages["reflect"] = (function() { /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = $clone(v, Value).FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; + $24r = _r$1; + $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByName }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.name$1 = name$1; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.FieldByName, $c: true, $r, $24r, _r, _r$1, _tuple, f, name$1, ok, v, $s};return $f; }; Value.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; Value.ptr.prototype.FieldByNameFunc = function(match) { - var _r, _r$1, _tuple, f, match, ok, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; match = $f.match; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _r$1, _tuple, f, match, ok, v, $s, $r, $c} = $restore(this, {match}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; _r = v.typ.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; @@ -16103,12 +15629,24 @@ $packages["reflect"] = (function() { /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = $clone(v, Value).FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; + $24r = _r$1; + $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByNameFunc }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.match = match; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.FieldByNameFunc, $c: true, $r, $24r, _r, _r$1, _tuple, f, match, ok, v, $s};return $f; }; Value.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; + Value.ptr.prototype.CanFloat = function() { + var _1, v; + v = this; + _1 = new flag(v.flag).kind(); + if ((_1 === (13)) || (_1 === (14))) { + return true; + } else { + return false; + } + }; + Value.prototype.CanFloat = function() { return this.$val.CanFloat(); }; Value.ptr.prototype.Float = function() { var _1, k, v; v = this; @@ -16122,6 +15660,17 @@ $packages["reflect"] = (function() { $panic(new ValueError.ptr("reflect.Value.Float", new flag(v.flag).kind())); }; Value.prototype.Float = function() { return this.$val.Float(); }; + Value.ptr.prototype.CanInt = function() { + var _1, v; + v = this; + _1 = new flag(v.flag).kind(); + if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { + return true; + } else { + return false; + } + }; + Value.prototype.CanInt = function() { return this.$val.CanInt(); }; Value.ptr.prototype.Int = function() { var _1, k, p, v; v = this; @@ -16152,14 +15701,15 @@ $packages["reflect"] = (function() { }; Value.prototype.CanInterface = function() { return this.$val.CanInterface(); }; Value.ptr.prototype.Interface = function() { - var _r, i, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, i, v, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: i = $ifaceNil; v = this; _r = valueInterface($clone(v, Value), true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; - $s = -1; return i; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Interface }; } $f._r = _r; $f.i = i; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = i; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Interface, $c: true, $r, $24r, _r, i, v, $s};return $f; }; Value.prototype.Interface = function() { return this.$val.Interface(); }; Value.ptr.prototype.IsValid = function() { @@ -16168,6 +15718,74 @@ $packages["reflect"] = (function() { return !((v.flag === 0)); }; Value.prototype.IsValid = function() { return this.$val.IsValid(); }; + Value.ptr.prototype.IsZero = function() { + var {_1, _r, _r$1, _r$2, _r$3, c, i, i$1, v, x, x$1, x$2, x$3, x$4, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + _1 = new flag(v.flag).kind(); + /* */ if (_1 === (1)) { $s = 2; continue; } + /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 3; continue; } + /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 4; continue; } + /* */ if ((_1 === (13)) || (_1 === (14))) { $s = 5; continue; } + /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 6; continue; } + /* */ if (_1 === (17)) { $s = 7; continue; } + /* */ if ((_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { $s = 8; continue; } + /* */ if (_1 === (24)) { $s = 9; continue; } + /* */ if (_1 === (25)) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (_1 === (1)) { */ case 2: + $s = -1; return !$clone(v, Value).Bool(); + /* } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 3: + $s = -1; return (x = $clone(v, Value).Int(), (x.$high === 0 && x.$low === 0)); + /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 4: + $s = -1; return (x$1 = $clone(v, Value).Uint(), (x$1.$high === 0 && x$1.$low === 0)); + /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 5: + $s = -1; return (x$2 = math.Float64bits($clone(v, Value).Float()), (x$2.$high === 0 && x$2.$low === 0)); + /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 6: + c = $clone(v, Value).Complex(); + $s = -1; return (x$3 = math.Float64bits(c.$real), (x$3.$high === 0 && x$3.$low === 0)) && (x$4 = math.Float64bits(c.$imag), (x$4.$high === 0 && x$4.$low === 0)); + /* } else if (_1 === (17)) { */ case 7: + i = 0; + /* while (true) { */ case 13: + /* if (!(i < $clone(v, Value).Len())) { break; } */ if(!(i < $clone(v, Value).Len())) { $s = 14; continue; } + _r = $clone(v, Value).Index(i); /* */ $s = 17; case 17: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = $clone(_r, Value).IsZero(); /* */ $s = 18; case 18: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (!_r$1) { $s = 15; continue; } + /* */ $s = 16; continue; + /* if (!_r$1) { */ case 15: + $s = -1; return false; + /* } */ case 16: + i = i + (1) >> 0; + $s = 13; continue; + case 14: + $s = -1; return true; + /* } else if ((_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { */ case 8: + $s = -1; return $clone(v, Value).IsNil(); + /* } else if (_1 === (24)) { */ case 9: + $s = -1; return $clone(v, Value).Len() === 0; + /* } else if (_1 === (25)) { */ case 10: + i$1 = 0; + /* while (true) { */ case 19: + /* if (!(i$1 < $clone(v, Value).NumField())) { break; } */ if(!(i$1 < $clone(v, Value).NumField())) { $s = 20; continue; } + _r$2 = $clone(v, Value).Field(i$1); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = $clone(_r$2, Value).IsZero(); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (!_r$3) { $s = 21; continue; } + /* */ $s = 22; continue; + /* if (!_r$3) { */ case 21: + $s = -1; return false; + /* } */ case 22: + i$1 = i$1 + (1) >> 0; + $s = 19; continue; + case 20: + $s = -1; return true; + /* } else { */ case 11: + $panic(new ValueError.ptr("reflect.Value.IsZero", $clone(v, Value).Kind())); + /* } */ case 12: + case 1: + $s = -1; return false; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.IsZero, $c: true, $r, _1, _r, _r$1, _r$2, _r$3, c, i, i$1, v, x, x$1, x$2, x$3, x$4, $s};return $f; + }; + Value.prototype.IsZero = function() { return this.$val.IsZero(); }; Value.ptr.prototype.Kind = function() { var v; v = this; @@ -16175,38 +15793,43 @@ $packages["reflect"] = (function() { }; Value.prototype.Kind = function() { return this.$val.Kind(); }; Value.ptr.prototype.MapIndex = function(key) { - var _r, c, e, fl, k, key, tt, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; e = $f.e; fl = $f.fl; k = $f.k; key = $f.key; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, e, fl, k, k$1, key, tt, typ, v, $s, $r, $c} = $restore(this, {key}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(21); tt = (v.typ.kindType); - _r = $clone(key, Value).assignTo("reflect.Value.MapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - key = _r; - k = 0; - if (!((((key.flag & 128) >>> 0) === 0))) { - k = key.ptr; - } else { - k = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$15(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); - } - e = mapaccess(v.typ, $clone(v, Value).pointer(), k); + e = 0; + /* */ if ((new flag(key.flag).kind() === 24) && (tt.key.Kind() === 24) && tt.elem.size <= 128) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((new flag(key.flag).kind() === 24) && (tt.key.Kind() === 24) && tt.elem.size <= 128) { */ case 1: + k = (key.ptr).$get(); + e = mapaccess_faststr(v.typ, $clone(v, Value).pointer(), k); + $s = 3; continue; + /* } else { */ case 2: + _r = $clone(key, Value).assignTo("reflect.Value.MapIndex", tt.key, 0); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + key = _r; + k$1 = 0; + if (!((((key.flag & 128) >>> 0) === 0))) { + k$1 = key.ptr; + } else { + k$1 = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); + } + e = mapaccess(v.typ, $clone(v, Value).pointer(), k$1); + /* } */ case 3: if (e === 0) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } typ = tt.elem; fl = new flag((((v.flag | key.flag) >>> 0))).ro(); fl = (fl | (((typ.Kind() >>> 0)))) >>> 0; - if (!ifaceIndir(typ)) { - $s = -1; return new Value.ptr(typ, (e).$get(), fl); - } - c = unsafe_New(typ); - typedmemmove(typ, c, e); - $s = -1; return new Value.ptr(typ, c, (fl | 128) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapIndex }; } $f._r = _r; $f.c = c; $f.e = e; $f.fl = fl; $f.k = k; $f.key = key; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $s = -1; return copyVal(typ, fl, e); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.MapIndex, $c: true, $r, _r, e, fl, k, k$1, key, tt, typ, v, $s};return $f; }; Value.prototype.MapIndex = function(key) { return this.$val.MapIndex(key); }; Value.ptr.prototype.MapKeys = function() { - var _r, a, c, fl, i, it, key, keyType, m, mlen, tt, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; c = $f.c; fl = $f.fl; i = $f.i; it = $f.it; key = $f.key; keyType = $f.keyType; m = $f.m; mlen = $f.mlen; tt = $f.tt; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, a, fl, i, it, key, keyType, m, mlen, tt, v, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + it = [it]; v = this; new flag(v.flag).mustBe(21); tt = (v.typ.kindType); @@ -16217,31 +15840,176 @@ $packages["reflect"] = (function() { if (!(m === 0)) { mlen = maplen(m); } - it = mapiterinit(v.typ, m); - a = $makeSlice(sliceType$9, mlen); + it[0] = new hiter.ptr($ifaceNil, null, null, 0, null); + mapiterinit(v.typ, m, it[0]); + a = $makeSlice(sliceType$7, mlen); i = 0; i = 0; /* while (true) { */ case 1: /* if (!(i < a.$length)) { break; } */ if(!(i < a.$length)) { $s = 2; continue; } - _r = mapiterkey(it); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r = mapiterkey(it[0]); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } key = _r; if (key === 0) { /* break; */ $s = 2; continue; } - if (ifaceIndir(keyType)) { - c = unsafe_New(keyType); - typedmemmove(keyType, c, key); - ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = new Value.ptr(keyType, c, (fl | 128) >>> 0)); - } else { - ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = new Value.ptr(keyType, (key).$get(), fl)); - } - mapiternext(it); + ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = copyVal(keyType, fl, key)); + mapiternext(it[0]); i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: + $s = 1; continue; + case 2: $s = -1; return $subslice(a, 0, i); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapKeys }; } $f._r = _r; $f.a = a; $f.c = c; $f.fl = fl; $f.i = i; $f.it = it; $f.key = key; $f.keyType = keyType; $f.m = m; $f.mlen = mlen; $f.tt = tt; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.MapKeys, $c: true, $r, _r, a, fl, i, it, key, keyType, m, mlen, tt, v, $s};return $f; }; Value.prototype.MapKeys = function() { return this.$val.MapKeys(); }; + hiter.ptr.prototype.initialized = function() { + var h; + h = this; + return !($interfaceIsEqual(h.t, $ifaceNil)); + }; + hiter.prototype.initialized = function() { return this.$val.initialized(); }; + MapIter.ptr.prototype.Key = function() { + var {_r, iter, iterkey, ktype, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + iter = this; + if (!iter.hiter.initialized()) { + $panic(new $String("MapIter.Key called before Next")); + } + _r = mapiterkey(iter.hiter); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + iterkey = _r; + if (iterkey === 0) { + $panic(new $String("MapIter.Key called on exhausted iterator")); + } + t = (iter.m.typ.kindType); + ktype = t.key; + $s = -1; return copyVal(ktype, (new flag(iter.m.flag).ro() | ((ktype.Kind() >>> 0))) >>> 0, iterkey); + /* */ } return; } var $f = {$blk: MapIter.ptr.prototype.Key, $c: true, $r, _r, iter, iterkey, ktype, t, $s};return $f; + }; + MapIter.prototype.Key = function() { return this.$val.Key(); }; + Value.ptr.prototype.SetIterKey = function(iter) { + var {_r, _r$1, iter, iterkey, key, ktype, t, target, v, $s, $r, $c} = $restore(this, {iter}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + if (!iter.hiter.initialized()) { + $panic(new $String("reflect: Value.SetIterKey called before Next")); + } + _r = mapiterkey(iter.hiter); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + iterkey = _r; + if (iterkey === 0) { + $panic(new $String("reflect: Value.SetIterKey called on exhausted iterator")); + } + new flag(v.flag).mustBeAssignable(); + target = 0; + if (new flag(v.flag).kind() === 20) { + target = v.ptr; + } + t = (iter.m.typ.kindType); + ktype = t.key; + key = new Value.ptr(ktype, iterkey, (((iter.m.flag | ((ktype.Kind() >>> 0))) >>> 0) | 128) >>> 0); + _r$1 = $clone(key, Value).assignTo("reflect.MapIter.SetKey", v.typ, target); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + key = _r$1; + typedmemmove(v.typ, v.ptr, key.ptr); + $s = -1; return; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.SetIterKey, $c: true, $r, _r, _r$1, iter, iterkey, key, ktype, t, target, v, $s};return $f; + }; + Value.prototype.SetIterKey = function(iter) { return this.$val.SetIterKey(iter); }; + MapIter.ptr.prototype.Value = function() { + var {_r, iter, iterelem, t, vtype, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + iter = this; + if (!iter.hiter.initialized()) { + $panic(new $String("MapIter.Value called before Next")); + } + _r = mapiterelem(iter.hiter); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + iterelem = _r; + if (iterelem === 0) { + $panic(new $String("MapIter.Value called on exhausted iterator")); + } + t = (iter.m.typ.kindType); + vtype = t.elem; + $s = -1; return copyVal(vtype, (new flag(iter.m.flag).ro() | ((vtype.Kind() >>> 0))) >>> 0, iterelem); + /* */ } return; } var $f = {$blk: MapIter.ptr.prototype.Value, $c: true, $r, _r, iter, iterelem, t, vtype, $s};return $f; + }; + MapIter.prototype.Value = function() { return this.$val.Value(); }; + Value.ptr.prototype.SetIterValue = function(iter) { + var {_r, _r$1, elem, iter, iterelem, t, target, v, vtype, $s, $r, $c} = $restore(this, {iter}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + if (!iter.hiter.initialized()) { + $panic(new $String("reflect: Value.SetIterValue called before Next")); + } + _r = mapiterelem(iter.hiter); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + iterelem = _r; + if (iterelem === 0) { + $panic(new $String("reflect: Value.SetIterValue called on exhausted iterator")); + } + new flag(v.flag).mustBeAssignable(); + target = 0; + if (new flag(v.flag).kind() === 20) { + target = v.ptr; + } + t = (iter.m.typ.kindType); + vtype = t.elem; + elem = new Value.ptr(vtype, iterelem, (((iter.m.flag | ((vtype.Kind() >>> 0))) >>> 0) | 128) >>> 0); + _r$1 = $clone(elem, Value).assignTo("reflect.MapIter.SetValue", v.typ, target); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + elem = _r$1; + typedmemmove(v.typ, v.ptr, elem.ptr); + $s = -1; return; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.SetIterValue, $c: true, $r, _r, _r$1, elem, iter, iterelem, t, target, v, vtype, $s};return $f; + }; + Value.prototype.SetIterValue = function(iter) { return this.$val.SetIterValue(iter); }; + MapIter.ptr.prototype.Next = function() { + var {$24r, _r, _r$1, iter, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + iter = this; + if (!$clone(iter.m, Value).IsValid()) { + $panic(new $String("MapIter.Next called on an iterator that does not have an associated map Value")); + } + /* */ if (!iter.hiter.initialized()) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!iter.hiter.initialized()) { */ case 1: + mapiterinit(iter.m.typ, $clone(iter.m, Value).pointer(), iter.hiter); + $s = 3; continue; + /* } else { */ case 2: + _r = mapiterkey(iter.hiter); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r === 0) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_r === 0) { */ case 4: + $panic(new $String("MapIter.Next called on exhausted iterator")); + /* } */ case 5: + mapiternext(iter.hiter); + /* } */ case 3: + _r$1 = mapiterkey(iter.hiter); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = !(_r$1 === 0); + $s = 8; case 8: return $24r; + /* */ } return; } var $f = {$blk: MapIter.ptr.prototype.Next, $c: true, $r, $24r, _r, _r$1, iter, $s};return $f; + }; + MapIter.prototype.Next = function() { return this.$val.Next(); }; + MapIter.ptr.prototype.Reset = function(v) { + var iter, v; + iter = this; + if ($clone(v, Value).IsValid()) { + new flag(v.flag).mustBe(21); + } + iter.m = v; + hiter.copy(iter.hiter, new hiter.ptr($ifaceNil, null, null, 0, null)); + }; + MapIter.prototype.Reset = function(v) { return this.$val.Reset(v); }; + Value.ptr.prototype.MapRange = function() { + var v; + v = this; + new flag(v.flag).mustBe(21); + return new MapIter.ptr($clone(v, Value), new hiter.ptr($ifaceNil, null, null, 0, null)); + }; + Value.prototype.MapRange = function() { return this.$val.MapRange(); }; + copyVal = function(typ, fl, ptr) { + var c, fl, ptr, typ; + if (ifaceIndir(typ)) { + c = unsafe_New(typ); + typedmemmove(typ, c, ptr); + return new Value.ptr(typ, c, (fl | 128) >>> 0); + } + return new Value.ptr(typ, (ptr).$get(), fl); + }; Value.ptr.prototype.Method = function(i) { var fl, i, v; v = this; @@ -16254,7 +16022,7 @@ $packages["reflect"] = (function() { if ((v.typ.Kind() === 20) && $clone(v, Value).IsNil()) { $panic(new $String("reflect: Method on nil interface value")); } - fl = (v.flag & 160) >>> 0; + fl = (new flag(v.flag).ro() | (((v.flag & 128) >>> 0))) >>> 0; fl = (fl | (19)) >>> 0; fl = (fl | ((((((i >>> 0)) << 10 >>> 0) | 512) >>> 0))) >>> 0; return new Value.ptr(v.typ, v.ptr, fl); @@ -16273,8 +16041,8 @@ $packages["reflect"] = (function() { }; Value.prototype.NumMethod = function() { return this.$val.NumMethod(); }; Value.ptr.prototype.MethodByName = function(name$1) { - var _r, _tuple, m, name$1, ok, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; m = $f.m; name$1 = $f.name$1; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, _tuple, m, name$1, ok, v, $s, $r, $c} = $restore(this, {name$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; if (v.typ === ptrType$1.nil) { $panic(new ValueError.ptr("reflect.Value.MethodByName", 0)); @@ -16290,7 +16058,7 @@ $packages["reflect"] = (function() { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } $s = -1; return $clone(v, Value).Method(m.Index); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MethodByName }; } $f._r = _r; $f._tuple = _tuple; $f.m = m; $f.name$1 = name$1; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.MethodByName, $c: true, $r, _r, _tuple, m, name$1, ok, v, $s};return $f; }; Value.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; Value.ptr.prototype.NumField = function() { @@ -16361,8 +16129,8 @@ $packages["reflect"] = (function() { }; Value.prototype.OverflowUint = function(x) { return this.$val.OverflowUint(x); }; Value.ptr.prototype.Recv = function() { - var _r, _tuple, ok, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _tuple, ok, v, x, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: x = new Value.ptr(ptrType$1.nil, 0, 0); ok = false; v = this; @@ -16372,13 +16140,14 @@ $packages["reflect"] = (function() { _tuple = _r; x = _tuple[0]; ok = _tuple[1]; - $s = -1; return [x, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Recv }; } $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + $24r = [x, ok]; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Recv, $c: true, $r, $24r, _r, _tuple, ok, v, x, $s};return $f; }; Value.prototype.Recv = function() { return this.$val.Recv(); }; Value.ptr.prototype.recv = function(nb) { - var _r, _tuple, nb, ok, p, selected, t, tt, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; nb = $f.nb; ok = $f.ok; p = $f.p; selected = $f.selected; t = $f.t; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, _tuple, nb, ok, p, selected, t, tt, v, val, $s, $r, $c} = $restore(this, {nb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: val = new Value.ptr(ptrType$1.nil, 0, 0); ok = false; v = this; @@ -16394,7 +16163,7 @@ $packages["reflect"] = (function() { val.ptr = p; val.flag = (val.flag | (128)) >>> 0; } else { - p = ((val.$ptr_ptr || (val.$ptr_ptr = new ptrType$15(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val)))); + p = ((val.$ptr_ptr || (val.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val)))); } _r = chanrecv($clone(v, Value).pointer(), nb, p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; @@ -16404,24 +16173,24 @@ $packages["reflect"] = (function() { val = new Value.ptr(ptrType$1.nil, 0, 0); } $s = -1; return [val, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.recv }; } $f._r = _r; $f._tuple = _tuple; $f.nb = nb; $f.ok = ok; $f.p = p; $f.selected = selected; $f.t = t; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.recv, $c: true, $r, _r, _tuple, nb, ok, p, selected, t, tt, v, val, $s};return $f; }; Value.prototype.recv = function(nb) { return this.$val.recv(nb); }; Value.ptr.prototype.Send = function(x) { - var _r, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, v, x, $s, $r, $c} = $restore(this, {x}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).send($clone(x, Value), false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Send }; } $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Send, $c: true, $r, _r, v, x, $s};return $f; }; Value.prototype.Send = function(x) { return this.$val.Send(x); }; Value.ptr.prototype.send = function(x, nb) { - var _r, _r$1, nb, p, selected, tt, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; nb = $f.nb; p = $f.p; selected = $f.selected; tt = $f.tt; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _r$1, nb, p, selected, tt, v, x, $s, $r, $c} = $restore(this, {x, nb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: selected = false; v = this; tt = (v.typ.kindType); @@ -16435,12 +16204,13 @@ $packages["reflect"] = (function() { if (!((((x.flag & 128) >>> 0) === 0))) { p = x.ptr; } else { - p = ((x.$ptr_ptr || (x.$ptr_ptr = new ptrType$15(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, x)))); + p = ((x.$ptr_ptr || (x.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, x)))); } _r$1 = chansend($clone(v, Value).pointer(), p, nb); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } selected = _r$1; - $s = -1; return selected; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.send }; } $f._r = _r; $f._r$1 = _r$1; $f.nb = nb; $f.p = p; $f.selected = selected; $f.tt = tt; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + $24r = selected; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.send, $c: true, $r, $24r, _r, _r$1, nb, p, selected, tt, v, x, $s};return $f; }; Value.prototype.send = function(x, nb) { return this.$val.send(x, nb); }; Value.ptr.prototype.SetBool = function(x) { @@ -16452,8 +16222,8 @@ $packages["reflect"] = (function() { }; Value.prototype.SetBool = function(x) { return this.$val.SetBool(x); }; Value.ptr.prototype.setRunes = function(x) { - var _r, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, v, x, $s, $r, $c} = $restore(this, {x}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(23); @@ -16465,7 +16235,7 @@ $packages["reflect"] = (function() { /* } */ case 2: (v.ptr).$set(x); $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.setRunes }; } $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.setRunes, $c: true, $r, _r, v, x, $s};return $f; }; Value.prototype.setRunes = function(x) { return this.$val.setRunes(x); }; Value.ptr.prototype.SetComplex = function(x) { @@ -16519,40 +16289,60 @@ $packages["reflect"] = (function() { } }; Value.prototype.SetInt = function(x) { return this.$val.SetInt(x); }; - Value.ptr.prototype.SetMapIndex = function(key, val) { - var _r, _r$1, e, k, key, tt, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; e = $f.e; k = $f.k; key = $f.key; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + Value.ptr.prototype.SetMapIndex = function(key, elem) { + var {_r, _r$1, _r$2, e, e$1, elem, k, k$1, key, tt, v, $s, $r, $c} = $restore(this, {key, elem}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(21); new flag(v.flag).mustBeExported(); new flag(key.flag).mustBeExported(); tt = (v.typ.kindType); - _r = $clone(key, Value).assignTo("reflect.Value.SetMapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - key = _r; - k = 0; + /* */ if ((new flag(key.flag).kind() === 24) && (tt.key.Kind() === 24) && tt.elem.size <= 128) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((new flag(key.flag).kind() === 24) && (tt.key.Kind() === 24) && tt.elem.size <= 128) { */ case 1: + k = (key.ptr).$get(); + if (elem.typ === ptrType$1.nil) { + mapdelete_faststr(v.typ, $clone(v, Value).pointer(), k); + $s = -1; return; + } + new flag(elem.flag).mustBeExported(); + _r = $clone(elem, Value).assignTo("reflect.Value.SetMapIndex", tt.elem, 0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + elem = _r; + e = 0; + if (!((((elem.flag & 128) >>> 0) === 0))) { + e = elem.ptr; + } else { + e = ((elem.$ptr_ptr || (elem.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, elem)))); + } + $r = mapassign_faststr(v.typ, $clone(v, Value).pointer(), k, e); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* } */ case 2: + _r$1 = $clone(key, Value).assignTo("reflect.Value.SetMapIndex", tt.key, 0); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + key = _r$1; + k$1 = 0; if (!((((key.flag & 128) >>> 0) === 0))) { - k = key.ptr; + k$1 = key.ptr; } else { - k = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$15(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); + k$1 = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); } - if (val.typ === ptrType$1.nil) { - mapdelete(v.typ, $clone(v, Value).pointer(), k); + if (elem.typ === ptrType$1.nil) { + mapdelete(v.typ, $clone(v, Value).pointer(), k$1); $s = -1; return; } - new flag(val.flag).mustBeExported(); - _r$1 = $clone(val, Value).assignTo("reflect.Value.SetMapIndex", tt.elem, 0); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - val = _r$1; - e = 0; - if (!((((val.flag & 128) >>> 0) === 0))) { - e = val.ptr; + new flag(elem.flag).mustBeExported(); + _r$2 = $clone(elem, Value).assignTo("reflect.Value.SetMapIndex", tt.elem, 0); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + elem = _r$2; + e$1 = 0; + if (!((((elem.flag & 128) >>> 0) === 0))) { + e$1 = elem.ptr; } else { - e = ((val.$ptr_ptr || (val.$ptr_ptr = new ptrType$15(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val)))); + e$1 = ((elem.$ptr_ptr || (elem.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, elem)))); } - $r = mapassign(v.typ, $clone(v, Value).pointer(), k, e); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = mapassign(v.typ, $clone(v, Value).pointer(), k$1, e$1); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetMapIndex }; } $f._r = _r; $f._r$1 = _r$1; $f.e = e; $f.k = k; $f.key = key; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.SetMapIndex, $c: true, $r, _r, _r$1, _r$2, e, e$1, elem, k, k$1, key, tt, v, $s};return $f; }; - Value.prototype.SetMapIndex = function(key, val) { return this.$val.SetMapIndex(key, val); }; + Value.prototype.SetMapIndex = function(key, elem) { return this.$val.SetMapIndex(key, elem); }; Value.ptr.prototype.SetUint = function(x) { var _1, k, v, x; v = this; @@ -16593,8 +16383,8 @@ $packages["reflect"] = (function() { }; Value.prototype.SetString = function(x) { return this.$val.SetString(x); }; Value.ptr.prototype.String = function() { - var _1, _r, k, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; k = $f.k; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _1, _r, k, v, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; k = new flag(v.flag).kind(); _1 = k; @@ -16604,13 +16394,14 @@ $packages["reflect"] = (function() { $s = -1; return (v.ptr).$get(); } _r = $clone(v, Value).Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return "<" + _r + " Value>"; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.String }; } $f._1 = _1; $f._r = _r; $f.k = k; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = "<" + _r + " Value>"; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.String, $c: true, $r, $24r, _1, _r, k, v, $s};return $f; }; Value.prototype.String = function() { return this.$val.String(); }; Value.ptr.prototype.TryRecv = function() { - var _r, _tuple, ok, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _tuple, ok, v, x, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: x = new Value.ptr(ptrType$1.nil, 0, 0); ok = false; v = this; @@ -16620,19 +16411,21 @@ $packages["reflect"] = (function() { _tuple = _r; x = _tuple[0]; ok = _tuple[1]; - $s = -1; return [x, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TryRecv }; } $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + $24r = [x, ok]; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.TryRecv, $c: true, $r, $24r, _r, _tuple, ok, v, x, $s};return $f; }; Value.prototype.TryRecv = function() { return this.$val.TryRecv(); }; Value.ptr.prototype.TrySend = function(x) { - var _r, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, v, x, $s, $r, $c} = $restore(this, {x}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).send($clone(x, Value), true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TrySend }; } $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.TrySend, $c: true, $r, $24r, _r, v, x, $s};return $f; }; Value.prototype.TrySend = function(x) { return this.$val.TrySend(x); }; Value.ptr.prototype.Type = function() { @@ -16662,6 +16455,17 @@ $packages["reflect"] = (function() { return v.typ.typeOff(m$1.mtyp); }; Value.prototype.Type = function() { return this.$val.Type(); }; + Value.ptr.prototype.CanUint = function() { + var _1, v; + v = this; + _1 = new flag(v.flag).kind(); + if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { + return true; + } else { + return false; + } + }; + Value.prototype.CanUint = function() { return this.$val.CanUint(); }; Value.ptr.prototype.Uint = function() { var _1, k, p, v, x; v = this; @@ -16696,20 +16500,53 @@ $packages["reflect"] = (function() { return (v.ptr); }; Value.prototype.UnsafeAddr = function() { return this.$val.UnsafeAddr(); }; - New = function(typ) { - var fl, ptr, t, typ; - if ($interfaceIsEqual(typ, $ifaceNil)) { - $panic(new $String("reflect: New(nil)")); - } - t = $assertType(typ, ptrType$1); - ptr = unsafe_New(t); - fl = 22; - return new Value.ptr(t.ptrTo(), ptr, fl); + Value.ptr.prototype.UnsafePointer = function() { + var {_1, _r, code, k, p, v, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + code = [code]; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + /* */ if (_1 === (22)) { $s = 2; continue; } + /* */ if ((_1 === (18)) || (_1 === (21)) || (_1 === (26))) { $s = 3; continue; } + /* */ if (_1 === (19)) { $s = 4; continue; } + /* */ if (_1 === (23)) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_1 === (22)) { */ case 2: + if (v.typ.ptrdata === 0) { + if (!verifyNotInHeapPtr((v.ptr).$get())) { + $panic(new $String("reflect: reflect.Value.UnsafePointer on an invalid notinheap pointer")); + } + $s = -1; return (v.ptr).$get(); + } + $s = -1; return $clone(v, Value).pointer(); + /* } else if ((_1 === (18)) || (_1 === (21)) || (_1 === (26))) { */ case 3: + $s = -1; return $clone(v, Value).pointer(); + /* } else if (_1 === (19)) { */ case 4: + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 7: + _r = methodValueCallCodePtr(); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + code[0] = _r; + $s = -1; return code[0]; + /* } */ case 8: + p = $clone(v, Value).pointer(); + if (!(p === 0)) { + p = (p).$get(); + } + $s = -1; return p; + /* } else if (_1 === (23)) { */ case 5: + $s = -1; return ($pointerOfStructConversion(v.ptr, ptrType$8)).Data; + /* } */ case 6: + case 1: + $panic(new ValueError.ptr("reflect.Value.UnsafePointer", new flag(v.flag).kind())); + $s = -1; return 0; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.UnsafePointer, $c: true, $r, _1, _r, code, k, p, v, $s};return $f; }; - $pkg.New = New; + Value.prototype.UnsafePointer = function() { return this.$val.UnsafePointer(); }; Value.ptr.prototype.Convert = function(t) { - var _r, _r$1, _r$2, _r$3, _r$4, op, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; op = $f.op; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _r$1, _r$2, _r$3, _r$4, op, t, v, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: v = this; /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; @@ -16727,13 +16564,47 @@ $packages["reflect"] = (function() { $panic(new $String("reflect.Value.Convert: value of type " + v.typ.String() + " cannot be converted to type " + _r$3)); /* } */ case 7: _r$4 = op($clone(v, Value), t); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - $s = -1; return _r$4; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Convert }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.op = op; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r$4; + $s = 10; case 10: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Convert, $c: true, $r, $24r, _r, _r$1, _r$2, _r$3, _r$4, op, t, v, $s};return $f; }; Value.prototype.Convert = function(t) { return this.$val.Convert(t); }; + Value.ptr.prototype.CanConvert = function(t) { + var {_r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, _v$1, n, t, v, vt, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + vt = $clone(v, Value).Type(); + _r = vt.ConvertibleTo(t); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!_r) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!_r) { */ case 1: + $s = -1; return false; + /* } */ case 2: + _r$1 = vt.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + if (!(_r$1 === 23)) { _v$1 = false; $s = 7; continue s; } + _r$2 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$1 = _r$2 === 22; case 7: + if (!(_v$1)) { _v = false; $s = 6; continue s; } + _r$3 = t.Elem(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$4 = _r$3.Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _v = _r$4 === 17; case 6: + /* */ if (_v) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_v) { */ case 4: + _r$5 = t.Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _r$6 = _r$5.Len(); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + n = _r$6; + if (n > $clone(v, Value).Len()) { + $s = -1; return false; + } + /* } */ case 5: + $s = -1; return true; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.CanConvert, $c: true, $r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, _v$1, n, t, v, vt, $s};return $f; + }; + Value.prototype.CanConvert = function(t) { return this.$val.CanConvert(t); }; convertOp = function(dst, src) { - var _1, _2, _3, _4, _5, _6, _7, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _v, _v$1, _v$2, dst, src, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _5 = $f._5; _6 = $f._6; _7 = $f._7; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; dst = $f.dst; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _2, _3, _4, _5, _6, _7, _arg, _arg$1, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, _v$1, _v$2, _v$3, _v$4, _v$5, dst, src, $s, $r, $c} = $restore(this, {dst, src}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _1 = src.Kind(); /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 2; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 3; continue; } @@ -16741,7 +16612,8 @@ $packages["reflect"] = (function() { /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 5; continue; } /* */ if (_1 === (24)) { $s = 6; continue; } /* */ if (_1 === (23)) { $s = 7; continue; } - /* */ $s = 8; continue; + /* */ if (_1 === (18)) { $s = 8; continue; } + /* */ $s = 9; continue; /* if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 2: _2 = dst.Kind(); if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6)) || (_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { @@ -16751,7 +16623,7 @@ $packages["reflect"] = (function() { } else if (_2 === (24)) { $s = -1; return cvtIntString; } - $s = 8; continue; + $s = 9; continue; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 3: _3 = dst.Kind(); if ((_3 === (2)) || (_3 === (3)) || (_3 === (4)) || (_3 === (5)) || (_3 === (6)) || (_3 === (7)) || (_3 === (8)) || (_3 === (9)) || (_3 === (10)) || (_3 === (11)) || (_3 === (12))) { @@ -16761,7 +16633,7 @@ $packages["reflect"] = (function() { } else if (_3 === (24)) { $s = -1; return cvtUintString; } - $s = 8; continue; + $s = 9; continue; /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 4: _4 = dst.Kind(); if ((_4 === (2)) || (_4 === (3)) || (_4 === (4)) || (_4 === (5)) || (_4 === (6))) { @@ -16771,66 +16643,87 @@ $packages["reflect"] = (function() { } else if ((_4 === (13)) || (_4 === (14))) { $s = -1; return cvtFloat; } - $s = 8; continue; + $s = 9; continue; /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 5: _5 = dst.Kind(); if ((_5 === (15)) || (_5 === (16))) { $s = -1; return cvtComplex; } - $s = 8; continue; + $s = 9; continue; /* } else if (_1 === (24)) { */ case 6: - if (!(dst.Kind() === 23)) { _v = false; $s = 11; continue s; } - _r = dst.Elem().PkgPath(); /* */ $s = 12; case 12: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r === ""; case 11: - /* */ if (_v) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_v) { */ case 9: - _r$1 = dst.Elem().Kind(); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + if (!(dst.Kind() === 23)) { _v = false; $s = 12; continue s; } + _r = dst.Elem().PkgPath(); /* */ $s = 13; case 13: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r === ""; case 12: + /* */ if (_v) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (_v) { */ case 10: + _r$1 = dst.Elem().Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _6 = _r$1; if (_6 === (8)) { $s = -1; return cvtStringBytes; } else if (_6 === (5)) { $s = -1; return cvtStringRunes; } - case 13: - /* } */ case 10: - $s = 8; continue; + case 14: + /* } */ case 11: + $s = 9; continue; /* } else if (_1 === (23)) { */ case 7: - if (!(dst.Kind() === 24)) { _v$1 = false; $s = 17; continue s; } - _r$2 = src.Elem().PkgPath(); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v$1 = _r$2 === ""; case 17: - /* */ if (_v$1) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if (_v$1) { */ case 15: - _r$3 = src.Elem().Kind(); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + if (!(dst.Kind() === 24)) { _v$1 = false; $s = 18; continue s; } + _r$2 = src.Elem().PkgPath(); /* */ $s = 19; case 19: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$1 = _r$2 === ""; case 18: + /* */ if (_v$1) { $s = 16; continue; } + /* */ $s = 17; continue; + /* if (_v$1) { */ case 16: + _r$3 = src.Elem().Kind(); /* */ $s = 21; case 21: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _7 = _r$3; if (_7 === (8)) { $s = -1; return cvtBytesString; } else if (_7 === (5)) { $s = -1; return cvtRunesString; } - case 19: - /* } */ case 16: - /* } */ case 8: + case 20: + /* } */ case 17: + if (!(dst.Kind() === 22)) { _v$3 = false; $s = 25; continue s; } + _r$4 = dst.Elem().Kind(); /* */ $s = 26; case 26: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _v$3 = _r$4 === 17; case 25: + if (!(_v$3)) { _v$2 = false; $s = 24; continue s; } + _r$5 = dst.Elem().Elem(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _v$2 = $interfaceIsEqual(src.Elem(), _r$5); case 24: + /* */ if (_v$2) { $s = 22; continue; } + /* */ $s = 23; continue; + /* if (_v$2) { */ case 22: + $s = -1; return cvtSliceArrayPtr; + /* } */ case 23: + $s = 9; continue; + /* } else if (_1 === (18)) { */ case 8: + if (!(dst.Kind() === 18)) { _v$4 = false; $s = 30; continue s; } + _r$6 = specialChannelAssignability(dst, src); /* */ $s = 31; case 31: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _v$4 = _r$6; case 30: + /* */ if (_v$4) { $s = 28; continue; } + /* */ $s = 29; continue; + /* if (_v$4) { */ case 28: + $s = -1; return cvtDirect; + /* } */ case 29: + /* } */ case 9: case 1: - _r$4 = haveIdenticalUnderlyingType(dst, src, false); /* */ $s = 23; case 23: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ if (_r$4) { $s = 21; continue; } - /* */ $s = 22; continue; - /* if (_r$4) { */ case 21: + _r$7 = haveIdenticalUnderlyingType(dst, src, false); /* */ $s = 34; case 34: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + /* */ if (_r$7) { $s = 32; continue; } + /* */ $s = 33; continue; + /* if (_r$7) { */ case 32: $s = -1; return cvtDirect; - /* } */ case 22: - if (!((dst.Kind() === 22) && dst.Name() === "" && (src.Kind() === 22) && src.Name() === "")) { _v$2 = false; $s = 26; continue s; } - _r$5 = dst.Elem().common(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _arg = _r$5; - _r$6 = src.Elem().common(); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _arg$1 = _r$6; - _r$7 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 29; case 29: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - _v$2 = _r$7; case 26: - /* */ if (_v$2) { $s = 24; continue; } - /* */ $s = 25; continue; - /* if (_v$2) { */ case 24: + /* } */ case 33: + if (!((dst.Kind() === 22) && dst.Name() === "" && (src.Kind() === 22) && src.Name() === "")) { _v$5 = false; $s = 37; continue s; } + _r$8 = dst.Elem().common(); /* */ $s = 38; case 38: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + _arg = _r$8; + _r$9 = src.Elem().common(); /* */ $s = 39; case 39: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + _arg$1 = _r$9; + _r$10 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 40; case 40: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _v$5 = _r$10; case 37: + /* */ if (_v$5) { $s = 35; continue; } + /* */ $s = 36; continue; + /* if (_v$5) { */ case 35: $s = -1; return cvtDirect; - /* } */ case 25: + /* } */ case 36: if (implements$1(dst, src)) { if (src.Kind() === 20) { $s = -1; return cvtI2I; @@ -16838,11 +16731,11 @@ $packages["reflect"] = (function() { $s = -1; return cvtT2I; } $s = -1; return $throwNilPointerError; - /* */ } return; } if ($f === undefined) { $f = { $blk: convertOp }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._5 = _5; $f._6 = _6; $f._7 = _7; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f.dst = dst; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: convertOp, $c: true, $r, _1, _2, _3, _4, _5, _6, _7, _arg, _arg$1, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, _v$1, _v$2, _v$3, _v$4, _v$5, dst, src, $s};return $f; }; makeFloat = function(f, v, t) { - var _1, _r, f, ptr, t, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _r, f, ptr, t, typ, v, $s, $r, $c} = $restore(this, {f, v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } typ = _r; ptr = unsafe_New(typ); @@ -16853,11 +16746,21 @@ $packages["reflect"] = (function() { (ptr).$set(v); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeFloat }; } $f._1 = _1; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: makeFloat, $c: true, $r, _1, _r, f, ptr, t, typ, v, $s};return $f; + }; + makeFloat32 = function(f, v, t) { + var {_r, f, ptr, t, typ, v, $s, $r, $c} = $restore(this, {f, v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + typ = _r; + ptr = unsafe_New(typ); + (ptr).$set(v); + $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); + /* */ } return; } var $f = {$blk: makeFloat32, $c: true, $r, _r, f, ptr, t, typ, v, $s};return $f; }; makeComplex = function(f, v, t) { - var _1, _r, f, ptr, t, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _r, f, ptr, t, typ, v, $s, $r, $c} = $restore(this, {f, v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } typ = _r; ptr = unsafe_New(typ); @@ -16868,155 +16771,190 @@ $packages["reflect"] = (function() { (ptr).$set(v); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeComplex }; } $f._1 = _1; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: makeComplex, $c: true, $r, _1, _r, f, ptr, t, typ, v, $s};return $f; }; makeString = function(f, v, t) { - var _r, f, ret, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, f, ret, t, v, $s, $r, $c} = $restore(this, {f, v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $clone(ret, Value).SetString(v); ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; - /* */ } return; } if ($f === undefined) { $f = { $blk: makeString }; } $f._r = _r; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: makeString, $c: true, $r, _r, f, ret, t, v, $s};return $f; }; makeBytes = function(f, v, t) { - var _r, f, ret, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, f, ret, t, v, $s, $r, $c} = $restore(this, {f, v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $r = $clone(ret, Value).SetBytes(v); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; - /* */ } return; } if ($f === undefined) { $f = { $blk: makeBytes }; } $f._r = _r; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: makeBytes, $c: true, $r, _r, f, ret, t, v, $s};return $f; }; makeRunes = function(f, v, t) { - var _r, f, ret, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, f, ret, t, v, $s, $r, $c} = $restore(this, {f, v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $r = $clone(ret, Value).setRunes(v); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; - /* */ } return; } if ($f === undefined) { $f = { $blk: makeRunes }; } $f._r = _r; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: makeRunes, $c: true, $r, _r, f, ret, t, v, $s};return $f; }; cvtInt = function(v, t) { - var _r, t, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, t, v, x, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), ((x = $clone(v, Value).Int(), new $Uint64(x.$high, x.$low))), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtInt }; } $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtInt, $c: true, $r, $24r, _r, t, v, x, $s};return $f; }; cvtUint = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), $clone(v, Value).Uint(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUint }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtUint, $c: true, $r, $24r, _r, t, v, $s};return $f; }; cvtFloatInt = function(v, t) { - var _r, t, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, t, v, x, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), ((x = (new $Int64(0, $clone(v, Value).Float())), new $Uint64(x.$high, x.$low))), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatInt }; } $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtFloatInt, $c: true, $r, $24r, _r, t, v, x, $s};return $f; }; cvtFloatUint = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), (new $Uint64(0, $clone(v, Value).Float())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatUint }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtFloatUint, $c: true, $r, $24r, _r, t, v, $s};return $f; }; cvtIntFloat = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = makeFloat(new flag(v.flag).ro(), ($flatten64($clone(v, Value).Int())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntFloat }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtIntFloat, $c: true, $r, $24r, _r, t, v, $s};return $f; }; cvtUintFloat = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = makeFloat(new flag(v.flag).ro(), ($flatten64($clone(v, Value).Uint())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintFloat }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtUintFloat, $c: true, $r, $24r, _r, t, v, $s};return $f; }; cvtFloat = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = makeFloat(new flag(v.flag).ro(), $clone(v, Value).Float(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloat }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + var {$24r, $24r$1, _r, _r$1, _r$2, _r$3, _v, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = $clone(v, Value).Type().Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + if (!(_r === 13)) { _v = false; $s = 3; continue s; } + _r$1 = t.Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = _r$1 === 13; case 3: + /* */ if (_v) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_v) { */ case 1: + _r$2 = makeFloat32(new flag(v.flag).ro(), (v.ptr).$get(), t); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2; + $s = 7; case 7: return $24r; + /* } */ case 2: + _r$3 = makeFloat(new flag(v.flag).ro(), $clone(v, Value).Float(), t); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r$1 = _r$3; + $s = 9; case 9: return $24r$1; + /* */ } return; } var $f = {$blk: cvtFloat, $c: true, $r, $24r, $24r$1, _r, _r$1, _r$2, _r$3, _v, t, v, $s};return $f; }; cvtComplex = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = makeComplex(new flag(v.flag).ro(), $clone(v, Value).Complex(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtComplex }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtComplex, $c: true, $r, $24r, _r, t, v, $s};return $f; }; cvtIntString = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = makeString(new flag(v.flag).ro(), ($encodeRune($clone(v, Value).Int().$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntString }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + var {$24r, _r, s, t, v, x, x$1, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + s = "\xEF\xBF\xBD"; + x = $clone(v, Value).Int(); + if ((x$1 = (new $Int64(0, (((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)))), (x$1.$high === x.$high && x$1.$low === x.$low))) { + s = ($encodeRune((((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)))); + } + _r = makeString(new flag(v.flag).ro(), s, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtIntString, $c: true, $r, $24r, _r, s, t, v, x, x$1, $s};return $f; }; cvtUintString = function(v, t) { - var _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = makeString(new flag(v.flag).ro(), ($encodeRune($clone(v, Value).Uint().$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintString }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + var {$24r, _r, s, t, v, x, x$1, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + s = "\xEF\xBF\xBD"; + x = $clone(v, Value).Uint(); + if ((x$1 = (new $Uint64(0, ((x.$low >> 0)))), (x$1.$high === x.$high && x$1.$low === x.$low))) { + s = ($encodeRune(((x.$low >> 0)))); + } + _r = makeString(new flag(v.flag).ro(), s, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: cvtUintString, $c: true, $r, $24r, _r, s, t, v, x, x$1, $s};return $f; }; cvtBytesString = function(v, t) { - var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).Bytes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = ($bytesToString(_r)); _arg$2 = t; _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtBytesString }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r$1; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: cvtBytesString, $c: true, $r, $24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s};return $f; }; cvtStringBytes = function(v, t) { - var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _arg$1 = (new sliceType$15($stringToBytes(_r))); + _arg$1 = (new sliceType$9($stringToBytes(_r))); _arg$2 = t; _r$1 = makeBytes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringBytes }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r$1; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: cvtStringBytes, $c: true, $r, $24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s};return $f; }; cvtRunesString = function(v, t) { - var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).runes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = ($runesToString(_r)); _arg$2 = t; _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtRunesString }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r$1; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: cvtRunesString, $c: true, $r, $24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s};return $f; }; cvtStringRunes = function(v, t) { - var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _arg$1 = (new sliceType$17($stringToRunes(_r))); + _arg$1 = (new sliceType$10($stringToRunes(_r))); _arg$2 = t; _r$1 = makeRunes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringRunes }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r$1; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: cvtStringRunes, $c: true, $r, $24r, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s};return $f; }; cvtT2I = function(v, typ) { - var _r, _r$1, _r$2, _r$3, _r$4, target, typ, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; target = $f.target; typ = $f.typ; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _r$1, _r$2, _r$3, _r$4, target, typ, v, x, $s, $r, $c} = $restore(this, {v, typ}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = typ.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = unsafe_New(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } target = _r$1; @@ -17032,12 +16970,13 @@ $packages["reflect"] = (function() { ifaceE2I($assertType(typ, ptrType$1), x, target); /* } */ case 6: _r$4 = typ.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - $s = -1; return new Value.ptr(_r$4, target, (((new flag(v.flag).ro() | 128) >>> 0) | 20) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtT2I }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.target = target; $f.typ = typ; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + $24r = new Value.ptr(_r$4, target, (((new flag(v.flag).ro() | 128) >>> 0) | 20) >>> 0); + $s = 9; case 9: return $24r; + /* */ } return; } var $f = {$blk: cvtT2I, $c: true, $r, $24r, _r, _r$1, _r$2, _r$3, _r$4, target, typ, v, x, $s};return $f; }; cvtI2I = function(v, typ) { - var _r, _r$1, _r$2, ret, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; ret = $f.ret; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {$24r, _r, _r$1, _r$2, ret, typ, v, $s, $r, $c} = $restore(this, {v, typ}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: /* */ if ($clone(v, Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, Value).IsNil()) { */ case 1: @@ -17048,75 +16987,7697 @@ $packages["reflect"] = (function() { /* } */ case 2: _r$1 = $clone(v, Value).Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = cvtT2I($clone(_r$1, Value), typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $s = -1; return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtI2I }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ret = ret; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + $24r = _r$2; + $s = 6; case 6: return $24r; + /* */ } return; } var $f = {$blk: cvtI2I, $c: true, $r, $24r, _r, _r$1, _r$2, ret, typ, v, $s};return $f; }; - ptrType$5.methods = [{prop: "methods", name: "methods", pkg: "reflect", typ: $funcType([], [sliceType$5], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$5], false)}]; - ptrType$16.methods = [{prop: "in$", name: "in", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}, {prop: "out", name: "out", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}]; - name.methods = [{prop: "name", name: "name", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "tag", name: "tag", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "isExported", name: "isExported", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "data", name: "data", pkg: "reflect", typ: $funcType([$Int, $String], [ptrType$4], false)}, {prop: "nameLen", name: "nameLen", pkg: "reflect", typ: $funcType([], [$Int], false)}, {prop: "tagLen", name: "tagLen", pkg: "reflect", typ: $funcType([], [$Int], false)}]; + structField.ptr.prototype.offset = function() { + var f; + f = this; + return f.offsetEmbed >>> 1 >>> 0; + }; + structField.prototype.offset = function() { return this.$val.offset(); }; + structField.ptr.prototype.embedded = function() { + var f; + f = this; + return !((((f.offsetEmbed & 1) >>> 0) === 0)); + }; + structField.prototype.embedded = function() { return this.$val.embedded(); }; + Method.ptr.prototype.IsExported = function() { + var m; + m = this; + return m.PkgPath === ""; + }; + Method.prototype.IsExported = function() { return this.$val.IsExported(); }; + Kind.prototype.String = function() { + var k; + k = this.$val; + if (((k >> 0)) < kindNames.$length) { + return ((k < 0 || k >= kindNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + k]); + } + return "kind" + strconv.Itoa(((k >> 0))); + }; + $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; + rtype.ptr.prototype.String = function() { + var s, t; + t = this; + s = $clone(t.nameOff(t.str), name).name(); + if (!((((t.tflag & 2) >>> 0) === 0))) { + return $substring(s, 1); + } + return s; + }; + rtype.prototype.String = function() { return this.$val.String(); }; + rtype.ptr.prototype.Size = function() { + var t; + t = this; + return t.size; + }; + rtype.prototype.Size = function() { return this.$val.Size(); }; + rtype.ptr.prototype.Bits = function() { + var k, t; + t = this; + if (t === ptrType$1.nil) { + $panic(new $String("reflect: Bits of nil Type")); + } + k = t.Kind(); + if (k < 2 || k > 16) { + $panic(new $String("reflect: Bits of non-arithmetic Type " + t.String())); + } + return $imul(((t.size >> 0)), 8); + }; + rtype.prototype.Bits = function() { return this.$val.Bits(); }; + rtype.ptr.prototype.Align = function() { + var t; + t = this; + return ((t.align >> 0)); + }; + rtype.prototype.Align = function() { return this.$val.Align(); }; + rtype.ptr.prototype.FieldAlign = function() { + var t; + t = this; + return ((t.fieldAlign >> 0)); + }; + rtype.prototype.FieldAlign = function() { return this.$val.FieldAlign(); }; + rtype.ptr.prototype.Kind = function() { + var t; + t = this; + return ((((t.kind & 31) >>> 0) >>> 0)); + }; + rtype.prototype.Kind = function() { return this.$val.Kind(); }; + rtype.ptr.prototype.common = function() { + var t; + t = this; + return t; + }; + rtype.prototype.common = function() { return this.$val.common(); }; + rtype.ptr.prototype.exportedMethods = function() { + var t, ut; + t = this; + ut = t.uncommon(); + if (ut === ptrType$9.nil) { + return sliceType$11.nil; + } + return ut.exportedMethods(); + }; + rtype.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; + rtype.ptr.prototype.NumMethod = function() { + var t, tt; + t = this; + if (t.Kind() === 20) { + tt = (t.kindType); + return tt.NumMethod(); + } + return t.exportedMethods().$length; + }; + rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + rtype.ptr.prototype.MethodByName = function(name$1) { + var {$24r, _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, i, m, name$1, ok, p, t, tt, ut, $s, $r, $c} = $restore(this, {name$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + ok = false; + t = this; + if (t.Kind() === 20) { + tt = (t.kindType); + _tuple = tt.MethodByName(name$1); + Method.copy(m, _tuple[0]); + ok = _tuple[1]; + $s = -1; return [m, ok]; + } + ut = t.uncommon(); + if (ut === ptrType$9.nil) { + _tmp = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + _tmp$1 = false; + Method.copy(m, _tmp); + ok = _tmp$1; + $s = -1; return [m, ok]; + } + _ref = ut.exportedMethods(); + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + i = _i; + p = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), method); + /* */ if ($clone(t.nameOff(p.name), name).name() === name$1) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ($clone(t.nameOff(p.name), name).name() === name$1) { */ case 3: + _r = t.Method(i); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tmp$2 = $clone(_r, Method); + _tmp$3 = true; + Method.copy(m, _tmp$2); + ok = _tmp$3; + $24r = [m, ok]; + $s = 6; case 6: return $24r; + /* } */ case 4: + _i++; + $s = 1; continue; + case 2: + _tmp$4 = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + _tmp$5 = false; + Method.copy(m, _tmp$4); + ok = _tmp$5; + $s = -1; return [m, ok]; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.MethodByName, $c: true, $r, $24r, _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, i, m, name$1, ok, p, t, tt, ut, $s};return $f; + }; + rtype.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; + rtype.ptr.prototype.PkgPath = function() { + var t, ut; + t = this; + if (((t.tflag & 4) >>> 0) === 0) { + return ""; + } + ut = t.uncommon(); + if (ut === ptrType$9.nil) { + return ""; + } + return $clone(t.nameOff(ut.pkgPath), name).name(); + }; + rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; + rtype.ptr.prototype.hasName = function() { + var t; + t = this; + return !((((t.tflag & 4) >>> 0) === 0)); + }; + rtype.prototype.hasName = function() { return this.$val.hasName(); }; + rtype.ptr.prototype.Name = function() { + var _1, i, s, sqBrackets, t; + t = this; + if (!t.hasName()) { + return ""; + } + s = t.String(); + i = s.length - 1 >> 0; + sqBrackets = 0; + while (true) { + if (!(i >= 0 && (!((s.charCodeAt(i) === 46)) || !((sqBrackets === 0))))) { break; } + _1 = s.charCodeAt(i); + if (_1 === (93)) { + sqBrackets = sqBrackets + (1) >> 0; + } else if (_1 === (91)) { + sqBrackets = sqBrackets - (1) >> 0; + } + i = i - (1) >> 0; + } + return $substring(s, (i + 1 >> 0)); + }; + rtype.prototype.Name = function() { return this.$val.Name(); }; + rtype.ptr.prototype.ChanDir = function() { + var t, tt; + t = this; + if (!((t.Kind() === 18))) { + $panic(new $String("reflect: ChanDir of non-chan type " + t.String())); + } + tt = (t.kindType); + return ((tt.dir >> 0)); + }; + rtype.prototype.ChanDir = function() { return this.$val.ChanDir(); }; + rtype.ptr.prototype.IsVariadic = function() { + var t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: IsVariadic of non-func type " + t.String())); + } + tt = (t.kindType); + return !((((tt.outCount & 32768) >>> 0) === 0)); + }; + rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; + rtype.ptr.prototype.Elem = function() { + var _1, t, tt, tt$1, tt$2, tt$3, tt$4; + t = this; + _1 = t.Kind(); + if (_1 === (17)) { + tt = (t.kindType); + return toType(tt.elem); + } else if (_1 === (18)) { + tt$1 = (t.kindType); + return toType(tt$1.elem); + } else if (_1 === (21)) { + tt$2 = (t.kindType); + return toType(tt$2.elem); + } else if (_1 === (22)) { + tt$3 = (t.kindType); + return toType(tt$3.elem); + } else if (_1 === (23)) { + tt$4 = (t.kindType); + return toType(tt$4.elem); + } + $panic(new $String("reflect: Elem of invalid type " + t.String())); + }; + rtype.prototype.Elem = function() { return this.$val.Elem(); }; + rtype.ptr.prototype.Field = function(i) { + var i, t, tt; + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: Field of non-struct type " + t.String())); + } + tt = (t.kindType); + return tt.Field(i); + }; + rtype.prototype.Field = function(i) { return this.$val.Field(i); }; + rtype.ptr.prototype.FieldByIndex = function(index) { + var {$24r, _r, index, t, tt, $s, $r, $c} = $restore(this, {index}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: FieldByIndex of non-struct type " + t.String())); + } + tt = (t.kindType); + _r = tt.FieldByIndex(index); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.FieldByIndex, $c: true, $r, $24r, _r, index, t, tt, $s};return $f; + }; + rtype.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; + rtype.ptr.prototype.FieldByName = function(name$1) { + var {$24r, _r, name$1, t, tt, $s, $r, $c} = $restore(this, {name$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: FieldByName of non-struct type " + t.String())); + } + tt = (t.kindType); + _r = tt.FieldByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.FieldByName, $c: true, $r, $24r, _r, name$1, t, tt, $s};return $f; + }; + rtype.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; + rtype.ptr.prototype.FieldByNameFunc = function(match) { + var {$24r, _r, match, t, tt, $s, $r, $c} = $restore(this, {match}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: FieldByNameFunc of non-struct type " + t.String())); + } + tt = (t.kindType); + _r = tt.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.FieldByNameFunc, $c: true, $r, $24r, _r, match, t, tt, $s};return $f; + }; + rtype.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; + rtype.ptr.prototype.In = function(i) { + var i, t, tt, x; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: In of non-func type " + t.String())); + } + tt = (t.kindType); + return toType((x = tt.in$(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); + }; + rtype.prototype.In = function(i) { return this.$val.In(i); }; + rtype.ptr.prototype.Key = function() { + var t, tt; + t = this; + if (!((t.Kind() === 21))) { + $panic(new $String("reflect: Key of non-map type " + t.String())); + } + tt = (t.kindType); + return toType(tt.key); + }; + rtype.prototype.Key = function() { return this.$val.Key(); }; + rtype.ptr.prototype.Len = function() { + var t, tt; + t = this; + if (!((t.Kind() === 17))) { + $panic(new $String("reflect: Len of non-array type " + t.String())); + } + tt = (t.kindType); + return ((tt.len >> 0)); + }; + rtype.prototype.Len = function() { return this.$val.Len(); }; + rtype.ptr.prototype.NumField = function() { + var t, tt; + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: NumField of non-struct type " + t.String())); + } + tt = (t.kindType); + return tt.fields.$length; + }; + rtype.prototype.NumField = function() { return this.$val.NumField(); }; + rtype.ptr.prototype.NumIn = function() { + var t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: NumIn of non-func type " + t.String())); + } + tt = (t.kindType); + return ((tt.inCount >> 0)); + }; + rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; + rtype.ptr.prototype.NumOut = function() { + var t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: NumOut of non-func type " + t.String())); + } + tt = (t.kindType); + return tt.out().$length; + }; + rtype.prototype.NumOut = function() { return this.$val.NumOut(); }; + rtype.ptr.prototype.Out = function(i) { + var i, t, tt, x; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: Out of non-func type " + t.String())); + } + tt = (t.kindType); + return toType((x = tt.out(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); + }; + rtype.prototype.Out = function(i) { return this.$val.Out(i); }; + ChanDir.prototype.String = function() { + var _1, d; + d = this.$val; + _1 = d; + if (_1 === (2)) { + return "chan<-"; + } else if (_1 === (1)) { + return "<-chan"; + } else if (_1 === (3)) { + return "chan"; + } + return "ChanDir" + strconv.Itoa(((d >> 0))); + }; + $ptrType(ChanDir).prototype.String = function() { return new ChanDir(this.$get()).String(); }; + interfaceType.ptr.prototype.Method = function(i) { + var i, m, p, pname, t, x; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + t = this; + if (i < 0 || i >= t.methods.$length) { + return m; + } + p = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + pname = $clone(t.rtype.nameOff(p.name), name); + m.Name = $clone(pname, name).name(); + if (!$clone(pname, name).isExported()) { + m.PkgPath = $clone(pname, name).pkgPath(); + if (m.PkgPath === "") { + m.PkgPath = $clone(t.pkgPath, name).name(); + } + } + m.Type = toType(t.rtype.typeOff(p.typ)); + m.Index = i; + return m; + }; + interfaceType.prototype.Method = function(i) { return this.$val.Method(i); }; + interfaceType.ptr.prototype.NumMethod = function() { + var t; + t = this; + return t.methods.$length; + }; + interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + interfaceType.ptr.prototype.MethodByName = function(name$1) { + var _i, _ref, _tmp, _tmp$1, i, m, name$1, ok, p, t, x; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + ok = false; + t = this; + if (t === ptrType$10.nil) { + return [m, ok]; + } + p = ptrType$11.nil; + _ref = t.methods; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + p = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + if ($clone(t.rtype.nameOff(p.name), name).name() === name$1) { + _tmp = $clone(t.Method(i), Method); + _tmp$1 = true; + Method.copy(m, _tmp); + ok = _tmp$1; + return [m, ok]; + } + _i++; + } + return [m, ok]; + }; + interfaceType.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; + StructField.ptr.prototype.IsExported = function() { + var f; + f = this; + return f.PkgPath === ""; + }; + StructField.prototype.IsExported = function() { return this.$val.IsExported(); }; + StructTag.prototype.Get = function(key) { + var _tuple, key, tag, v; + tag = this.$val; + _tuple = new StructTag(tag).Lookup(key); + v = _tuple[0]; + return v; + }; + $ptrType(StructTag).prototype.Get = function(key) { return new StructTag(this.$get()).Get(key); }; + StructTag.prototype.Lookup = function(key) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, i, key, name$1, ok, qvalue, tag, value, value$1; + value = ""; + ok = false; + tag = this.$val; + while (true) { + if (!(!(tag === ""))) { break; } + i = 0; + while (true) { + if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } + i = i + (1) >> 0; + } + tag = $substring(tag, i); + if (tag === "") { + break; + } + i = 0; + while (true) { + if (!(i < tag.length && tag.charCodeAt(i) > 32 && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)) && !((tag.charCodeAt(i) === 127)))) { break; } + i = i + (1) >> 0; + } + if ((i === 0) || (i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { + break; + } + name$1 = ($substring(tag, 0, i)); + tag = $substring(tag, (i + 1 >> 0)); + i = 1; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } + if (tag.charCodeAt(i) === 92) { + i = i + (1) >> 0; + } + i = i + (1) >> 0; + } + if (i >= tag.length) { + break; + } + qvalue = ($substring(tag, 0, (i + 1 >> 0))); + tag = $substring(tag, (i + 1 >> 0)); + if (key === name$1) { + _tuple = strconv.Unquote(qvalue); + value$1 = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + break; + } + _tmp = value$1; + _tmp$1 = true; + value = _tmp; + ok = _tmp$1; + return [value, ok]; + } + } + _tmp$2 = ""; + _tmp$3 = false; + value = _tmp$2; + ok = _tmp$3; + return [value, ok]; + }; + $ptrType(StructTag).prototype.Lookup = function(key) { return new StructTag(this.$get()).Lookup(key); }; + structType.ptr.prototype.Field = function(i) { + var f, i, p, t, tag, x; + f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); + t = this; + if (i < 0 || i >= t.fields.$length) { + $panic(new $String("reflect: Field index out of bounds")); + } + p = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + f.Type = toType(p.typ); + f.Name = $clone(p.name, name).name(); + f.Anonymous = p.embedded(); + if (!$clone(p.name, name).isExported()) { + f.PkgPath = $clone(t.pkgPath, name).name(); + } + tag = $clone(p.name, name).tag(); + if (!(tag === "")) { + f.Tag = (tag); + } + f.Offset = p.offset(); + f.Index = new sliceType$6([i]); + return f; + }; + structType.prototype.Field = function(i) { return this.$val.Field(i); }; + structType.ptr.prototype.FieldByIndex = function(index) { + var {_i, _r, _r$1, _r$2, _r$3, _r$4, _ref, _v, f, ft, i, index, t, x, $s, $r, $c} = $restore(this, {index}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); + t = this; + f.Type = toType(t.rtype); + _ref = index; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + i = _i; + x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + /* */ if (i > 0) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (i > 0) { */ case 3: + ft = f.Type; + _r = ft.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + if (!(_r === 22)) { _v = false; $s = 7; continue s; } + _r$1 = ft.Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = _r$1.Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v = _r$2 === 25; case 7: + /* */ if (_v) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_v) { */ case 5: + _r$3 = ft.Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + ft = _r$3; + /* } */ case 6: + f.Type = ft; + /* } */ case 4: + _r$4 = f.Type.Field(x); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + StructField.copy(f, _r$4); + _i++; + $s = 1; continue; + case 2: + $s = -1; return f; + /* */ } return; } var $f = {$blk: structType.ptr.prototype.FieldByIndex, $c: true, $r, _i, _r, _r$1, _r$2, _r$3, _r$4, _ref, _v, f, ft, i, index, t, x, $s};return $f; + }; + structType.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; + structType.ptr.prototype.FieldByNameFunc = function(match) { + var {_entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _key, _key$1, _key$2, _key$3, _r, _r$1, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, count, current, f, fname, i, index, match, next, nextCount, ntyp, ok, result, scan, styp, t, t$1, visited, x, $s, $r, $c} = $restore(this, {match}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + result = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); + ok = false; + t = this; + current = new sliceType$12([]); + next = new sliceType$12([new fieldScan.ptr(t, sliceType$6.nil)]); + nextCount = false; + visited = $makeMap(ptrType$12.keyFor, []); + /* while (true) { */ case 1: + /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } + _tmp = next; + _tmp$1 = $subslice(current, 0, 0); + current = _tmp; + next = _tmp$1; + count = nextCount; + nextCount = false; + _ref = current; + _i = 0; + /* while (true) { */ case 3: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } + scan = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), fieldScan); + t$1 = scan.typ; + if ((_entry = $mapIndex(visited,ptrType$12.keyFor(t$1)), _entry !== undefined ? _entry.v : false)) { + _i++; + /* continue; */ $s = 3; continue; + } + _key = t$1; (visited || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$12.keyFor(_key), { k: _key, v: true }); + _ref$1 = t$1.fields; + _i$1 = 0; + /* while (true) { */ case 5: + /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 6; continue; } + i = _i$1; + f = (x = t$1.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + fname = $clone(f.name, name).name(); + ntyp = ptrType$1.nil; + /* */ if (f.embedded()) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (f.embedded()) { */ case 7: + ntyp = f.typ; + /* */ if (ntyp.Kind() === 22) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (ntyp.Kind() === 22) { */ case 9: + _r = ntyp.Elem().common(); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + ntyp = _r; + /* } */ case 10: + /* } */ case 8: + _r$1 = match(fname); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if (_r$1) { */ case 12: + if ((_entry$1 = $mapIndex(count,ptrType$12.keyFor(t$1)), _entry$1 !== undefined ? _entry$1.v : 0) > 1 || ok) { + _tmp$2 = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); + _tmp$3 = false; + StructField.copy(result, _tmp$2); + ok = _tmp$3; + $s = -1; return [result, ok]; + } + StructField.copy(result, t$1.Field(i)); + result.Index = sliceType$6.nil; + result.Index = $appendSlice(result.Index, scan.index); + result.Index = $append(result.Index, i); + ok = true; + _i$1++; + /* continue; */ $s = 5; continue; + /* } */ case 13: + if (ok || ntyp === ptrType$1.nil || !((ntyp.Kind() === 25))) { + _i$1++; + /* continue; */ $s = 5; continue; + } + styp = (ntyp.kindType); + if ((_entry$2 = $mapIndex(nextCount,ptrType$12.keyFor(styp)), _entry$2 !== undefined ? _entry$2.v : 0) > 0) { + _key$1 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$12.keyFor(_key$1), { k: _key$1, v: 2 }); + _i$1++; + /* continue; */ $s = 5; continue; + } + if (nextCount === false) { + nextCount = $makeMap(ptrType$12.keyFor, []); + } + _key$2 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$12.keyFor(_key$2), { k: _key$2, v: 1 }); + if ((_entry$3 = $mapIndex(count,ptrType$12.keyFor(t$1)), _entry$3 !== undefined ? _entry$3.v : 0) > 1) { + _key$3 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$12.keyFor(_key$3), { k: _key$3, v: 2 }); + } + index = sliceType$6.nil; + index = $appendSlice(index, scan.index); + index = $append(index, i); + next = $append(next, new fieldScan.ptr(styp, index)); + _i$1++; + $s = 5; continue; + case 6: + _i++; + $s = 3; continue; + case 4: + if (ok) { + /* break; */ $s = 2; continue; + } + $s = 1; continue; + case 2: + $s = -1; return [result, ok]; + /* */ } return; } var $f = {$blk: structType.ptr.prototype.FieldByNameFunc, $c: true, $r, _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _key, _key$1, _key$2, _key$3, _r, _r$1, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, count, current, f, fname, i, index, match, next, nextCount, ntyp, ok, result, scan, styp, t, t$1, visited, x, $s};return $f; + }; + structType.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; + structType.ptr.prototype.FieldByName = function(name$1) { + var {$24r, _i, _r, _ref, _tmp, _tmp$1, _tuple, f, hasEmbeds, i, name$1, present, t, tf, x, $s, $r, $c} = $restore(this, {name$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + name$1 = [name$1]; + f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); + present = false; + t = this; + hasEmbeds = false; + if (!(name$1[0] === "")) { + _ref = t.fields; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + tf = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + if ($clone(tf.name, name).name() === name$1[0]) { + _tmp = $clone(t.Field(i), StructField); + _tmp$1 = true; + StructField.copy(f, _tmp); + present = _tmp$1; + $s = -1; return [f, present]; + } + if (tf.embedded()) { + hasEmbeds = true; + } + _i++; + } + } + if (!hasEmbeds) { + $s = -1; return [f, present]; + } + _r = t.FieldByNameFunc((function(name$1) { return function(s) { + var s; + return s === name$1[0]; + }; })(name$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + StructField.copy(f, _tuple[0]); + present = _tuple[1]; + $24r = [f, present]; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: structType.ptr.prototype.FieldByName, $c: true, $r, $24r, _i, _r, _ref, _tmp, _tmp$1, _tuple, f, hasEmbeds, i, name$1, present, t, tf, x, $s};return $f; + }; + structType.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; + PtrTo = function(t) { + var t; + return PointerTo(t); + }; + $pkg.PtrTo = PtrTo; + PointerTo = function(t) { + var t; + return $assertType(t, ptrType$1).ptrTo(); + }; + $pkg.PointerTo = PointerTo; + rtype.ptr.prototype.Implements = function(u) { + var {_r, t, u, $s, $r, $c} = $restore(this, {u}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.Implements")); + } + _r = u.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 20))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 20))) { */ case 1: + $panic(new $String("reflect: non-interface type passed to Type.Implements")); + /* } */ case 2: + $s = -1; return implements$1($assertType(u, ptrType$1), t); + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.Implements, $c: true, $r, _r, t, u, $s};return $f; + }; + rtype.prototype.Implements = function(u) { return this.$val.Implements(u); }; + rtype.ptr.prototype.AssignableTo = function(u) { + var {$24r, _r, t, u, uu, $s, $r, $c} = $restore(this, {u}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.AssignableTo")); + } + uu = $assertType(u, ptrType$1); + _r = directlyAssignable(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r || implements$1(uu, t); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.AssignableTo, $c: true, $r, $24r, _r, t, u, uu, $s};return $f; + }; + rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; + rtype.ptr.prototype.ConvertibleTo = function(u) { + var {$24r, _r, t, u, uu, $s, $r, $c} = $restore(this, {u}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.ConvertibleTo")); + } + uu = $assertType(u, ptrType$1); + _r = convertOp(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = !(_r === $throwNilPointerError); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.ConvertibleTo, $c: true, $r, $24r, _r, t, u, uu, $s};return $f; + }; + rtype.prototype.ConvertibleTo = function(u) { return this.$val.ConvertibleTo(u); }; + implements$1 = function(T, V) { + var T, V, i, i$1, j, j$1, t, tm, tm$1, tmName, tmName$1, tmPkgPath, tmPkgPath$1, v, v$1, vm, vm$1, vmName, vmName$1, vmPkgPath, vmPkgPath$1, vmethods, x, x$1, x$2; + if (!((T.Kind() === 20))) { + return false; + } + t = (T.kindType); + if (t.methods.$length === 0) { + return true; + } + if (V.Kind() === 20) { + v = (V.kindType); + i = 0; + j = 0; + while (true) { + if (!(j < v.methods.$length)) { break; } + tm = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + tmName = $clone(t.rtype.nameOff(tm.name), name); + vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])); + vmName = $clone(V.nameOff(vm.name), name); + if ($clone(vmName, name).name() === $clone(tmName, name).name() && V.typeOff(vm.typ) === t.rtype.typeOff(tm.typ)) { + if (!$clone(tmName, name).isExported()) { + tmPkgPath = $clone(tmName, name).pkgPath(); + if (tmPkgPath === "") { + tmPkgPath = $clone(t.pkgPath, name).name(); + } + vmPkgPath = $clone(vmName, name).pkgPath(); + if (vmPkgPath === "") { + vmPkgPath = $clone(v.pkgPath, name).name(); + } + if (!(tmPkgPath === vmPkgPath)) { + j = j + (1) >> 0; + continue; + } + } + i = i + (1) >> 0; + if (i >= t.methods.$length) { + return true; + } + } + j = j + (1) >> 0; + } + return false; + } + v$1 = V.uncommon(); + if (v$1 === ptrType$9.nil) { + return false; + } + i$1 = 0; + vmethods = v$1.methods(); + j$1 = 0; + while (true) { + if (!(j$1 < ((v$1.mcount >> 0)))) { break; } + tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); + tmName$1 = $clone(t.rtype.nameOff(tm$1.name), name); + vm$1 = $clone(((j$1 < 0 || j$1 >= vmethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : vmethods.$array[vmethods.$offset + j$1]), method); + vmName$1 = $clone(V.nameOff(vm$1.name), name); + if ($clone(vmName$1, name).name() === $clone(tmName$1, name).name() && V.typeOff(vm$1.mtyp) === t.rtype.typeOff(tm$1.typ)) { + if (!$clone(tmName$1, name).isExported()) { + tmPkgPath$1 = $clone(tmName$1, name).pkgPath(); + if (tmPkgPath$1 === "") { + tmPkgPath$1 = $clone(t.pkgPath, name).name(); + } + vmPkgPath$1 = $clone(vmName$1, name).pkgPath(); + if (vmPkgPath$1 === "") { + vmPkgPath$1 = $clone(V.nameOff(v$1.pkgPath), name).name(); + } + if (!(tmPkgPath$1 === vmPkgPath$1)) { + j$1 = j$1 + (1) >> 0; + continue; + } + } + i$1 = i$1 + (1) >> 0; + if (i$1 >= t.methods.$length) { + return true; + } + } + j$1 = j$1 + (1) >> 0; + } + return false; + }; + specialChannelAssignability = function(T, V) { + var {$24r, T, V, _r, _v, $s, $r, $c} = $restore(this, {T, V}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (!((V.ChanDir() === 3) && (T.Name() === "" || V.Name() === ""))) { _v = false; $s = 1; continue s; } + _r = haveIdenticalType(T.Elem(), V.Elem(), true); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 1: + $24r = _v; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: specialChannelAssignability, $c: true, $r, $24r, T, V, _r, _v, $s};return $f; + }; + directlyAssignable = function(T, V) { + var {$24r, T, V, _r, _r$1, _v, $s, $r, $c} = $restore(this, {T, V}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (T === V) { + $s = -1; return true; + } + if (T.hasName() && V.hasName() || !((T.Kind() === V.Kind()))) { + $s = -1; return false; + } + if (!(T.Kind() === 18)) { _v = false; $s = 3; continue s; } + _r = specialChannelAssignability(T, V); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 3: + /* */ if (_v) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_v) { */ case 1: + $s = -1; return true; + /* } */ case 2: + _r$1 = haveIdenticalUnderlyingType(T, V, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1; + $s = 6; case 6: return $24r; + /* */ } return; } var $f = {$blk: directlyAssignable, $c: true, $r, $24r, T, V, _r, _r$1, _v, $s};return $f; + }; + haveIdenticalType = function(T, V, cmpTags) { + var {$24r, T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _v, _v$1, cmpTags, $s, $r, $c} = $restore(this, {T, V, cmpTags}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (cmpTags) { + $s = -1; return $interfaceIsEqual(T, V); + } + _r = T.Name(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = V.Name(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + if (!(_r === _r$1)) { _v$1 = true; $s = 4; continue s; } + _r$2 = T.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = V.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _v$1 = !((_r$2 === _r$3)); case 4: + if (_v$1) { _v = true; $s = 3; continue s; } + _r$4 = T.PkgPath(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$5 = V.PkgPath(); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _v = !(_r$4 === _r$5); case 3: + /* */ if (_v) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_v) { */ case 1: + $s = -1; return false; + /* } */ case 2: + _r$6 = T.common(); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _arg = _r$6; + _r$7 = V.common(); /* */ $s = 12; case 12: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + _arg$1 = _r$7; + _r$8 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 13; case 13: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + $24r = _r$8; + $s = 14; case 14: return $24r; + /* */ } return; } var $f = {$blk: haveIdenticalType, $c: true, $r, $24r, T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _v, _v$1, cmpTags, $s};return $f; + }; + haveIdenticalUnderlyingType = function(T, V, cmpTags) { + var {$24r, $24r$1, $24r$2, $24r$3, T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _ref, _v, _v$1, _v$2, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s, $r, $c} = $restore(this, {T, V, cmpTags}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (T === V) { + $s = -1; return true; + } + kind = T.Kind(); + if (!((kind === V.Kind()))) { + $s = -1; return false; + } + if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { + $s = -1; return true; + } + _1 = kind; + /* */ if (_1 === (17)) { $s = 2; continue; } + /* */ if (_1 === (18)) { $s = 3; continue; } + /* */ if (_1 === (19)) { $s = 4; continue; } + /* */ if (_1 === (20)) { $s = 5; continue; } + /* */ if (_1 === (21)) { $s = 6; continue; } + /* */ if ((_1 === (22)) || (_1 === (23))) { $s = 7; continue; } + /* */ if (_1 === (25)) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (_1 === (17)) { */ case 2: + if (!(T.Len() === V.Len())) { _v = false; $s = 10; continue s; } + _r = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 10: + $24r = _v; + $s = 12; case 12: return $24r; + /* } else if (_1 === (18)) { */ case 3: + if (!(V.ChanDir() === T.ChanDir())) { _v$1 = false; $s = 13; continue s; } + _r$1 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v$1 = _r$1; case 13: + $24r$1 = _v$1; + $s = 15; case 15: return $24r$1; + /* } else if (_1 === (19)) { */ case 4: + t = (T.kindType); + v = (V.kindType); + if (!((t.outCount === v.outCount)) || !((t.inCount === v.inCount))) { + $s = -1; return false; + } + i = 0; + /* while (true) { */ case 16: + /* if (!(i < t.rtype.NumIn())) { break; } */ if(!(i < t.rtype.NumIn())) { $s = 17; continue; } + _r$2 = haveIdenticalType(t.rtype.In(i), v.rtype.In(i), cmpTags); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (!_r$2) { $s = 18; continue; } + /* */ $s = 19; continue; + /* if (!_r$2) { */ case 18: + $s = -1; return false; + /* } */ case 19: + i = i + (1) >> 0; + $s = 16; continue; + case 17: + i$1 = 0; + /* while (true) { */ case 21: + /* if (!(i$1 < t.rtype.NumOut())) { break; } */ if(!(i$1 < t.rtype.NumOut())) { $s = 22; continue; } + _r$3 = haveIdenticalType(t.rtype.Out(i$1), v.rtype.Out(i$1), cmpTags); /* */ $s = 25; case 25: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (!_r$3) { $s = 23; continue; } + /* */ $s = 24; continue; + /* if (!_r$3) { */ case 23: + $s = -1; return false; + /* } */ case 24: + i$1 = i$1 + (1) >> 0; + $s = 21; continue; + case 22: + $s = -1; return true; + /* } else if (_1 === (20)) { */ case 5: + t$1 = (T.kindType); + v$1 = (V.kindType); + if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { + $s = -1; return true; + } + $s = -1; return false; + /* } else if (_1 === (21)) { */ case 6: + _r$4 = haveIdenticalType(T.Key(), V.Key(), cmpTags); /* */ $s = 27; case 27: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + if (!(_r$4)) { _v$2 = false; $s = 26; continue s; } + _r$5 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 28; case 28: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _v$2 = _r$5; case 26: + $24r$2 = _v$2; + $s = 29; case 29: return $24r$2; + /* } else if ((_1 === (22)) || (_1 === (23))) { */ case 7: + _r$6 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 30; case 30: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + $24r$3 = _r$6; + $s = 31; case 31: return $24r$3; + /* } else if (_1 === (25)) { */ case 8: + t$2 = (T.kindType); + v$2 = (V.kindType); + if (!((t$2.fields.$length === v$2.fields.$length))) { + $s = -1; return false; + } + if (!($clone(t$2.pkgPath, name).name() === $clone(v$2.pkgPath, name).name())) { + $s = -1; return false; + } + _ref = t$2.fields; + _i = 0; + /* while (true) { */ case 32: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 33; continue; } + i$2 = _i; + tf = (x = t$2.fields, ((i$2 < 0 || i$2 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i$2])); + vf = (x$1 = v$2.fields, ((i$2 < 0 || i$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$2])); + if (!($clone(tf.name, name).name() === $clone(vf.name, name).name())) { + $s = -1; return false; + } + _r$7 = haveIdenticalType(tf.typ, vf.typ, cmpTags); /* */ $s = 36; case 36: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + /* */ if (!_r$7) { $s = 34; continue; } + /* */ $s = 35; continue; + /* if (!_r$7) { */ case 34: + $s = -1; return false; + /* } */ case 35: + if (cmpTags && !($clone(tf.name, name).tag() === $clone(vf.name, name).tag())) { + $s = -1; return false; + } + if (!((tf.offsetEmbed === vf.offsetEmbed))) { + $s = -1; return false; + } + _i++; + $s = 32; continue; + case 33: + $s = -1; return true; + /* } */ case 9: + case 1: + $s = -1; return false; + /* */ } return; } var $f = {$blk: haveIdenticalUnderlyingType, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _ref, _v, _v$1, _v$2, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s};return $f; + }; + toType = function(t) { + var t; + if (t === ptrType$1.nil) { + return $ifaceNil; + } + return t; + }; + ifaceIndir = function(t) { + var t; + return ((t.kind & 32) >>> 0) === 0; + }; + methodValueCallCodePtr = function() { + var {$24r, _r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = abi.FuncPCABI0(new funcType$2(methodValueCall)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: methodValueCallCodePtr, $c: true, $r, $24r, _r, $s};return $f; + }; + methodValueCall = function() { + $throwRuntimeError("native function not implemented: reflect.methodValueCall"); + }; + init = function() { + var {used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + used = (function(i) { + var i; + }); + $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$1 = new uncommonType.ptr(0, 0, 0, 0, sliceType$11.nil), new x$1.constructor.elem(x$1))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$2 = new method.ptr(0, 0, 0, 0), new x$2.constructor.elem(x$2))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$3 = new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, 0), new x$3.constructor.elem(x$3))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$4 = new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), ptrType$1.nil, 0), new x$4.constructor.elem(x$4))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$5 = new funcType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), 0, 0, sliceType$2.nil, sliceType$2.nil), new x$5.constructor.elem(x$5))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$6 = new interfaceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), new name.ptr(ptrType$13.nil), sliceType$14.nil), new x$6.constructor.elem(x$6))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$7 = new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0), new x$7.constructor.elem(x$7))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$8 = new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), ptrType$1.nil), new x$8.constructor.elem(x$8))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$9 = new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), ptrType$1.nil), new x$9.constructor.elem(x$9))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$10 = new structType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), new name.ptr(ptrType$13.nil), sliceType$15.nil), new x$10.constructor.elem(x$10))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$11 = new imethod.ptr(0, 0), new x$11.constructor.elem(x$11))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$12 = new structField.ptr(new name.ptr(ptrType$13.nil), ptrType$1.nil, 0), new x$12.constructor.elem(x$12))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + initialized = true; + uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); + $s = -1; return; + /* */ } return; } var $f = {$blk: init, $c: true, $r, used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s};return $f; + }; + New = function(typ) { + var fl, pt, ptr, t, typ; + if ($interfaceIsEqual(typ, $ifaceNil)) { + $panic(new $String("reflect: New(nil)")); + } + t = $assertType(typ, ptrType$1); + pt = t.ptrTo(); + ptr = unsafe_New(t); + fl = 22; + return new Value.ptr(pt, ptr, fl); + }; + $pkg.New = New; + jsType = function(typ) { + var typ; + return typ.jsType; + }; + reflectType = function(typ) { + var _1, _i, _i$1, _i$2, _i$3, _ref, _ref$1, _ref$2, _ref$3, dir, exported, exported$1, f, fields, i, i$1, i$2, i$3, i$4, i$5, imethods, in$1, m, m$1, m$2, methodSet, methods, offsetEmbed, out, outCount, params, reflectFields, reflectMethods, results, rt, typ, ut, xcount; + if (typ.reflectType === undefined) { + rt = new rtype.ptr(((($parseInt(typ.size) >> 0) >>> 0)), 0, 0, 0, 0, 0, ((($parseInt(typ.kind) >> 0) << 24 >>> 24)), $throwNilPointerError, ptrType$13.nil, resolveReflectName($clone(newName(internalStr(typ.string), "", !!(typ.exported)), name)), 0); + rt.jsType = typ; + typ.reflectType = rt; + methodSet = $methodSet(typ); + if (!(($parseInt(methodSet.length) === 0)) || !!(typ.named)) { + rt.tflag = (rt.tflag | (1)) >>> 0; + if (!!(typ.named)) { + rt.tflag = (rt.tflag | (4)) >>> 0; + } + reflectMethods = sliceType$11.nil; + i = 0; + while (true) { + if (!(i < $parseInt(methodSet.length))) { break; } + m = methodSet[i]; + exported = internalStr(m.pkg) === ""; + if (!exported) { + i = i + (1) >> 0; + continue; + } + reflectMethods = $append(reflectMethods, new method.ptr(resolveReflectName($clone(newMethodName(m), name)), newTypeOff(reflectType(m.typ)), 0, 0)); + i = i + (1) >> 0; + } + xcount = ((reflectMethods.$length << 16 >>> 16)); + i$1 = 0; + while (true) { + if (!(i$1 < $parseInt(methodSet.length))) { break; } + m$1 = methodSet[i$1]; + exported$1 = internalStr(m$1.pkg) === ""; + if (exported$1) { + i$1 = i$1 + (1) >> 0; + continue; + } + reflectMethods = $append(reflectMethods, new method.ptr(resolveReflectName($clone(newMethodName(m$1), name)), newTypeOff(reflectType(m$1.typ)), 0, 0)); + i$1 = i$1 + (1) >> 0; + } + ut = new uncommonType.ptr(resolveReflectName($clone(newName(internalStr(typ.pkg), "", false), name)), (($parseInt(methodSet.length) << 16 >>> 16)), xcount, 0, reflectMethods); + ut.jsType = typ; + rt.uncommonType = ut; + } + _1 = rt.Kind(); + if (_1 === (17)) { + setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), reflectType(typ.elem), ptrType$1.nil, ((($parseInt(typ.len) >> 0) >>> 0)))); + } else if (_1 === (18)) { + dir = 3; + if (!!(typ.sendOnly)) { + dir = 2; + } + if (!!(typ.recvOnly)) { + dir = 1; + } + setKindType(rt, new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), reflectType(typ.elem), ((dir >>> 0)))); + } else if (_1 === (19)) { + params = typ.params; + in$1 = $makeSlice(sliceType$2, $parseInt(params.length)); + _ref = in$1; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i$2 = _i; + ((i$2 < 0 || i$2 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i$2] = reflectType(params[i$2])); + _i++; + } + results = typ.results; + out = $makeSlice(sliceType$2, $parseInt(results.length)); + _ref$1 = out; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$3 = _i$1; + ((i$3 < 0 || i$3 >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i$3] = reflectType(results[i$3])); + _i$1++; + } + outCount = (($parseInt(results.length) << 16 >>> 16)); + if (!!(typ.variadic)) { + outCount = (outCount | (32768)) >>> 0; + } + setKindType(rt, new funcType.ptr($clone(rt, rtype), (($parseInt(params.length) << 16 >>> 16)), outCount, in$1, out)); + } else if (_1 === (20)) { + methods = typ.methods; + imethods = $makeSlice(sliceType$14, $parseInt(methods.length)); + _ref$2 = imethods; + _i$2 = 0; + while (true) { + if (!(_i$2 < _ref$2.$length)) { break; } + i$4 = _i$2; + m$2 = methods[i$4]; + imethod.copy(((i$4 < 0 || i$4 >= imethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : imethods.$array[imethods.$offset + i$4]), new imethod.ptr(resolveReflectName($clone(newMethodName(m$2), name)), newTypeOff(reflectType(m$2.typ)))); + _i$2++; + } + setKindType(rt, new interfaceType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkg), "", false), name), imethods)); + } else if (_1 === (21)) { + setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0)); + } else if (_1 === (22)) { + setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), reflectType(typ.elem))); + } else if (_1 === (23)) { + setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0), reflectType(typ.elem))); + } else if (_1 === (25)) { + fields = typ.fields; + reflectFields = $makeSlice(sliceType$15, $parseInt(fields.length)); + _ref$3 = reflectFields; + _i$3 = 0; + while (true) { + if (!(_i$3 < _ref$3.$length)) { break; } + i$5 = _i$3; + f = fields[i$5]; + offsetEmbed = ((i$5 >>> 0)) << 1 >>> 0; + if (!!(f.embedded)) { + offsetEmbed = (offsetEmbed | (1)) >>> 0; + } + structField.copy(((i$5 < 0 || i$5 >= reflectFields.$length) ? ($throwRuntimeError("index out of range"), undefined) : reflectFields.$array[reflectFields.$offset + i$5]), new structField.ptr($clone(newName(internalStr(f.name), internalStr(f.tag), !!(f.exported)), name), reflectType(f.typ), offsetEmbed)); + _i$3++; + } + setKindType(rt, new structType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkgPath), "", false), name), reflectFields)); + } + } + return ((typ.reflectType)); + }; + setKindType = function(rt, kindType) { + var kindType, rt; + rt.kindType = kindType; + kindType.rtype = rt; + }; + uncommonType.ptr.prototype.methods = function() { + var t; + t = this; + return t._methods; + }; + uncommonType.prototype.methods = function() { return this.$val.methods(); }; + uncommonType.ptr.prototype.exportedMethods = function() { + var t; + t = this; + return $subslice(t._methods, 0, t.xcount, t.xcount); + }; + uncommonType.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; + rtype.ptr.prototype.uncommon = function() { + var obj, t; + t = this; + obj = t.uncommonType; + if (obj === undefined) { + return ptrType$9.nil; + } + return ((obj)); + }; + rtype.prototype.uncommon = function() { return this.$val.uncommon(); }; + funcType.ptr.prototype.in$ = function() { + var t; + t = this; + return t._in; + }; + funcType.prototype.in$ = function() { return this.$val.in$(); }; + funcType.ptr.prototype.out = function() { + var t; + t = this; + return t._out; + }; + funcType.prototype.out = function() { return this.$val.out(); }; + name.ptr.prototype.name = function() { + var _entry, n, s; + s = ""; + n = this; + s = (_entry = $mapIndex(nameMap,ptrType$13.keyFor(n.bytes)), _entry !== undefined ? _entry.v : ptrType$17.nil).name; + return s; + }; + name.prototype.name = function() { return this.$val.name(); }; + name.ptr.prototype.tag = function() { + var _entry, n, s; + s = ""; + n = this; + s = (_entry = $mapIndex(nameMap,ptrType$13.keyFor(n.bytes)), _entry !== undefined ? _entry.v : ptrType$17.nil).tag; + return s; + }; + name.prototype.tag = function() { return this.$val.tag(); }; + name.ptr.prototype.pkgPath = function() { + var _entry, n; + n = this; + return (_entry = $mapIndex(nameMap,ptrType$13.keyFor(n.bytes)), _entry !== undefined ? _entry.v : ptrType$17.nil).pkgPath; + }; + name.prototype.pkgPath = function() { return this.$val.pkgPath(); }; + name.ptr.prototype.isExported = function() { + var _entry, n; + n = this; + return (_entry = $mapIndex(nameMap,ptrType$13.keyFor(n.bytes)), _entry !== undefined ? _entry.v : ptrType$17.nil).exported; + }; + name.prototype.isExported = function() { return this.$val.isExported(); }; + newName = function(n, tag, exported) { + var _key, b, exported, n, tag; + b = $newDataPointer(0, ptrType$13); + _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$13.keyFor(_key), { k: _key, v: new nameData.ptr(n, tag, exported, "") }); + return new name.ptr(b); + }; + newMethodName = function(m) { + var _key, b, m; + b = $newDataPointer(0, ptrType$13); + _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map")).set(ptrType$13.keyFor(_key), { k: _key, v: new nameData.ptr(internalStr(m.name), "", internalStr(m.pkg) === "", internalStr(m.pkg)) }); + return new name.ptr(b); + }; + rtype.ptr.prototype.nameOff = function(off) { + var off, t, x; + t = this; + return (x = ((off >> 0)), ((x < 0 || x >= nameOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : nameOffList.$array[nameOffList.$offset + x])); + }; + rtype.prototype.nameOff = function(off) { return this.$val.nameOff(off); }; + resolveReflectName = function(n) { + var i, n; + i = nameOffList.$length; + nameOffList = $append(nameOffList, n); + return ((i >> 0)); + }; + rtype.ptr.prototype.typeOff = function(off) { + var off, t, x; + t = this; + return (x = ((off >> 0)), ((x < 0 || x >= typeOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : typeOffList.$array[typeOffList.$offset + x])); + }; + rtype.prototype.typeOff = function(off) { return this.$val.typeOff(off); }; + newTypeOff = function(t) { + var i, t; + i = typeOffList.$length; + typeOffList = $append(typeOffList, t); + return ((i >> 0)); + }; + internalStr = function(strObj) { + var c, strObj; + c = new structType$3.ptr(""); + c.str = strObj; + return c.str; + }; + isWrapped = function(typ) { + var typ; + return !!(jsType(typ).wrapped); + }; + copyStruct = function(dst, src, typ) { + var dst, fields, i, prop, src, typ; + fields = jsType(typ).fields; + i = 0; + while (true) { + if (!(i < $parseInt(fields.length))) { break; } + prop = $internalize(fields[i].prop, $String); + dst[$externalize(prop, $String)] = src[$externalize(prop, $String)]; + i = i + (1) >> 0; + } + }; + makeValue = function(t, v, fl) { + var {$24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s, $r, $c} = $restore(this, {t, v, fl}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + rt = _r; + _r$1 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + if (_r$1 === 17) { _v$1 = true; $s = 5; continue s; } + _r$2 = t.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$1 = _r$2 === 25; case 5: + if (_v$1) { _v = true; $s = 4; continue s; } + _r$3 = t.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _v = _r$3 === 22; case 4: + /* */ if (_v) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (_v) { */ case 2: + _r$4 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + $24r = new Value.ptr(rt, (v), (fl | ((_r$4 >>> 0))) >>> 0); + $s = 10; case 10: return $24r; + /* } */ case 3: + _r$5 = t.Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + $24r$1 = new Value.ptr(rt, ($newDataPointer(v, jsType(rt.ptrTo()))), (((fl | ((_r$5 >>> 0))) >>> 0) | 128) >>> 0); + $s = 12; case 12: return $24r$1; + /* */ } return; } var $f = {$blk: makeValue, $c: true, $r, $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s};return $f; + }; + MakeSlice = function(typ, len, cap) { + var {$24r, _r, _r$1, cap, len, typ, $s, $r, $c} = $restore(this, {typ, len, cap}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + typ = [typ]; + _r = typ[0].Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 23))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 23))) { */ case 1: + $panic(new $String("reflect.MakeSlice of non-slice type")); + /* } */ case 2: + if (len < 0) { + $panic(new $String("reflect.MakeSlice: negative len")); + } + if (cap < 0) { + $panic(new $String("reflect.MakeSlice: negative cap")); + } + if (len > cap) { + $panic(new $String("reflect.MakeSlice: len > cap")); + } + _r$1 = makeValue(typ[0], $makeSlice(jsType(typ[0]), len, cap, (function(typ) { return function $b() { + var {$24r, _r$1, _r$2, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$1 = typ[0].Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = jsType(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2.zero(); + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r, _r$1, _r$2, $s};return $f; + }; })(typ)), 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r = _r$1; + $s = 5; case 5: return $24r; + /* */ } return; } var $f = {$blk: MakeSlice, $c: true, $r, $24r, _r, _r$1, cap, len, typ, $s};return $f; + }; + $pkg.MakeSlice = MakeSlice; + TypeOf = function(i) { + var i; + if (!initialized) { + return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$13.nil, 0, 0); + } + if ($interfaceIsEqual(i, $ifaceNil)) { + return $ifaceNil; + } + return reflectType(i.constructor); + }; + $pkg.TypeOf = TypeOf; + ValueOf = function(i) { + var {$24r, _r, i, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if ($interfaceIsEqual(i, $ifaceNil)) { + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + } + _r = makeValue(reflectType(i.constructor), i.$val, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: ValueOf, $c: true, $r, $24r, _r, i, $s};return $f; + }; + $pkg.ValueOf = ValueOf; + FuncOf = function(in$1, out, variadic) { + var {_i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s, $r, $c} = $restore(this, {in$1, out, variadic}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (!(variadic)) { _v = false; $s = 3; continue s; } + if (in$1.$length === 0) { _v$1 = true; $s = 4; continue s; } + _r = (x = in$1.$length - 1 >> 0, ((x < 0 || x >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x])).Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v$1 = !((_r === 23)); case 4: + _v = _v$1; case 3: + /* */ if (_v) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_v) { */ case 1: + $panic(new $String("reflect.FuncOf: last arg of variadic func must be slice")); + /* } */ case 2: + jsIn = $makeSlice(sliceType$16, in$1.$length); + _ref = in$1; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + ((i < 0 || i >= jsIn.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsIn.$array[jsIn.$offset + i] = jsType(v)); + _i++; + } + jsOut = $makeSlice(sliceType$16, out.$length); + _ref$1 = out; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + v$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); + ((i$1 < 0 || i$1 >= jsOut.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsOut.$array[jsOut.$offset + i$1] = jsType(v$1)); + _i$1++; + } + $s = -1; return reflectType($funcType($externalize(jsIn, sliceType$16), $externalize(jsOut, sliceType$16), $externalize(variadic, $Bool))); + /* */ } return; } var $f = {$blk: FuncOf, $c: true, $r, _i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s};return $f; + }; + $pkg.FuncOf = FuncOf; + rtype.ptr.prototype.ptrTo = function() { + var t; + t = this; + return reflectType($ptrType(jsType(t))); + }; + rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; + SliceOf = function(t) { + var t; + return reflectType($sliceType(jsType(t))); + }; + $pkg.SliceOf = SliceOf; + Zero = function(typ) { + var {$24r, _r, typ, $s, $r, $c} = $restore(this, {typ}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = makeValue(typ, jsType(typ).zero(), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Zero, $c: true, $r, $24r, _r, typ, $s};return $f; + }; + $pkg.Zero = Zero; + unsafe_New = function(typ) { + var _1, typ; + _1 = typ.Kind(); + if (_1 === (25)) { + return (new (jsType(typ).ptr)()); + } else if (_1 === (17)) { + return (jsType(typ).zero()); + } else { + return ($newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo()))); + } + }; + makeInt = function(f, bits, t) { + var {_1, _r, bits, f, ptr, t, typ, $s, $r, $c} = $restore(this, {f, bits, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + typ = _r; + ptr = unsafe_New(typ); + _1 = typ.Kind(); + if (_1 === (3)) { + (ptr).$set(((bits.$low << 24 >> 24))); + } else if (_1 === (4)) { + (ptr).$set(((bits.$low << 16 >> 16))); + } else if ((_1 === (2)) || (_1 === (5))) { + (ptr).$set(((bits.$low >> 0))); + } else if (_1 === (6)) { + (ptr).$set((new $Int64(bits.$high, bits.$low))); + } else if (_1 === (8)) { + (ptr).$set(((bits.$low << 24 >>> 24))); + } else if (_1 === (9)) { + (ptr).$set(((bits.$low << 16 >>> 16))); + } else if ((_1 === (7)) || (_1 === (10)) || (_1 === (12))) { + (ptr).$set(((bits.$low >>> 0))); + } else if (_1 === (11)) { + (ptr).$set((bits)); + } + $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); + /* */ } return; } var $f = {$blk: makeInt, $c: true, $r, _1, _r, bits, f, ptr, t, typ, $s};return $f; + }; + typedmemmove = function(t, dst, src) { + var dst, src, t; + dst.$set(src.$get()); + }; + keyFor = function(t, key) { + var k, key, kv, t; + kv = key; + if (!(kv.$get === undefined)) { + kv = kv.$get(); + } + k = jsType(t.Key()).keyFor(kv); + return [kv, k]; + }; + mapaccess = function(t, m, key) { + var _tuple, entry, k, key, m, t; + if (!!!(m)) { + return 0; + } + _tuple = keyFor(t, key); + k = _tuple[1]; + entry = m.get(k); + if (entry === undefined) { + return 0; + } + return ($newDataPointer(entry.v, jsType(PtrTo(t.Elem())))); + }; + mapassign = function(t, m, key, val) { + var {_r, _tuple, entry, et, jsVal, k, key, kv, m, newVal, t, val, $s, $r, $c} = $restore(this, {t, m, key, val}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _tuple = keyFor(t, key); + kv = _tuple[0]; + k = _tuple[1]; + jsVal = val.$get(); + et = t.Elem(); + _r = et.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r === 25) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_r === 25) { */ case 1: + newVal = jsType(et).zero(); + copyStruct(newVal, jsVal, et); + jsVal = newVal; + /* } */ case 2: + entry = new ($global.Object)(); + entry.k = kv; + entry.v = jsVal; + m.set(k, entry); + $s = -1; return; + /* */ } return; } var $f = {$blk: mapassign, $c: true, $r, _r, _tuple, entry, et, jsVal, k, key, kv, m, newVal, t, val, $s};return $f; + }; + mapdelete = function(t, m, key) { + var _tuple, k, key, m, t; + _tuple = keyFor(t, key); + k = _tuple[1]; + if (!!!(m)) { + return; + } + m.delete(k); + }; + mapaccess_faststr = function(t, m, key) { + var key, key$24ptr, m, t, val; + val = 0; + val = mapaccess(t, m, ((key$24ptr || (key$24ptr = new ptrType$18(function() { return key; }, function($v) { key = $v; }))))); + return val; + }; + mapassign_faststr = function(t, m, key, val) { + var {key, m, t, val, $s, $r, $c} = $restore(this, {t, m, key, val}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + key = [key]; + $r = mapassign(t, m, ((key.$ptr || (key.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, key)))), val); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: mapassign_faststr, $c: true, $r, key, m, t, val, $s};return $f; + }; + mapdelete_faststr = function(t, m, key) { + var key, key$24ptr, m, t; + mapdelete(t, m, ((key$24ptr || (key$24ptr = new ptrType$18(function() { return key; }, function($v) { key = $v; }))))); + }; + hiter.ptr.prototype.skipUntilValidKey = function() { + var entry, iter, k; + iter = this; + while (true) { + if (!(iter.i < $parseInt(iter.keys.length))) { break; } + k = iter.keys[iter.i]; + entry = iter.m.get(k); + if (!(entry === undefined)) { + break; + } + iter.i = iter.i + (1) >> 0; + } + }; + hiter.prototype.skipUntilValidKey = function() { return this.$val.skipUntilValidKey(); }; + mapiterinit = function(t, m, it) { + var it, keys, keysIter, m, mapObj, t; + mapObj = m; + keys = new ($global.Array)(); + if (!(mapObj.keys === undefined)) { + keysIter = mapObj.keys(); + if (!(mapObj.keys === undefined)) { + keys = $global.Array.from(keysIter); + } + } + hiter.copy(it, new hiter.ptr(t, mapObj, keys, 0, null)); + }; + mapiterkey = function(it) { + var {$24r, _r, _r$1, _r$2, it, k, kv, $s, $r, $c} = $restore(this, {it}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + kv = null; + if (!(it.last === null)) { + kv = it.last; + } else { + it.skipUntilValidKey(); + if (it.i === $parseInt(it.keys.length)) { + $s = -1; return 0; + } + k = it.keys[it.i]; + kv = it.m.get(k); + it.last = kv; + } + _r = it.t.Key(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = PtrTo(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = jsType(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = ($newDataPointer(kv.k, _r$2)); + $s = 4; case 4: return $24r; + /* */ } return; } var $f = {$blk: mapiterkey, $c: true, $r, $24r, _r, _r$1, _r$2, it, k, kv, $s};return $f; + }; + mapiterelem = function(it) { + var {$24r, _r, _r$1, _r$2, it, k, kv, $s, $r, $c} = $restore(this, {it}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + kv = null; + if (!(it.last === null)) { + kv = it.last; + } else { + it.skipUntilValidKey(); + if (it.i === $parseInt(it.keys.length)) { + $s = -1; return 0; + } + k = it.keys[it.i]; + kv = it.m.get(k); + it.last = kv; + } + _r = it.t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = PtrTo(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = jsType(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = ($newDataPointer(kv.v, _r$2)); + $s = 4; case 4: return $24r; + /* */ } return; } var $f = {$blk: mapiterelem, $c: true, $r, $24r, _r, _r$1, _r$2, it, k, kv, $s};return $f; + }; + mapiternext = function(it) { + var it; + it.last = null; + it.i = it.i + (1) >> 0; + }; + maplen = function(m) { + var m; + return $parseInt(m.size) >> 0; + }; + cvtDirect = function(v, typ) { + var {$24r, $24r$1, _1, _2, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, k, slice, srcVal, typ, v, val, $s, $r, $c} = $restore(this, {v, typ}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + srcVal = $clone(v, Value).object(); + /* */ if (srcVal === jsType(v.typ).nil) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (srcVal === jsType(v.typ).nil) { */ case 1: + _r = makeValue(typ, jsType(typ).nil, v.flag); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 4; case 4: return $24r; + /* } */ case 2: + val = null; + _r$1 = typ.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + k = _r$1; + _1 = k; + /* */ if (_1 === (23)) { $s = 7; continue; } + /* */ if (_1 === (22)) { $s = 8; continue; } + /* */ if (_1 === (25)) { $s = 9; continue; } + /* */ if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24)) || (_1 === (26))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (_1 === (23)) { */ case 7: + slice = new (jsType(typ))(srcVal.$array); + slice.$offset = srcVal.$offset; + slice.$length = srcVal.$length; + slice.$capacity = srcVal.$capacity; + val = $newDataPointer(slice, jsType(PtrTo(typ))); + $s = 12; continue; + /* } else if (_1 === (22)) { */ case 8: + _r$2 = typ.Elem(); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = _r$2.Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _2 = _r$3; + /* */ if (_2 === (25)) { $s = 16; continue; } + /* */ if (_2 === (17)) { $s = 17; continue; } + /* */ $s = 18; continue; + /* if (_2 === (25)) { */ case 16: + _r$4 = typ.Elem(); /* */ $s = 22; case 22: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ if ($interfaceIsEqual(_r$4, v.typ.Elem())) { $s = 20; continue; } + /* */ $s = 21; continue; + /* if ($interfaceIsEqual(_r$4, v.typ.Elem())) { */ case 20: + val = srcVal; + /* break; */ $s = 13; continue; + /* } */ case 21: + val = new (jsType(typ))(); + _arg = val; + _arg$1 = srcVal; + _r$5 = typ.Elem(); /* */ $s = 23; case 23: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$2 = _r$5; + $r = copyStruct(_arg, _arg$1, _arg$2); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 19; continue; + /* } else if (_2 === (17)) { */ case 17: + val = srcVal; + $s = 19; continue; + /* } else { */ case 18: + val = new (jsType(typ))(srcVal.$get, srcVal.$set); + /* } */ case 19: + case 13: + $s = 12; continue; + /* } else if (_1 === (25)) { */ case 9: + val = new (jsType(typ).ptr)(); + copyStruct(val, srcVal, typ); + $s = 12; continue; + /* } else if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24)) || (_1 === (26))) { */ case 10: + val = v.ptr; + $s = 12; continue; + /* } else { */ case 11: + $panic(new ValueError.ptr("reflect.Convert", k)); + /* } */ case 12: + case 5: + _r$6 = typ.common(); /* */ $s = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$7 = typ.Kind(); /* */ $s = 26; case 26: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + $24r$1 = new Value.ptr(_r$6, (val), (((new flag(v.flag).ro() | ((v.flag & 128) >>> 0)) >>> 0) | ((_r$7 >>> 0))) >>> 0); + $s = 27; case 27: return $24r$1; + /* */ } return; } var $f = {$blk: cvtDirect, $c: true, $r, $24r, $24r$1, _1, _2, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, k, slice, srcVal, typ, v, val, $s};return $f; + }; + cvtSliceArrayPtr = function(v, t) { + var {$24r, _r, _r$1, _r$2, alen, array, slen, slice, t, v, $s, $r, $c} = $restore(this, {v, t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + slice = $clone(v, Value).object(); + slen = $parseInt(slice.$length) >> 0; + _r = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = _r.Len(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + alen = _r$1; + if (alen > slen) { + $panic(new $String("reflect: cannot convert slice with length " + itoa.Itoa(slen) + " to pointer to array with length " + itoa.Itoa(alen))); + } + array = $sliceToGoArray(slice, jsType(t)); + _r$2 = t.common(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = new Value.ptr(_r$2, (array), (((v.flag & ~415) >>> 0) | 22) >>> 0); + $s = 4; case 4: return $24r; + /* */ } return; } var $f = {$blk: cvtSliceArrayPtr, $c: true, $r, $24r, _r, _r$1, _r$2, alen, array, slen, slice, t, v, $s};return $f; + }; + methodReceiver = function(op, v, i) { + var _$49, fn, i, m, m$1, ms, op, prop, rcvr, t, tt, v, x; + _$49 = ptrType$1.nil; + t = ptrType$19.nil; + fn = 0; + prop = ""; + if (v.typ.Kind() === 20) { + tt = (v.typ.kindType); + if (i < 0 || i >= tt.methods.$length) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m = (x = tt.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + if (!$clone(tt.rtype.nameOff(m.name), name).isExported()) { + $panic(new $String("reflect: " + op + " of unexported method")); + } + t = (tt.rtype.typeOff(m.typ).kindType); + prop = $clone(tt.rtype.nameOff(m.name), name).name(); + } else { + ms = v.typ.exportedMethods(); + if (((i >>> 0)) >= ((ms.$length >>> 0))) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); + if (!$clone(v.typ.nameOff(m$1.name), name).isExported()) { + $panic(new $String("reflect: " + op + " of unexported method")); + } + t = (v.typ.typeOff(m$1.mtyp).kindType); + prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); + } + rcvr = $clone(v, Value).object(); + if (isWrapped(v.typ)) { + rcvr = new (jsType(v.typ))(rcvr); + } + fn = (rcvr[$externalize(prop, $String)]); + return [_$49, t, fn]; + }; + valueInterface = function(v, safe) { + var {_r, cv, safe, v, $s, $r, $c} = $restore(this, {v, safe}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (v.flag === 0) { + $panic(new ValueError.ptr("reflect.Value.Interface", 0)); + } + if (safe && !((((v.flag & 96) >>> 0) === 0))) { + $panic(new $String("reflect.Value.Interface: cannot return value obtained from unexported field or method")); + } + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: + _r = makeMethodValue("Interface", $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + v = _r; + /* } */ case 2: + if (isWrapped(v.typ)) { + if (!((((v.flag & 128) >>> 0) === 0)) && ($clone(v, Value).Kind() === 25)) { + cv = jsType(v.typ).zero(); + copyStruct(cv, $clone(v, Value).object(), v.typ); + $s = -1; return ((new (jsType(v.typ))(cv))); + } + $s = -1; return ((new (jsType(v.typ))($clone(v, Value).object()))); + } + $s = -1; return (($clone(v, Value).object())); + /* */ } return; } var $f = {$blk: valueInterface, $c: true, $r, _r, cv, safe, v, $s};return $f; + }; + ifaceE2I = function(t, src, dst) { + var dst, src, t; + dst.$set(src); + }; + makeMethodValue = function(op, v) { + var {$24r, _r, _tuple, fn, fv, op, rcvr, v, $s, $r, $c} = $restore(this, {op, v}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fn = [fn]; + rcvr = [rcvr]; + if (((v.flag & 512) >>> 0) === 0) { + $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); + } + _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); + fn[0] = _tuple[2]; + rcvr[0] = $clone(v, Value).object(); + if (isWrapped(v.typ)) { + rcvr[0] = new (jsType(v.typ))(rcvr[0]); + } + fv = js.MakeFunc((function(fn, rcvr) { return function(this$1, arguments$1) { + var arguments$1, this$1; + return new $jsObjectPtr(fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$16))); + }; })(fn, rcvr)); + _r = $clone(v, Value).Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = new Value.ptr(_r, (fv), (new flag(v.flag).ro() | 19) >>> 0); + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: makeMethodValue, $c: true, $r, $24r, _r, _tuple, fn, fv, op, rcvr, v, $s};return $f; + }; + rtype.ptr.prototype.pointers = function() { + var _1, t; + t = this; + _1 = t.Kind(); + if ((_1 === (22)) || (_1 === (21)) || (_1 === (18)) || (_1 === (19)) || (_1 === (25)) || (_1 === (17))) { + return true; + } else { + return false; + } + }; + rtype.prototype.pointers = function() { return this.$val.pointers(); }; + rtype.ptr.prototype.Comparable = function() { + var {$24r, _1, _r, _r$1, i, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + t = this; + _1 = t.Kind(); + /* */ if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { $s = 2; continue; } + /* */ if (_1 === (17)) { $s = 3; continue; } + /* */ if (_1 === (25)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { */ case 2: + $s = -1; return false; + /* } else if (_1 === (17)) { */ case 3: + _r = t.Elem().Comparable(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 7; case 7: return $24r; + /* } else if (_1 === (25)) { */ case 4: + i = 0; + /* while (true) { */ case 8: + /* if (!(i < t.NumField())) { break; } */ if(!(i < t.NumField())) { $s = 9; continue; } + _r$1 = t.Field(i).Type.Comparable(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (!_r$1) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!_r$1) { */ case 10: + $s = -1; return false; + /* } */ case 11: + i = i + (1) >> 0; + $s = 8; continue; + case 9: + /* } */ case 5: + case 1: + $s = -1; return true; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.Comparable, $c: true, $r, $24r, _1, _r, _r$1, i, t, $s};return $f; + }; + rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; + rtype.ptr.prototype.Method = function(i) { + var {_i, _i$1, _r, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + prop = [prop]; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + t = this; + if (t.Kind() === 20) { + tt = (t.kindType); + Method.copy(m, tt.Method(i)); + $s = -1; return m; + } + methods = t.exportedMethods(); + if (i < 0 || i >= methods.$length) { + $panic(new $String("reflect: Method index out of range")); + } + p = $clone(((i < 0 || i >= methods.$length) ? ($throwRuntimeError("index out of range"), undefined) : methods.$array[methods.$offset + i]), method); + pname = $clone(t.nameOff(p.name), name); + m.Name = $clone(pname, name).name(); + fl = 19; + mtyp = t.typeOff(p.mtyp); + ft = (mtyp.kindType); + in$1 = $makeSlice(sliceType$17, 0, (1 + ft.in$().$length >> 0)); + in$1 = $append(in$1, t); + _ref = ft.in$(); + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + in$1 = $append(in$1, arg); + _i++; + } + out = $makeSlice(sliceType$17, 0, ft.out().$length); + _ref$1 = ft.out(); + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + ret = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); + out = $append(out, ret); + _i$1++; + } + _r = FuncOf(in$1, out, ft.rtype.IsVariadic()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + mt = _r; + m.Type = mt; + prop[0] = $internalize($methodSet(t.jsType)[i].prop, $String); + fn = js.MakeFunc((function(prop) { return function(this$1, arguments$1) { + var arguments$1, rcvr, this$1; + rcvr = (0 >= arguments$1.$length ? ($throwRuntimeError("index out of range"), undefined) : arguments$1.$array[arguments$1.$offset + 0]); + return new $jsObjectPtr(rcvr[$externalize(prop[0], $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$16))); + }; })(prop)); + m.Func = new Value.ptr($assertType(mt, ptrType$1), (fn), fl); + m.Index = i; + Method.copy(m, m); + $s = -1; return m; + /* */ } return; } var $f = {$blk: rtype.ptr.prototype.Method, $c: true, $r, _i, _i$1, _r, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s};return $f; + }; + rtype.prototype.Method = function(i) { return this.$val.Method(i); }; + Value.ptr.prototype.object = function() { + var _1, newVal, v, val; + v = this; + if ((v.typ.Kind() === 17) || (v.typ.Kind() === 25)) { + return v.ptr; + } + if (!((((v.flag & 128) >>> 0) === 0))) { + val = v.ptr.$get(); + if (!(val === $ifaceNil) && !(val.constructor === jsType(v.typ))) { + switch (0) { default: + _1 = v.typ.Kind(); + if ((_1 === (11)) || (_1 === (6))) { + val = new (jsType(v.typ))(val.$high, val.$low); + } else if ((_1 === (15)) || (_1 === (16))) { + val = new (jsType(v.typ))(val.$real, val.$imag); + } else if (_1 === (23)) { + if (val === val.constructor.nil) { + val = jsType(v.typ).nil; + break; + } + newVal = new (jsType(v.typ))(val.$array); + newVal.$offset = val.$offset; + newVal.$length = val.$length; + newVal.$capacity = val.$capacity; + val = newVal; + } + } + } + return val; + } + return v.ptr; + }; + Value.prototype.object = function() { return this.$val.object(); }; + Value.ptr.prototype.assignTo = function(context, dst, target) { + var {_r, _r$1, _r$2, context, dst, fl, target, v, x, $s, $r, $c} = $restore(this, {context, dst, target}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: + _r = makeMethodValue(context, $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + v = _r; + /* } */ case 2: + _r$1 = directlyAssignable(dst, v.typ); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 5; continue; } + /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (_r$1) { */ case 5: + fl = (((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0; + fl = (fl | (((dst.Kind() >>> 0)))) >>> 0; + $s = -1; return new Value.ptr(dst, v.ptr, fl); + /* } else if (implements$1(dst, v.typ)) { */ case 6: + if (target === 0) { + target = unsafe_New(dst); + } + _r$2 = valueInterface($clone(v, Value), false); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + x = _r$2; + if (dst.NumMethod() === 0) { + (target).$set(x); + } else { + ifaceE2I(dst, x, target); + } + $s = -1; return new Value.ptr(dst, target, 148); + /* } */ case 7: + case 4: + $panic(new $String(context + ": value of type " + v.typ.String() + " is not assignable to type " + dst.String())); + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.assignTo, $c: true, $r, _r, _r$1, _r$2, context, dst, fl, target, v, x, $s};return $f; + }; + Value.prototype.assignTo = function(context, dst, target) { return this.$val.assignTo(context, dst, target); }; + Value.ptr.prototype.call = function(op, in$1) { + var {$24r, _1, _arg, _arg$1, _arg$2, _arg$3, _i, _i$1, _i$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, arg, argsArray, elem, fn, i, i$1, i$2, i$3, in$1, isSlice, m, n, nin, nout, op, origIn, rcvr, results, ret, slice, t, targ, v, x, x$1, x$2, xt, xt$1, $s, $r, $c} = $restore(this, {op, in$1}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + t = ptrType$19.nil; + fn = 0; + rcvr = null; + if (!((((v.flag & 512) >>> 0) === 0))) { + _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); + t = _tuple[1]; + fn = _tuple[2]; + rcvr = $clone(v, Value).object(); + if (isWrapped(v.typ)) { + rcvr = new (jsType(v.typ))(rcvr); + } + } else { + t = (v.typ.kindType); + fn = ($clone(v, Value).object()); + rcvr = undefined; + } + if (fn === 0) { + $panic(new $String("reflect.Value.Call: call of nil function")); + } + isSlice = op === "CallSlice"; + n = t.rtype.NumIn(); + if (isSlice) { + if (!t.rtype.IsVariadic()) { + $panic(new $String("reflect: CallSlice of non-variadic function")); + } + if (in$1.$length < n) { + $panic(new $String("reflect: CallSlice with too few input arguments")); + } + if (in$1.$length > n) { + $panic(new $String("reflect: CallSlice with too many input arguments")); + } + } else { + if (t.rtype.IsVariadic()) { + n = n - (1) >> 0; + } + if (in$1.$length < n) { + $panic(new $String("reflect: Call with too few input arguments")); + } + if (!t.rtype.IsVariadic() && in$1.$length > n) { + $panic(new $String("reflect: Call with too many input arguments")); + } + } + _ref = in$1; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + if ($clone(x, Value).Kind() === 0) { + $panic(new $String("reflect: " + op + " using zero Value argument")); + } + _i++; + } + i = 0; + /* while (true) { */ case 1: + /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } + _tmp = $clone(((i < 0 || i >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i]), Value).Type(); + _tmp$1 = t.rtype.In(i); + xt = _tmp; + targ = _tmp$1; + _r = xt.AssignableTo(targ); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!_r) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!_r) { */ case 3: + _r$1 = xt.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = targ.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $panic(new $String("reflect: " + op + " using " + _r$1 + " as type " + _r$2)); + /* } */ case 4: + i = i + (1) >> 0; + $s = 1; continue; + case 2: + /* */ if (!isSlice && t.rtype.IsVariadic()) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (!isSlice && t.rtype.IsVariadic()) { */ case 8: + m = in$1.$length - n >> 0; + _r$3 = MakeSlice(t.rtype.In(n), m, m); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + slice = _r$3; + _r$4 = t.rtype.In(n).Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + elem = _r$4; + i$1 = 0; + /* while (true) { */ case 12: + /* if (!(i$1 < m)) { break; } */ if(!(i$1 < m)) { $s = 13; continue; } + x$2 = (x$1 = n + i$1 >> 0, ((x$1 < 0 || x$1 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x$1])); + xt$1 = $clone(x$2, Value).Type(); + _r$5 = xt$1.AssignableTo(elem); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + /* */ if (!_r$5) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (!_r$5) { */ case 14: + _r$6 = xt$1.String(); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$7 = elem.String(); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + $panic(new $String("reflect: cannot use " + _r$6 + " as type " + _r$7 + " in " + op)); + /* } */ case 15: + _r$8 = $clone(slice, Value).Index(i$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + $r = $clone(_r$8, Value).Set($clone(x$2, Value)); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i$1 = i$1 + (1) >> 0; + $s = 12; continue; + case 13: + origIn = in$1; + in$1 = $makeSlice(sliceType$7, (n + 1 >> 0)); + $copySlice($subslice(in$1, 0, n), origIn); + ((n < 0 || n >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + n] = slice); + /* } */ case 9: + nin = in$1.$length; + if (!((nin === t.rtype.NumIn()))) { + $panic(new $String("reflect.Value.Call: wrong argument count")); + } + nout = t.rtype.NumOut(); + argsArray = new ($global.Array)(t.rtype.NumIn()); + _ref$1 = in$1; + _i$1 = 0; + /* while (true) { */ case 21: + /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 22; continue; } + i$2 = _i$1; + arg = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); + _arg = t.rtype.In(i$2); + _r$9 = t.rtype.In(i$2).common(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + _arg$1 = _r$9; + _arg$2 = 0; + _r$10 = $clone(arg, Value).assignTo("reflect.Value.Call", _arg$1, _arg$2); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _r$11 = $clone(_r$10, Value).object(); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + _arg$3 = _r$11; + _r$12 = unwrapJsObject(_arg, _arg$3); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + argsArray[i$2] = _r$12; + _i$1++; + $s = 21; continue; + case 22: + _r$13 = callHelper(new sliceType$4([new $jsObjectPtr(fn), new $jsObjectPtr(rcvr), new $jsObjectPtr(argsArray)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + results = _r$13; + _1 = nout; + /* */ if (_1 === (0)) { $s = 29; continue; } + /* */ if (_1 === (1)) { $s = 30; continue; } + /* */ $s = 31; continue; + /* if (_1 === (0)) { */ case 29: + $s = -1; return sliceType$7.nil; + /* } else if (_1 === (1)) { */ case 30: + _r$14 = makeValue(t.rtype.Out(0), wrapJsObject(t.rtype.Out(0), results), 0); /* */ $s = 33; case 33: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } + $24r = new sliceType$7([$clone(_r$14, Value)]); + $s = 34; case 34: return $24r; + /* } else { */ case 31: + ret = $makeSlice(sliceType$7, nout); + _ref$2 = ret; + _i$2 = 0; + /* while (true) { */ case 35: + /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 36; continue; } + i$3 = _i$2; + _r$15 = makeValue(t.rtype.Out(i$3), wrapJsObject(t.rtype.Out(i$3), results[i$3]), 0); /* */ $s = 37; case 37: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } + ((i$3 < 0 || i$3 >= ret.$length) ? ($throwRuntimeError("index out of range"), undefined) : ret.$array[ret.$offset + i$3] = _r$15); + _i$2++; + $s = 35; continue; + case 36: + $s = -1; return ret; + /* } */ case 32: + case 28: + $s = -1; return sliceType$7.nil; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.call, $c: true, $r, $24r, _1, _arg, _arg$1, _arg$2, _arg$3, _i, _i$1, _i$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, arg, argsArray, elem, fn, i, i$1, i$2, i$3, in$1, isSlice, m, n, nin, nout, op, origIn, rcvr, results, ret, slice, t, targ, v, x, x$1, x$2, xt, xt$1, $s};return $f; + }; + Value.prototype.call = function(op, in$1) { return this.$val.call(op, in$1); }; + Value.ptr.prototype.Cap = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if (_1 === (17)) { + return v.typ.Len(); + } else if ((_1 === (18)) || (_1 === (23))) { + return $parseInt($clone(v, Value).object().$capacity) >> 0; + } + $panic(new ValueError.ptr("reflect.Value.Cap", k)); + }; + Value.prototype.Cap = function() { return this.$val.Cap(); }; + wrapJsObject = function(typ, val) { + var typ, val; + if ($interfaceIsEqual(typ, jsObjectPtr)) { + return new (jsType(jsObjectPtr))(val); + } + return val; + }; + unwrapJsObject = function(typ, val) { + var typ, val; + if ($interfaceIsEqual(typ, jsObjectPtr)) { + return val.object; + } + return val; + }; + Value.ptr.prototype.Elem = function() { + var {$24r, _1, _r, fl, k, tt, typ, v, val, val$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + k = new flag(v.flag).kind(); + _1 = k; + /* */ if (_1 === (20)) { $s = 2; continue; } + /* */ if (_1 === (22)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (_1 === (20)) { */ case 2: + val = $clone(v, Value).object(); + if (val === $ifaceNil) { + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + } + typ = reflectType(val.constructor); + _r = makeValue(typ, val.$val, new flag(v.flag).ro()); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 7; case 7: return $24r; + /* } else if (_1 === (22)) { */ case 3: + if ($clone(v, Value).IsNil()) { + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + } + val$1 = $clone(v, Value).object(); + tt = (v.typ.kindType); + fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; + fl = (fl | (((tt.elem.Kind() >>> 0)))) >>> 0; + $s = -1; return new Value.ptr(tt.elem, (wrapJsObject(tt.elem, val$1)), fl); + /* } else { */ case 4: + $panic(new ValueError.ptr("reflect.Value.Elem", k)); + /* } */ case 5: + case 1: + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Elem, $c: true, $r, $24r, _1, _r, fl, k, tt, typ, v, val, val$1, $s};return $f; + }; + Value.prototype.Elem = function() { return this.$val.Elem(); }; + Value.ptr.prototype.Field = function(i) { + var {$24r, _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + jsTag = [jsTag]; + prop = [prop]; + s = [s]; + typ = [typ]; + v = this; + if (!((new flag(v.flag).kind() === 25))) { + $panic(new ValueError.ptr("reflect.Value.Field", new flag(v.flag).kind())); + } + tt = (v.typ.kindType); + if (((i >>> 0)) >= ((tt.fields.$length >>> 0))) { + $panic(new $String("reflect: Field index out of range")); + } + prop[0] = $internalize(jsType(v.typ).fields[i].prop, $String); + field = (x = tt.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); + typ[0] = field.typ; + fl = (((v.flag & 416) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; + if (!$clone(field.name, name).isExported()) { + if (field.embedded()) { + fl = (fl | (64)) >>> 0; + } else { + fl = (fl | (32)) >>> 0; + } + } + tag = $clone((x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).name, name).tag(); + /* */ if (!(tag === "") && !((i === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(tag === "") && !((i === 0))) { */ case 1: + jsTag[0] = getJsTag(tag); + /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!(jsTag[0] === "")) { */ case 3: + /* while (true) { */ case 5: + o = [o]; + _r = $clone(v, Value).Field(0); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + v = _r; + /* */ if (v.typ === jsObjectPtr) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (v.typ === jsObjectPtr) { */ case 8: + o[0] = $clone(v, Value).object().object; + $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { + return $internalize(o[0][$externalize(jsTag[0], $String)], jsType(typ[0])); + }; })(jsTag, o, prop, s, typ), (function(jsTag, o, prop, s, typ) { return function(x$2) { + var x$2; + o[0][$externalize(jsTag[0], $String)] = $externalize(x$2, jsType(typ[0])); + }; })(jsTag, o, prop, s, typ))), fl); + /* } */ case 9: + /* */ if (v.typ.Kind() === 22) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (v.typ.Kind() === 22) { */ case 10: + _r$1 = $clone(v, Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + v = _r$1; + /* } */ case 11: + $s = 5; continue; + case 6: + /* } */ case 4: + /* } */ case 2: + s[0] = v.ptr; + /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 13: + $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { + return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); + }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { + var x$2; + s[0][$externalize(prop[0], $String)] = unwrapJsObject(typ[0], x$2); + }; })(jsTag, prop, s, typ))), fl); + /* } */ case 14: + _r$2 = makeValue(typ[0], wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]), fl); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r = _r$2; + $s = 16; case 16: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Field, $c: true, $r, $24r, _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s};return $f; + }; + Value.prototype.Field = function(i) { return this.$val.Field(i); }; + getJsTag = function(tag) { + var _tuple, i, name$1, qvalue, tag, value; + while (true) { + if (!(!(tag === ""))) { break; } + i = 0; + while (true) { + if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } + i = i + (1) >> 0; + } + tag = $substring(tag, i); + if (tag === "") { + break; + } + i = 0; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 32)) && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)))) { break; } + i = i + (1) >> 0; + } + if ((i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { + break; + } + name$1 = ($substring(tag, 0, i)); + tag = $substring(tag, (i + 1 >> 0)); + i = 1; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } + if (tag.charCodeAt(i) === 92) { + i = i + (1) >> 0; + } + i = i + (1) >> 0; + } + if (i >= tag.length) { + break; + } + qvalue = ($substring(tag, 0, (i + 1 >> 0))); + tag = $substring(tag, (i + 1 >> 0)); + if (name$1 === "js") { + _tuple = strconv.Unquote(qvalue); + value = _tuple[0]; + return value; + } + } + return ""; + }; + Value.ptr.prototype.Index = function(i) { + var {$24r, $24r$1, _1, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s, $r, $c} = $restore(this, {i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + a = [a]; + a$1 = [a$1]; + c = [c]; + i = [i]; + typ = [typ]; + typ$1 = [typ$1]; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + /* */ if (_1 === (17)) { $s = 2; continue; } + /* */ if (_1 === (23)) { $s = 3; continue; } + /* */ if (_1 === (24)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_1 === (17)) { */ case 2: + tt = (v.typ.kindType); + if (i[0] < 0 || i[0] > ((tt.len >> 0))) { + $panic(new $String("reflect: array index out of range")); + } + typ[0] = tt.elem; + fl = (((((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; + a[0] = v.ptr; + /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 7: + $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { + return wrapJsObject(typ[0], a[0][i[0]]); + }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { + var x; + a[0][i[0]] = unwrapJsObject(typ[0], x); + }; })(a, a$1, c, i, typ, typ$1))), fl); + /* } */ case 8: + _r = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 10; case 10: return $24r; + /* } else if (_1 === (23)) { */ case 3: + s = $clone(v, Value).object(); + if (i[0] < 0 || i[0] >= ($parseInt(s.$length) >> 0)) { + $panic(new $String("reflect: slice index out of range")); + } + tt$1 = (v.typ.kindType); + typ$1[0] = tt$1.elem; + fl$1 = (((384 | new flag(v.flag).ro()) >>> 0) | ((typ$1[0].Kind() >>> 0))) >>> 0; + i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; + a$1[0] = s.$array; + /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 11; continue; } + /* */ $s = 12; continue; + /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 11: + $s = -1; return new Value.ptr(typ$1[0], (new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { + return wrapJsObject(typ$1[0], a$1[0][i[0]]); + }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { + var x; + a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); + }; })(a, a$1, c, i, typ, typ$1))), fl$1); + /* } */ case 12: + _r$1 = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[0][i[0]]), fl$1); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r$1 = _r$1; + $s = 14; case 14: return $24r$1; + /* } else if (_1 === (24)) { */ case 4: + str = (v.ptr).$get(); + if (i[0] < 0 || i[0] >= str.length) { + $panic(new $String("reflect: string index out of range")); + } + fl$2 = (((new flag(v.flag).ro() | 8) >>> 0) | 128) >>> 0; + c[0] = str.charCodeAt(i[0]); + $s = -1; return new Value.ptr(uint8Type, ((c.$ptr || (c.$ptr = new ptrType$13(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))), fl$2); + /* } else { */ case 5: + $panic(new ValueError.ptr("reflect.Value.Index", k)); + /* } */ case 6: + case 1: + $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Index, $c: true, $r, $24r, $24r$1, _1, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s};return $f; + }; + Value.prototype.Index = function(i) { return this.$val.Index(i); }; + Value.ptr.prototype.InterfaceData = function() { + var v; + v = this; + $panic(errors.New("InterfaceData is not supported by GopherJS")); + }; + Value.prototype.InterfaceData = function() { return this.$val.InterfaceData(); }; + Value.ptr.prototype.IsNil = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if ((_1 === (22)) || (_1 === (23))) { + return $clone(v, Value).object() === jsType(v.typ).nil; + } else if (_1 === (18)) { + return $clone(v, Value).object() === $chanNil; + } else if (_1 === (19)) { + return $clone(v, Value).object() === $throwNilPointerError; + } else if (_1 === (21)) { + return $clone(v, Value).object() === false; + } else if (_1 === (20)) { + return $clone(v, Value).object() === $ifaceNil; + } else if (_1 === (26)) { + return $clone(v, Value).object() === 0; + } else { + $panic(new ValueError.ptr("reflect.Value.IsNil", k)); + } + }; + Value.prototype.IsNil = function() { return this.$val.IsNil(); }; + Value.ptr.prototype.Len = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if ((_1 === (17)) || (_1 === (24))) { + return $parseInt($clone(v, Value).object().length); + } else if (_1 === (23)) { + return $parseInt($clone(v, Value).object().$length) >> 0; + } else if (_1 === (18)) { + return $parseInt($clone(v, Value).object().$buffer.length) >> 0; + } else if (_1 === (21)) { + return $parseInt($clone(v, Value).object().size) >> 0; + } else { + $panic(new ValueError.ptr("reflect.Value.Len", k)); + } + }; + Value.prototype.Len = function() { return this.$val.Len(); }; + Value.ptr.prototype.Pointer = function() { + var _1, k, v; + v = this; + k = new flag(v.flag).kind(); + _1 = k; + if ((_1 === (18)) || (_1 === (21)) || (_1 === (22)) || (_1 === (26))) { + if ($clone(v, Value).IsNil()) { + return 0; + } + return $clone(v, Value).object(); + } else if (_1 === (19)) { + if ($clone(v, Value).IsNil()) { + return 0; + } + return 1; + } else if (_1 === (23)) { + if ($clone(v, Value).IsNil()) { + return 0; + } + return $clone(v, Value).object().$array; + } else { + $panic(new ValueError.ptr("reflect.Value.Pointer", k)); + } + }; + Value.prototype.Pointer = function() { return this.$val.Pointer(); }; + Value.ptr.prototype.Set = function(x) { + var {_1, _r, _r$1, v, x, $s, $r, $c} = $restore(this, {x}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(x.flag).mustBeExported(); + _r = $clone(x, Value).assignTo("reflect.Set", v.typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + x = _r; + /* */ if (!((((v.flag & 128) >>> 0) === 0))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((((v.flag & 128) >>> 0) === 0))) { */ case 2: + _1 = v.typ.Kind(); + /* */ if ((_1 === (17)) || (_1 === (25))) { $s = 5; continue; } + /* */ if (_1 === (20)) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if ((_1 === (17)) || (_1 === (25))) { */ case 5: + jsType(v.typ).copy(v.ptr, x.ptr); + $s = 8; continue; + /* } else if (_1 === (20)) { */ case 6: + _r$1 = valueInterface($clone(x, Value), false); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + v.ptr.$set(_r$1); + $s = 8; continue; + /* } else { */ case 7: + v.ptr.$set($clone(x, Value).object()); + /* } */ case 8: + case 4: + $s = -1; return; + /* } */ case 3: + v.ptr = x.ptr; + $s = -1; return; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Set, $c: true, $r, _1, _r, _r$1, v, x, $s};return $f; + }; + Value.prototype.Set = function(x) { return this.$val.Set(x); }; + Value.ptr.prototype.SetBytes = function(x) { + var {_r, _r$1, _v, slice, typedSlice, v, x, $s, $r, $c} = $restore(this, {x}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 8))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 8))) { */ case 1: + $panic(new $String("reflect.Value.SetBytes of non-byte slice")); + /* } */ case 2: + slice = x; + if (!(v.typ.Name() === "")) { _v = true; $s = 6; continue s; } + _r$1 = v.typ.Elem().Name(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = !(_r$1 === ""); case 6: + /* */ if (_v) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_v) { */ case 4: + typedSlice = new (jsType(v.typ))(slice.$array); + typedSlice.$offset = slice.$offset; + typedSlice.$length = slice.$length; + typedSlice.$capacity = slice.$capacity; + slice = typedSlice; + /* } */ case 5: + v.ptr.$set(slice); + $s = -1; return; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.SetBytes, $c: true, $r, _r, _r$1, _v, slice, typedSlice, v, x, $s};return $f; + }; + Value.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; + Value.ptr.prototype.SetCap = function(n) { + var n, newSlice, s, v; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + s = v.ptr.$get(); + if (n < ($parseInt(s.$length) >> 0) || n > ($parseInt(s.$capacity) >> 0)) { + $panic(new $String("reflect: slice capacity out of range in SetCap")); + } + newSlice = new (jsType(v.typ))(s.$array); + newSlice.$offset = s.$offset; + newSlice.$length = s.$length; + newSlice.$capacity = n; + v.ptr.$set(newSlice); + }; + Value.prototype.SetCap = function(n) { return this.$val.SetCap(n); }; + Value.ptr.prototype.SetLen = function(n) { + var n, newSlice, s, v; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + s = v.ptr.$get(); + if (n < 0 || n > ($parseInt(s.$capacity) >> 0)) { + $panic(new $String("reflect: slice length out of range in SetLen")); + } + newSlice = new (jsType(v.typ))(s.$array); + newSlice.$offset = s.$offset; + newSlice.$length = n; + newSlice.$capacity = s.$capacity; + v.ptr.$set(newSlice); + }; + Value.prototype.SetLen = function(n) { return this.$val.SetLen(n); }; + Value.ptr.prototype.Slice = function(i, j) { + var {$24r, $24r$1, _1, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s, $r, $c} = $restore(this, {i, j}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + cap = 0; + typ = $ifaceNil; + s = null; + kind = new flag(v.flag).kind(); + _1 = kind; + /* */ if (_1 === (17)) { $s = 2; continue; } + /* */ if (_1 === (23)) { $s = 3; continue; } + /* */ if (_1 === (24)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_1 === (17)) { */ case 2: + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); + } + tt = (v.typ.kindType); + cap = ((tt.len >> 0)); + typ = SliceOf(tt.elem); + s = new (jsType(typ))($clone(v, Value).object()); + $s = 6; continue; + /* } else if (_1 === (23)) { */ case 3: + typ = v.typ; + s = $clone(v, Value).object(); + cap = $parseInt(s.$capacity) >> 0; + $s = 6; continue; + /* } else if (_1 === (24)) { */ case 4: + str = (v.ptr).$get(); + if (i < 0 || j < i || j > str.length) { + $panic(new $String("reflect.Value.Slice: string slice index out of bounds")); + } + _r = ValueOf(new $String($substring(str, i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 8; case 8: return $24r; + /* } else { */ case 5: + $panic(new ValueError.ptr("reflect.Value.Slice", kind)); + /* } */ case 6: + case 1: + if (i < 0 || j < i || j > cap) { + $panic(new $String("reflect.Value.Slice: slice index out of bounds")); + } + _r$1 = makeValue(typ, $subslice(s, i, j), new flag(v.flag).ro()); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r$1 = _r$1; + $s = 10; case 10: return $24r$1; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Slice, $c: true, $r, $24r, $24r$1, _1, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s};return $f; + }; + Value.prototype.Slice = function(i, j) { return this.$val.Slice(i, j); }; + Value.ptr.prototype.Slice3 = function(i, j, k) { + var {$24r, _1, _r, cap, i, j, k, kind, s, tt, typ, v, $s, $r, $c} = $restore(this, {i, j, k}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + v = this; + cap = 0; + typ = $ifaceNil; + s = null; + kind = new flag(v.flag).kind(); + _1 = kind; + if (_1 === (17)) { + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); + } + tt = (v.typ.kindType); + cap = ((tt.len >> 0)); + typ = SliceOf(tt.elem); + s = new (jsType(typ))($clone(v, Value).object()); + } else if (_1 === (23)) { + typ = v.typ; + s = $clone(v, Value).object(); + cap = $parseInt(s.$capacity) >> 0; + } else { + $panic(new ValueError.ptr("reflect.Value.Slice3", kind)); + } + if (i < 0 || j < i || k < j || k > cap) { + $panic(new $String("reflect.Value.Slice3: slice index out of bounds")); + } + _r = makeValue(typ, $subslice(s, i, j, k), new flag(v.flag).ro()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: Value.ptr.prototype.Slice3, $c: true, $r, $24r, _1, _r, cap, i, j, k, kind, s, tt, typ, v, $s};return $f; + }; + Value.prototype.Slice3 = function(i, j, k) { return this.$val.Slice3(i, j, k); }; + Value.ptr.prototype.Close = function() { + var v; + v = this; + new flag(v.flag).mustBe(18); + new flag(v.flag).mustBeExported(); + $close($clone(v, Value).object()); + }; + Value.prototype.Close = function() { return this.$val.Close(); }; + chanrecv = function(ch, nb, val) { + var {_r, _tmp, _tmp$1, _tmp$2, _tmp$3, ch, comms, nb, received, recvRes, selectRes, selected, val, $s, $r, $c} = $restore(this, {ch, nb, val}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + selected = false; + received = false; + comms = new sliceType$18([new sliceType$16([ch])]); + if (nb) { + comms = $append(comms, new sliceType$16([])); + } + _r = selectHelper(new sliceType$4([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + selectRes = _r; + if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { + _tmp = false; + _tmp$1 = false; + selected = _tmp; + received = _tmp$1; + $s = -1; return [selected, received]; + } + recvRes = selectRes[1]; + val.$set(recvRes[0]); + _tmp$2 = true; + _tmp$3 = !!(recvRes[1]); + selected = _tmp$2; + received = _tmp$3; + $s = -1; return [selected, received]; + /* */ } return; } var $f = {$blk: chanrecv, $c: true, $r, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, ch, comms, nb, received, recvRes, selectRes, selected, val, $s};return $f; + }; + chansend = function(ch, val, nb) { + var {_r, ch, comms, nb, selectRes, val, $s, $r, $c} = $restore(this, {ch, val, nb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + comms = new sliceType$18([new sliceType$16([ch, val.$get()])]); + if (nb) { + comms = $append(comms, new sliceType$16([])); + } + _r = selectHelper(new sliceType$4([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + selectRes = _r; + if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { + $s = -1; return false; + } + $s = -1; return true; + /* */ } return; } var $f = {$blk: chansend, $c: true, $r, _r, ch, comms, nb, selectRes, val, $s};return $f; + }; + methodNameSkip = function() { + var _tuple, f, idx, name$1, pc; + _tuple = runtime.Caller(3); + pc = _tuple[0]; + f = runtime.FuncForPC(pc); + if (f === ptrType$4.nil) { + return "unknown method"; + } + name$1 = f.Name(); + idx = name$1.length - 1 >> 0; + while (true) { + if (!(idx > 0)) { break; } + if (name$1.charCodeAt(idx) === 46) { + break; + } + idx = idx - (1) >> 0; + } + if (idx < 0) { + return name$1; + } + return "Value" + $substring(name$1, idx); + }; + verifyNotInHeapPtr = function(p) { + var p; + return true; + }; + Value.methods = [{prop: "pointer", name: "pointer", pkg: "reflect", typ: $funcType([], [$UnsafePointer], false)}, {prop: "Addr", name: "Addr", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType$9], false)}, {prop: "runes", name: "runes", pkg: "reflect", typ: $funcType([], [sliceType$10], false)}, {prop: "CanAddr", name: "CanAddr", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "CanSet", name: "CanSet", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([sliceType$7], [sliceType$7], false)}, {prop: "CallSlice", name: "CallSlice", pkg: "", typ: $funcType([sliceType$7], [sliceType$7], false)}, {prop: "CanComplex", name: "CanComplex", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Complex", name: "Complex", pkg: "", typ: $funcType([], [$Complex128], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$6], [Value], false)}, {prop: "FieldByIndexErr", name: "FieldByIndexErr", pkg: "", typ: $funcType([sliceType$6], [Value, $error], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [Value], false)}, {prop: "CanFloat", name: "CanFloat", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "CanInt", name: "CanInt", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "CanInterface", name: "CanInterface", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "IsValid", name: "IsValid", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "MapIndex", name: "MapIndex", pkg: "", typ: $funcType([Value], [Value], false)}, {prop: "MapKeys", name: "MapKeys", pkg: "", typ: $funcType([], [sliceType$7], false)}, {prop: "SetIterKey", name: "SetIterKey", pkg: "", typ: $funcType([ptrType$22], [], false)}, {prop: "SetIterValue", name: "SetIterValue", pkg: "", typ: $funcType([ptrType$22], [], false)}, {prop: "MapRange", name: "MapRange", pkg: "", typ: $funcType([], [ptrType$22], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "OverflowComplex", name: "OverflowComplex", pkg: "", typ: $funcType([$Complex128], [$Bool], false)}, {prop: "OverflowFloat", name: "OverflowFloat", pkg: "", typ: $funcType([$Float64], [$Bool], false)}, {prop: "OverflowInt", name: "OverflowInt", pkg: "", typ: $funcType([$Int64], [$Bool], false)}, {prop: "OverflowUint", name: "OverflowUint", pkg: "", typ: $funcType([$Uint64], [$Bool], false)}, {prop: "Recv", name: "Recv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "recv", name: "recv", pkg: "reflect", typ: $funcType([$Bool], [Value, $Bool], false)}, {prop: "Send", name: "Send", pkg: "", typ: $funcType([Value], [], false)}, {prop: "send", name: "send", pkg: "reflect", typ: $funcType([Value, $Bool], [$Bool], false)}, {prop: "SetBool", name: "SetBool", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "setRunes", name: "setRunes", pkg: "reflect", typ: $funcType([sliceType$10], [], false)}, {prop: "SetComplex", name: "SetComplex", pkg: "", typ: $funcType([$Complex128], [], false)}, {prop: "SetFloat", name: "SetFloat", pkg: "", typ: $funcType([$Float64], [], false)}, {prop: "SetInt", name: "SetInt", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "SetMapIndex", name: "SetMapIndex", pkg: "", typ: $funcType([Value, Value], [], false)}, {prop: "SetUint", name: "SetUint", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "SetPointer", name: "SetPointer", pkg: "", typ: $funcType([$UnsafePointer], [], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "TryRecv", name: "TryRecv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "TrySend", name: "TrySend", pkg: "", typ: $funcType([Value], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "CanUint", name: "CanUint", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Uint", name: "Uint", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "UnsafeAddr", name: "UnsafeAddr", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "UnsafePointer", name: "UnsafePointer", pkg: "", typ: $funcType([], [$UnsafePointer], false)}, {prop: "Convert", name: "Convert", pkg: "", typ: $funcType([Type], [Value], false)}, {prop: "CanConvert", name: "CanConvert", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "object", name: "object", pkg: "reflect", typ: $funcType([], [ptrType$2], false)}, {prop: "assignTo", name: "assignTo", pkg: "reflect", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "call", name: "call", pkg: "reflect", typ: $funcType([$String, sliceType$7], [sliceType$7], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$7], false)}, {prop: "IsNil", name: "IsNil", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Pointer", name: "Pointer", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([Value], [], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType$9], [], false)}, {prop: "SetCap", name: "SetCap", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Slice", name: "Slice", pkg: "", typ: $funcType([$Int, $Int], [Value], false)}, {prop: "Slice3", name: "Slice3", pkg: "", typ: $funcType([$Int, $Int, $Int], [Value], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}]; + flag.methods = [{prop: "kind", name: "kind", pkg: "reflect", typ: $funcType([], [Kind], false)}, {prop: "ro", name: "ro", pkg: "reflect", typ: $funcType([], [flag], false)}, {prop: "mustBe", name: "mustBe", pkg: "reflect", typ: $funcType([Kind], [], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeExportedSlow", name: "mustBeExportedSlow", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignableSlow", name: "mustBeAssignableSlow", pkg: "reflect", typ: $funcType([], [], false)}]; + ptrType$23.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$22.methods = [{prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([Value], [], false)}]; Kind.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$1.methods = [{prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$5], false)}, {prop: "nameOff", name: "nameOff", pkg: "reflect", typ: $funcType([nameOff], [name], false)}, {prop: "typeOff", name: "typeOff", pkg: "reflect", typ: $funcType([typeOff], [ptrType$1], false)}, {prop: "ptrTo", name: "ptrTo", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "pointers", name: "pointers", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "textOff", name: "textOff", pkg: "reflect", typ: $funcType([textOff], [$UnsafePointer], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$5], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}]; + ptrType$1.methods = [{prop: "textOff", name: "textOff", pkg: "reflect", typ: $funcType([textOff], [$UnsafePointer], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$11], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "hasName", name: "hasName", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$6], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "gcSlice", name: "gcSlice", pkg: "reflect", typ: $funcType([$Uintptr, $Uintptr], [sliceType$9], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$9], false)}, {prop: "nameOff", name: "nameOff", pkg: "reflect", typ: $funcType([nameOff], [name], false)}, {prop: "typeOff", name: "typeOff", pkg: "reflect", typ: $funcType([typeOff], [ptrType$1], false)}, {prop: "ptrTo", name: "ptrTo", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "pointers", name: "pointers", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}]; ChanDir.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$7.methods = [{prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}]; - ptrType$17.methods = [{prop: "offset", name: "offset", pkg: "reflect", typ: $funcType([], [$Uintptr], false)}, {prop: "embedded", name: "embedded", pkg: "reflect", typ: $funcType([], [$Bool], false)}]; - ptrType$9.methods = [{prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [StructField], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}]; + ptrType$10.methods = [{prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}]; + ptrType$25.methods = [{prop: "offset", name: "offset", pkg: "reflect", typ: $funcType([], [$Uintptr], false)}, {prop: "embedded", name: "embedded", pkg: "reflect", typ: $funcType([], [$Bool], false)}]; + ptrType$12.methods = [{prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$6], [StructField], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}]; + Method.methods = [{prop: "IsExported", name: "IsExported", pkg: "", typ: $funcType([], [$Bool], false)}]; + StructField.methods = [{prop: "IsExported", name: "IsExported", pkg: "", typ: $funcType([], [$Bool], false)}]; StructTag.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "Lookup", name: "Lookup", pkg: "", typ: $funcType([$String], [$String, $Bool], false)}]; - Value.methods = [{prop: "object", name: "object", pkg: "reflect", typ: $funcType([], [ptrType$2], false)}, {prop: "assignTo", name: "assignTo", pkg: "reflect", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$12], false)}, {prop: "IsNil", name: "IsNil", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Pointer", name: "Pointer", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([Value], [], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType$15], [], false)}, {prop: "SetCap", name: "SetCap", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Slice", name: "Slice", pkg: "", typ: $funcType([$Int, $Int], [Value], false)}, {prop: "Slice3", name: "Slice3", pkg: "", typ: $funcType([$Int, $Int, $Int], [Value], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "call", name: "call", pkg: "reflect", typ: $funcType([$String, sliceType$9], [sliceType$9], false)}, {prop: "pointer", name: "pointer", pkg: "reflect", typ: $funcType([], [$UnsafePointer], false)}, {prop: "Addr", name: "Addr", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType$15], false)}, {prop: "runes", name: "runes", pkg: "reflect", typ: $funcType([], [sliceType$17], false)}, {prop: "CanAddr", name: "CanAddr", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "CanSet", name: "CanSet", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([sliceType$9], [sliceType$9], false)}, {prop: "CallSlice", name: "CallSlice", pkg: "", typ: $funcType([sliceType$9], [sliceType$9], false)}, {prop: "Complex", name: "Complex", pkg: "", typ: $funcType([], [$Complex128], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [Value], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [Value], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "CanInterface", name: "CanInterface", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "IsValid", name: "IsValid", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "MapIndex", name: "MapIndex", pkg: "", typ: $funcType([Value], [Value], false)}, {prop: "MapKeys", name: "MapKeys", pkg: "", typ: $funcType([], [sliceType$9], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "OverflowComplex", name: "OverflowComplex", pkg: "", typ: $funcType([$Complex128], [$Bool], false)}, {prop: "OverflowFloat", name: "OverflowFloat", pkg: "", typ: $funcType([$Float64], [$Bool], false)}, {prop: "OverflowInt", name: "OverflowInt", pkg: "", typ: $funcType([$Int64], [$Bool], false)}, {prop: "OverflowUint", name: "OverflowUint", pkg: "", typ: $funcType([$Uint64], [$Bool], false)}, {prop: "Recv", name: "Recv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "recv", name: "recv", pkg: "reflect", typ: $funcType([$Bool], [Value, $Bool], false)}, {prop: "Send", name: "Send", pkg: "", typ: $funcType([Value], [], false)}, {prop: "send", name: "send", pkg: "reflect", typ: $funcType([Value, $Bool], [$Bool], false)}, {prop: "SetBool", name: "SetBool", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "setRunes", name: "setRunes", pkg: "reflect", typ: $funcType([sliceType$17], [], false)}, {prop: "SetComplex", name: "SetComplex", pkg: "", typ: $funcType([$Complex128], [], false)}, {prop: "SetFloat", name: "SetFloat", pkg: "", typ: $funcType([$Float64], [], false)}, {prop: "SetInt", name: "SetInt", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "SetMapIndex", name: "SetMapIndex", pkg: "", typ: $funcType([Value, Value], [], false)}, {prop: "SetUint", name: "SetUint", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "SetPointer", name: "SetPointer", pkg: "", typ: $funcType([$UnsafePointer], [], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "TryRecv", name: "TryRecv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "TrySend", name: "TrySend", pkg: "", typ: $funcType([Value], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Uint", name: "Uint", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "UnsafeAddr", name: "UnsafeAddr", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Convert", name: "Convert", pkg: "", typ: $funcType([Type], [Value], false)}]; - flag.methods = [{prop: "kind", name: "kind", pkg: "reflect", typ: $funcType([], [Kind], false)}, {prop: "ro", name: "ro", pkg: "reflect", typ: $funcType([], [flag], false)}, {prop: "mustBe", name: "mustBe", pkg: "reflect", typ: $funcType([Kind], [], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "reflect", typ: $funcType([], [], false)}]; - ptrType$18.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - uncommonType.init("reflect", [{prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mcount", name: "mcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "xcount", name: "xcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "moff", name: "moff", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "_methods", name: "_methods", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); - funcType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: "reflect:\"func\""}, {prop: "inCount", name: "inCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "outCount", name: "outCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "_in", name: "_in", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "_out", name: "_out", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); - name.init("reflect", [{prop: "bytes", name: "bytes", embedded: false, exported: false, typ: ptrType$4, tag: ""}]); - nameData.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "exported", name: "exported", embedded: false, exported: false, typ: $Bool, tag: ""}]); - mapIter.init("reflect", [{prop: "t", name: "t", embedded: false, exported: false, typ: Type, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int, tag: ""}]); - Type.init([{prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$5], false)}]); - rtype.init("reflect", [{prop: "size", name: "size", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "tflag", name: "tflag", embedded: false, exported: false, typ: tflag, tag: ""}, {prop: "align", name: "align", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "alg", name: "alg", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "gcdata", name: "gcdata", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "str", name: "str", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", embedded: false, exported: false, typ: typeOff, tag: ""}]); - typeAlg.init("reflect", [{prop: "hash", name: "hash", embedded: false, exported: false, typ: funcType$4, tag: ""}, {prop: "equal", name: "equal", embedded: false, exported: false, typ: funcType$5, tag: ""}]); + ptrType$9.methods = [{prop: "methods", name: "methods", pkg: "reflect", typ: $funcType([], [sliceType$11], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$11], false)}]; + ptrType$19.methods = [{prop: "in$", name: "in", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}, {prop: "out", name: "out", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}]; + name.methods = [{prop: "data", name: "data", pkg: "reflect", typ: $funcType([$Int, $String], [ptrType$13], false)}, {prop: "hasTag", name: "hasTag", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "readVarint", name: "readVarint", pkg: "reflect", typ: $funcType([$Int], [$Int, $Int], false)}, {prop: "name", name: "name", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "tag", name: "tag", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "isExported", name: "isExported", pkg: "reflect", typ: $funcType([], [$Bool], false)}]; + ptrType$26.methods = [{prop: "initialized", name: "initialized", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "skipUntilValidKey", name: "skipUntilValidKey", pkg: "reflect", typ: $funcType([], [], false)}]; + Value.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "flag", embedded: true, exported: false, typ: flag, tag: ""}]); + ValueError.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Kind", name: "Kind", embedded: false, exported: true, typ: Kind, tag: ""}]); + MapIter.init("reflect", [{prop: "m", name: "m", embedded: false, exported: false, typ: Value, tag: ""}, {prop: "hiter", name: "hiter", embedded: false, exported: false, typ: hiter, tag: ""}]); + Type.init([{prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$6], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$9], false)}]); + rtype.init("reflect", [{prop: "size", name: "size", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "tflag", name: "tflag", embedded: false, exported: false, typ: tflag, tag: ""}, {prop: "align", name: "align", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "equal", name: "equal", embedded: false, exported: false, typ: funcType$4, tag: ""}, {prop: "gcdata", name: "gcdata", embedded: false, exported: false, typ: ptrType$13, tag: ""}, {prop: "str", name: "str", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", embedded: false, exported: false, typ: typeOff, tag: ""}]); method.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mtyp", name: "mtyp", embedded: false, exported: false, typ: typeOff, tag: ""}, {prop: "ifn", name: "ifn", embedded: false, exported: false, typ: textOff, tag: ""}, {prop: "tfn", name: "tfn", embedded: false, exported: false, typ: textOff, tag: ""}]); arrayType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "slice", name: "slice", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); chanType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "dir", name: "dir", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); imethod.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: typeOff, tag: ""}]); - interfaceType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "methods", name: "methods", embedded: false, exported: false, typ: sliceType$6, tag: ""}]); - mapType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "keysize", name: "keysize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "indirectkey", name: "indirectkey", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "indirectvalue", name: "indirectvalue", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "reflexivekey", name: "reflexivekey", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "needkeyupdate", name: "needkeyupdate", embedded: false, exported: false, typ: $Bool, tag: ""}]); + interfaceType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "methods", name: "methods", embedded: false, exported: false, typ: sliceType$14, tag: ""}]); + mapType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "hasher", name: "hasher", embedded: false, exported: false, typ: funcType$5, tag: ""}, {prop: "keysize", name: "keysize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "flags", name: "flags", embedded: false, exported: false, typ: $Uint32, tag: ""}]); ptrType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); sliceType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); structField.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: name, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "offsetEmbed", name: "offsetEmbed", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); - structType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "fields", name: "fields", embedded: false, exported: false, typ: sliceType$7, tag: ""}]); + structType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "fields", name: "fields", embedded: false, exported: false, typ: sliceType$15, tag: ""}]); Method.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: Value, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int, tag: ""}]); - StructField.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Tag", name: "Tag", embedded: false, exported: true, typ: StructTag, tag: ""}, {prop: "Offset", name: "Offset", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: sliceType$13, tag: ""}, {prop: "Anonymous", name: "Anonymous", embedded: false, exported: true, typ: $Bool, tag: ""}]); - fieldScan.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$9, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: sliceType$13, tag: ""}]); - Value.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "flag", embedded: true, exported: false, typ: flag, tag: ""}]); - ValueError.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Kind", name: "Kind", embedded: false, exported: true, typ: Kind, tag: ""}]); + StructField.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Tag", name: "Tag", embedded: false, exported: true, typ: StructTag, tag: ""}, {prop: "Offset", name: "Offset", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: sliceType$6, tag: ""}, {prop: "Anonymous", name: "Anonymous", embedded: false, exported: true, typ: $Bool, tag: ""}]); + fieldScan.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$12, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: sliceType$6, tag: ""}]); + uncommonType.init("reflect", [{prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mcount", name: "mcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "xcount", name: "xcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "moff", name: "moff", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "_methods", name: "_methods", embedded: false, exported: false, typ: sliceType$11, tag: ""}]); + funcType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: "reflect:\"func\""}, {prop: "inCount", name: "inCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "outCount", name: "outCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "_in", name: "_in", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "_out", name: "_out", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); + name.init("reflect", [{prop: "bytes", name: "bytes", embedded: false, exported: false, typ: ptrType$13, tag: ""}]); + nameData.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "exported", name: "exported", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: $String, tag: ""}]); + hiter.init("reflect", [{prop: "t", name: "t", embedded: false, exported: false, typ: Type, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "last", name: "last", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = unicode.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = abi.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = bytealg.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = goarch.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = goexperiment.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = itoa.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unsafeheader.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unicode.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } nameOffList = sliceType$1.nil; typeOffList = sliceType$2.nil; + kindNames = new sliceType$3(["invalid", "bool", "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", "float64", "complex64", "complex128", "array", "chan", "func", "interface", "map", "ptr", "slice", "string", "struct", "unsafe.Pointer"]); initialized = false; - uncommonTypeMap = {}; - nameMap = {}; - callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); - selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); - jsObjectPtr = reflectType($jsObjectPtr); - kindNames = new sliceType$4(["invalid", "bool", "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", "float64", "complex64", "complex128", "array", "chan", "func", "interface", "map", "ptr", "slice", "string", "struct", "unsafe.Pointer"]); + nameMap = new $global.Map(); uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); - $r = init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); + jsObjectPtr = reflectType($jsObjectPtr); + selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); + $r = init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["encoding/binary"] = (function() { + var $pkg = {}, $init, errors, io, math, reflect, sync, littleEndian, bigEndian, sliceType, overflow; + errors = $packages["errors"]; + io = $packages["io"]; + math = $packages["math"]; + reflect = $packages["reflect"]; + sync = $packages["sync"]; + littleEndian = $pkg.littleEndian = $newType(0, $kindStruct, "binary.littleEndian", true, "encoding/binary", false, function() { + this.$val = this; + if (arguments.length === 0) { + return; + } + }); + bigEndian = $pkg.bigEndian = $newType(0, $kindStruct, "binary.bigEndian", true, "encoding/binary", false, function() { + this.$val = this; + if (arguments.length === 0) { + return; + } + }); + sliceType = $sliceType($Uint8); + littleEndian.ptr.prototype.Uint16 = function(b) { + var b; + $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); + return ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) << 16 >>> 16)) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) << 16 >>> 16)) << 8 << 16 >>> 16)) >>> 0; + }; + littleEndian.prototype.Uint16 = function(b) { return this.$val.Uint16(b); }; + littleEndian.ptr.prototype.PutUint16 = function(b, v) { + var b, v; + $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); + (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = ((v << 24 >>> 24))); + (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (((v >>> 8 << 16 >>> 16) << 24 >>> 24))); + }; + littleEndian.prototype.PutUint16 = function(b, v) { return this.$val.PutUint16(b, v); }; + littleEndian.ptr.prototype.Uint32 = function(b) { + var b; + $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); + return ((((((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 0)) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >>> 0)) << 24 >>> 0)) >>> 0; + }; + littleEndian.prototype.Uint32 = function(b) { return this.$val.Uint32(b); }; + littleEndian.ptr.prototype.PutUint32 = function(b, v) { + var b, v; + $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); + (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = ((v << 24 >>> 24))); + (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (((v >>> 8 >>> 0) << 24 >>> 24))); + (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (((v >>> 16 >>> 0) << 24 >>> 24))); + (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = (((v >>> 24 >>> 0) << 24 >>> 24))); + }; + littleEndian.prototype.PutUint32 = function(b, v) { return this.$val.PutUint32(b, v); }; + littleEndian.ptr.prototype.Uint64 = function(b) { + var b, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); + return (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$7 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); + }; + littleEndian.prototype.Uint64 = function(b) { return this.$val.Uint64(b); }; + littleEndian.ptr.prototype.PutUint64 = function(b, v) { + var b, v; + $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); + (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = ((v.$low << 24 >>> 24))); + (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (($shiftRightUint64(v, 8).$low << 24 >>> 24))); + (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (($shiftRightUint64(v, 16).$low << 24 >>> 24))); + (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = (($shiftRightUint64(v, 24).$low << 24 >>> 24))); + (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4] = (($shiftRightUint64(v, 32).$low << 24 >>> 24))); + (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5] = (($shiftRightUint64(v, 40).$low << 24 >>> 24))); + (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6] = (($shiftRightUint64(v, 48).$low << 24 >>> 24))); + (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7] = (($shiftRightUint64(v, 56).$low << 24 >>> 24))); + }; + littleEndian.prototype.PutUint64 = function(b, v) { return this.$val.PutUint64(b, v); }; + littleEndian.ptr.prototype.String = function() { + return "LittleEndian"; + }; + littleEndian.prototype.String = function() { return this.$val.String(); }; + littleEndian.ptr.prototype.GoString = function() { + return "binary.LittleEndian"; + }; + littleEndian.prototype.GoString = function() { return this.$val.GoString(); }; + bigEndian.ptr.prototype.Uint16 = function(b) { + var b; + $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); + return ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) << 16 >>> 16)) | ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16)) >>> 0; + }; + bigEndian.prototype.Uint16 = function(b) { return this.$val.Uint16(b); }; + bigEndian.ptr.prototype.PutUint16 = function(b, v) { + var b, v; + $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); + (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = (((v >>> 8 << 16 >>> 16) << 24 >>> 24))); + (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = ((v << 24 >>> 24))); + }; + bigEndian.prototype.PutUint16 = function(b, v) { return this.$val.PutUint16(b, v); }; + bigEndian.ptr.prototype.Uint32 = function(b) { + var b; + $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); + return ((((((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >>> 0)) | ((((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 0)) << 24 >>> 0)) >>> 0; + }; + bigEndian.prototype.Uint32 = function(b) { return this.$val.Uint32(b); }; + bigEndian.ptr.prototype.PutUint32 = function(b, v) { + var b, v; + $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); + (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = (((v >>> 24 >>> 0) << 24 >>> 24))); + (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (((v >>> 16 >>> 0) << 24 >>> 24))); + (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (((v >>> 8 >>> 0) << 24 >>> 24))); + (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = ((v << 24 >>> 24))); + }; + bigEndian.prototype.PutUint32 = function(b, v) { return this.$val.PutUint32(b, v); }; + bigEndian.ptr.prototype.Uint64 = function(b) { + var b, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); + return (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$7 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); + }; + bigEndian.prototype.Uint64 = function(b) { return this.$val.Uint64(b); }; + bigEndian.ptr.prototype.PutUint64 = function(b, v) { + var b, v; + $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); + (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = (($shiftRightUint64(v, 56).$low << 24 >>> 24))); + (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (($shiftRightUint64(v, 48).$low << 24 >>> 24))); + (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (($shiftRightUint64(v, 40).$low << 24 >>> 24))); + (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = (($shiftRightUint64(v, 32).$low << 24 >>> 24))); + (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4] = (($shiftRightUint64(v, 24).$low << 24 >>> 24))); + (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5] = (($shiftRightUint64(v, 16).$low << 24 >>> 24))); + (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6] = (($shiftRightUint64(v, 8).$low << 24 >>> 24))); + (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7] = ((v.$low << 24 >>> 24))); + }; + bigEndian.prototype.PutUint64 = function(b, v) { return this.$val.PutUint64(b, v); }; + bigEndian.ptr.prototype.String = function() { + return "BigEndian"; + }; + bigEndian.prototype.String = function() { return this.$val.String(); }; + bigEndian.ptr.prototype.GoString = function() { + return "binary.BigEndian"; + }; + bigEndian.prototype.GoString = function() { return this.$val.GoString(); }; + littleEndian.methods = [{prop: "Uint16", name: "Uint16", pkg: "", typ: $funcType([sliceType], [$Uint16], false)}, {prop: "PutUint16", name: "PutUint16", pkg: "", typ: $funcType([sliceType, $Uint16], [], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([sliceType], [$Uint32], false)}, {prop: "PutUint32", name: "PutUint32", pkg: "", typ: $funcType([sliceType, $Uint32], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([sliceType], [$Uint64], false)}, {prop: "PutUint64", name: "PutUint64", pkg: "", typ: $funcType([sliceType, $Uint64], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; + bigEndian.methods = [{prop: "Uint16", name: "Uint16", pkg: "", typ: $funcType([sliceType], [$Uint16], false)}, {prop: "PutUint16", name: "PutUint16", pkg: "", typ: $funcType([sliceType, $Uint16], [], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([sliceType], [$Uint32], false)}, {prop: "PutUint32", name: "PutUint32", pkg: "", typ: $funcType([sliceType, $Uint32], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([sliceType], [$Uint64], false)}, {prop: "PutUint64", name: "PutUint64", pkg: "", typ: $funcType([sliceType, $Uint64], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; + littleEndian.init("", []); + bigEndian.init("", []); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = reflect.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.LittleEndian = new littleEndian.ptr(); + $pkg.BigEndian = new bigEndian.ptr(); + overflow = errors.New("binary: varint overflows a 64-bit integer"); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["crypto/md5"] = (function() { + var $pkg = {}, $init, crypto, binary, errors, hash, bits, digest, sliceType, arrayType, arrayType$1, arrayType$2, arrayType$3, arrayType$4, ptrType, block, blockGeneric, init, appendUint64, appendUint32, consumeUint64, consumeUint32, New, Sum; + crypto = $packages["crypto"]; + binary = $packages["encoding/binary"]; + errors = $packages["errors"]; + hash = $packages["hash"]; + bits = $packages["math/bits"]; + digest = $pkg.digest = $newType(0, $kindStruct, "md5.digest", true, "crypto/md5", false, function(s_, x_, nx_, len_) { + this.$val = this; + if (arguments.length === 0) { + this.s = arrayType$2.zero(); + this.x = arrayType$3.zero(); + this.nx = 0; + this.len = new $Uint64(0, 0); + return; + } + this.s = s_; + this.x = x_; + this.nx = nx_; + this.len = len_; + }); + sliceType = $sliceType($Uint8); + arrayType = $arrayType($Uint8, 8); + arrayType$1 = $arrayType($Uint8, 4); + arrayType$2 = $arrayType($Uint32, 4); + arrayType$3 = $arrayType($Uint8, 64); + arrayType$4 = $arrayType($Uint8, 16); + ptrType = $ptrType(digest); + block = function(dig, p) { + var dig, p; + blockGeneric(dig, p); + }; + blockGeneric = function(dig, p) { + var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, a, aa, b, bb, c, cc, d, dd, dig, i, p, q, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf; + _tmp = dig.s[0]; + _tmp$1 = dig.s[1]; + _tmp$2 = dig.s[2]; + _tmp$3 = dig.s[3]; + a = _tmp; + b = _tmp$1; + c = _tmp$2; + d = _tmp$3; + i = 0; + while (true) { + if (!(i <= (p.$length - 64 >> 0))) { break; } + q = $subslice(p, i); + q = $subslice(q, 0, 64, 64); + _tmp$4 = a; + _tmp$5 = b; + _tmp$6 = c; + _tmp$7 = d; + aa = _tmp$4; + bb = _tmp$5; + cc = _tmp$6; + dd = _tmp$7; + x0 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 0)); + x1 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 4)); + x2 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 8)); + x3 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 12)); + x4 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 16)); + x5 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 20)); + x6 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 24)); + x7 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 28)); + x8 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 32)); + x9 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 36)); + xa = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 40)); + xb = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 44)); + xc = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 48)); + xd = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 52)); + xe = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 56)); + xf = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 60)); + a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + x0 >>> 0) + 3614090360 >>> 0, 7) >>> 0; + d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + x1 >>> 0) + 3905402710 >>> 0, 12) >>> 0; + c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + x2 >>> 0) + 606105819 >>> 0, 17) >>> 0; + b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + x3 >>> 0) + 3250441966 >>> 0, 22) >>> 0; + a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + x4 >>> 0) + 4118548399 >>> 0, 7) >>> 0; + d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + x5 >>> 0) + 1200080426 >>> 0, 12) >>> 0; + c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + x6 >>> 0) + 2821735955 >>> 0, 17) >>> 0; + b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + x7 >>> 0) + 4249261313 >>> 0, 22) >>> 0; + a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + x8 >>> 0) + 1770035416 >>> 0, 7) >>> 0; + d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + x9 >>> 0) + 2336552879 >>> 0, 12) >>> 0; + c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + xa >>> 0) + 4294925233 >>> 0, 17) >>> 0; + b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + xb >>> 0) + 2304563134 >>> 0, 22) >>> 0; + a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + xc >>> 0) + 1804603682 >>> 0, 7) >>> 0; + d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + xd >>> 0) + 4254626195 >>> 0, 12) >>> 0; + c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + xe >>> 0) + 2792965006 >>> 0, 17) >>> 0; + b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + xf >>> 0) + 1236535329 >>> 0, 22) >>> 0; + a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + x1 >>> 0) + 4129170786 >>> 0, 5) >>> 0; + d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + x6 >>> 0) + 3225465664 >>> 0, 9) >>> 0; + c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + xb >>> 0) + 643717713 >>> 0, 14) >>> 0; + b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + x0 >>> 0) + 3921069994 >>> 0, 20) >>> 0; + a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + x5 >>> 0) + 3593408605 >>> 0, 5) >>> 0; + d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + xa >>> 0) + 38016083 >>> 0, 9) >>> 0; + c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + xf >>> 0) + 3634488961 >>> 0, 14) >>> 0; + b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + x4 >>> 0) + 3889429448 >>> 0, 20) >>> 0; + a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + x9 >>> 0) + 568446438 >>> 0, 5) >>> 0; + d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + xe >>> 0) + 3275163606 >>> 0, 9) >>> 0; + c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + x3 >>> 0) + 4107603335 >>> 0, 14) >>> 0; + b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + x8 >>> 0) + 1163531501 >>> 0, 20) >>> 0; + a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + xd >>> 0) + 2850285829 >>> 0, 5) >>> 0; + d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + x2 >>> 0) + 4243563512 >>> 0, 9) >>> 0; + c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + x7 >>> 0) + 1735328473 >>> 0, 14) >>> 0; + b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + xc >>> 0) + 2368359562 >>> 0, 20) >>> 0; + a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + x5 >>> 0) + 4294588738 >>> 0, 4) >>> 0; + d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + x8 >>> 0) + 2272392833 >>> 0, 11) >>> 0; + c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + xb >>> 0) + 1839030562 >>> 0, 16) >>> 0; + b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + xe >>> 0) + 4259657740 >>> 0, 23) >>> 0; + a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + x1 >>> 0) + 2763975236 >>> 0, 4) >>> 0; + d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + x4 >>> 0) + 1272893353 >>> 0, 11) >>> 0; + c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + x7 >>> 0) + 4139469664 >>> 0, 16) >>> 0; + b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + xa >>> 0) + 3200236656 >>> 0, 23) >>> 0; + a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + xd >>> 0) + 681279174 >>> 0, 4) >>> 0; + d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + x0 >>> 0) + 3936430074 >>> 0, 11) >>> 0; + c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + x3 >>> 0) + 3572445317 >>> 0, 16) >>> 0; + b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + x6 >>> 0) + 76029189 >>> 0, 23) >>> 0; + a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + x9 >>> 0) + 3654602809 >>> 0, 4) >>> 0; + d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + xc >>> 0) + 3873151461 >>> 0, 11) >>> 0; + c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + xf >>> 0) + 530742520 >>> 0, 16) >>> 0; + b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + x2 >>> 0) + 3299628645 >>> 0, 23) >>> 0; + a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + x0 >>> 0) + 4096336452 >>> 0, 6) >>> 0; + d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + x7 >>> 0) + 1126891415 >>> 0, 10) >>> 0; + c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + xe >>> 0) + 2878612391 >>> 0, 15) >>> 0; + b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + x5 >>> 0) + 4237533241 >>> 0, 21) >>> 0; + a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + xc >>> 0) + 1700485571 >>> 0, 6) >>> 0; + d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + x3 >>> 0) + 2399980690 >>> 0, 10) >>> 0; + c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + xa >>> 0) + 4293915773 >>> 0, 15) >>> 0; + b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + x1 >>> 0) + 2240044497 >>> 0, 21) >>> 0; + a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + x8 >>> 0) + 1873313359 >>> 0, 6) >>> 0; + d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + xf >>> 0) + 4264355552 >>> 0, 10) >>> 0; + c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + x6 >>> 0) + 2734768916 >>> 0, 15) >>> 0; + b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + xd >>> 0) + 1309151649 >>> 0, 21) >>> 0; + a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + x4 >>> 0) + 4149444226 >>> 0, 6) >>> 0; + d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + xb >>> 0) + 3174756917 >>> 0, 10) >>> 0; + c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + x2 >>> 0) + 718787259 >>> 0, 15) >>> 0; + b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + x9 >>> 0) + 3951481745 >>> 0, 21) >>> 0; + a = a + (aa) >>> 0; + b = b + (bb) >>> 0; + c = c + (cc) >>> 0; + d = d + (dd) >>> 0; + i = i + (64) >> 0; + } + _tmp$8 = a; + _tmp$9 = b; + _tmp$10 = c; + _tmp$11 = d; + dig.s[0] = _tmp$8; + dig.s[1] = _tmp$9; + dig.s[2] = _tmp$10; + dig.s[3] = _tmp$11; + }; + init = function() { + crypto.RegisterHash(2, New); + }; + digest.ptr.prototype.Reset = function() { + var d; + d = this; + d.s[0] = 1732584193; + d.s[1] = 4023233417; + d.s[2] = 2562383102; + d.s[3] = 271733878; + d.nx = 0; + d.len = new $Uint64(0, 0); + }; + digest.prototype.Reset = function() { return this.$val.Reset(); }; + digest.ptr.prototype.MarshalBinary = function() { + var b, d; + d = this; + b = $makeSlice(sliceType, 0, 92); + b = $appendSlice(b, "md5\x01"); + b = appendUint32(b, d.s[0]); + b = appendUint32(b, d.s[1]); + b = appendUint32(b, d.s[2]); + b = appendUint32(b, d.s[3]); + b = $appendSlice(b, $subslice(new sliceType(d.x), 0, d.nx)); + b = $subslice(b, 0, ((b.$length + 64 >> 0) - d.nx >> 0)); + b = appendUint64(b, d.len); + return [b, $ifaceNil]; + }; + digest.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; + digest.ptr.prototype.UnmarshalBinary = function(b) { + var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, d; + d = this; + if (b.$length < 4 || !(($bytesToString($subslice(b, 0, 4))) === "md5\x01")) { + return errors.New("crypto/md5: invalid hash state identifier"); + } + if (!((b.$length === 92))) { + return errors.New("crypto/md5: invalid hash state size"); + } + b = $subslice(b, 4); + _tuple = consumeUint32(b); + b = _tuple[0]; + d.s[0] = _tuple[1]; + _tuple$1 = consumeUint32(b); + b = _tuple$1[0]; + d.s[1] = _tuple$1[1]; + _tuple$2 = consumeUint32(b); + b = _tuple$2[0]; + d.s[2] = _tuple$2[1]; + _tuple$3 = consumeUint32(b); + b = _tuple$3[0]; + d.s[3] = _tuple$3[1]; + b = $subslice(b, $copySlice(new sliceType(d.x), b)); + _tuple$4 = consumeUint64(b); + b = _tuple$4[0]; + d.len = _tuple$4[1]; + d.nx = (($div64(d.len, new $Uint64(0, 64), true).$low >> 0)); + return $ifaceNil; + }; + digest.prototype.UnmarshalBinary = function(b) { return this.$val.UnmarshalBinary(b); }; + appendUint64 = function(b, x) { + var a, b, x; + a = arrayType.zero(); + $clone(binary.BigEndian, binary.bigEndian).PutUint64(new sliceType(a), x); + return $appendSlice(b, new sliceType(a)); + }; + appendUint32 = function(b, x) { + var a, b, x; + a = arrayType$1.zero(); + $clone(binary.BigEndian, binary.bigEndian).PutUint32(new sliceType(a), x); + return $appendSlice(b, new sliceType(a)); + }; + consumeUint64 = function(b) { + var b; + return [$subslice(b, 8), $clone(binary.BigEndian, binary.bigEndian).Uint64($subslice(b, 0, 8))]; + }; + consumeUint32 = function(b) { + var b; + return [$subslice(b, 4), $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(b, 0, 4))]; + }; + New = function() { + var d; + d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0)); + d.Reset(); + return d; + }; + $pkg.New = New; + digest.ptr.prototype.Size = function() { + var d; + d = this; + return 16; + }; + digest.prototype.Size = function() { return this.$val.Size(); }; + digest.ptr.prototype.BlockSize = function() { + var d; + d = this; + return 64; + }; + digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; + digest.ptr.prototype.Write = function(p) { + var d, err, n, n$1, nn, p, x, x$1; + nn = 0; + err = $ifaceNil; + d = this; + nn = p.$length; + d.len = (x = d.len, x$1 = (new $Uint64(0, nn)), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); + if (d.nx > 0) { + n = $copySlice($subslice(new sliceType(d.x), d.nx), p); + d.nx = d.nx + (n) >> 0; + if (d.nx === 64) { + if (false) { + block(d, new sliceType(d.x)); + } else { + blockGeneric(d, new sliceType(d.x)); + } + d.nx = 0; + } + p = $subslice(p, n); + } + if (p.$length >= 64) { + n$1 = (p.$length & ~63) >> 0; + if (false) { + block(d, $subslice(p, 0, n$1)); + } else { + blockGeneric(d, $subslice(p, 0, n$1)); + } + p = $subslice(p, n$1); + } + if (p.$length > 0) { + d.nx = $copySlice(new sliceType(d.x), p); + } + return [nn, err]; + }; + digest.prototype.Write = function(p) { return this.$val.Write(p); }; + digest.ptr.prototype.Sum = function(in$1) { + var d, d0, hash$1, in$1; + d = this; + d0 = $clone(d, digest); + hash$1 = $clone(d0.checkSum(), arrayType$4); + return $appendSlice(in$1, new sliceType(hash$1)); + }; + digest.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; + digest.ptr.prototype.checkSum = function() { + var d, digest$1, pad, tmp, x, x$1; + d = this; + tmp = $toNativeArray($kindUint8, [128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + pad = $div64(((x = d.len, new $Uint64(0 - x.$high, 55 - x.$low))), new $Uint64(0, 64), true); + $clone(binary.LittleEndian, binary.littleEndian).PutUint64($subslice(new sliceType(tmp), $flatten64(new $Uint64(0 + pad.$high, 1 + pad.$low))), $shiftLeft64(d.len, 3)); + d.Write($subslice(new sliceType(tmp), 0, $flatten64((x$1 = new $Uint64(0 + pad.$high, 1 + pad.$low), new $Uint64(x$1.$high + 0, x$1.$low + 8))))); + if (!((d.nx === 0))) { + $panic(new $String("d.nx != 0")); + } + digest$1 = arrayType$4.zero(); + $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 0), d.s[0]); + $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 4), d.s[1]); + $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 8), d.s[2]); + $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 12), d.s[3]); + return digest$1; + }; + digest.prototype.checkSum = function() { return this.$val.checkSum(); }; + Sum = function(data) { + var d, data; + d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0)); + d.Reset(); + d.Write(data); + return d.checkSum(); + }; + $pkg.Sum = Sum; + ptrType.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType], [$error], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "checkSum", name: "checkSum", pkg: "crypto/md5", typ: $funcType([], [arrayType$4], false)}]; + digest.init("crypto/md5", [{prop: "s", name: "s", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "x", name: "x", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "nx", name: "nx", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uint64, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = crypto.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = binary.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = errors.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = hash.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = bits.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["sort"] = (function() { + var $pkg = {}, $init, reflectlite, insertionSort, swapRange, Stable, stable, symMerge, rotate; + reflectlite = $packages["internal/reflectlite"]; + insertionSort = function(data, a, b) { + var {_r, _v, a, b, data, i, j, $s, $r, $c} = $restore(this, {data, a, b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + i = a + 1 >> 0; + /* while (true) { */ case 1: + /* if (!(i < b)) { break; } */ if(!(i < b)) { $s = 2; continue; } + j = i; + /* while (true) { */ case 3: + if (!(j > a)) { _v = false; $s = 5; continue s; } + _r = data.Less(j, j - 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 5: + /* if (!(_v)) { break; } */ if(!(_v)) { $s = 4; continue; } + $r = data.Swap(j, j - 1 >> 0); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + j = j - (1) >> 0; + $s = 3; continue; + case 4: + i = i + (1) >> 0; + $s = 1; continue; + case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: insertionSort, $c: true, $r, _r, _v, a, b, data, i, j, $s};return $f; + }; + swapRange = function(data, a, b, n) { + var {a, b, data, i, n, $s, $r, $c} = $restore(this, {data, a, b, n}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + i = 0; + /* while (true) { */ case 1: + /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } + $r = data.Swap(a + i >> 0, b + i >> 0); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i = i + (1) >> 0; + $s = 1; continue; + case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: swapRange, $c: true, $r, a, b, data, i, n, $s};return $f; + }; + Stable = function(data) { + var {_arg, _arg$1, _r, data, $s, $r, $c} = $restore(this, {data}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _arg = data; + _r = data.Len(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _arg$1 = _r; + $r = stable(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: Stable, $c: true, $r, _arg, _arg$1, _r, data, $s};return $f; + }; + $pkg.Stable = Stable; + stable = function(data, n) { + var {_tmp, _tmp$1, _tmp$2, _tmp$3, a, b, blockSize, data, m, n, $s, $r, $c} = $restore(this, {data, n}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + blockSize = 20; + _tmp = 0; + _tmp$1 = blockSize; + a = _tmp; + b = _tmp$1; + /* while (true) { */ case 1: + /* if (!(b <= n)) { break; } */ if(!(b <= n)) { $s = 2; continue; } + $r = insertionSort(data, a, b); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + a = b; + b = b + (blockSize) >> 0; + $s = 1; continue; + case 2: + $r = insertionSort(data, a, n); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* while (true) { */ case 5: + /* if (!(blockSize < n)) { break; } */ if(!(blockSize < n)) { $s = 6; continue; } + _tmp$2 = 0; + _tmp$3 = $imul(2, blockSize); + a = _tmp$2; + b = _tmp$3; + /* while (true) { */ case 7: + /* if (!(b <= n)) { break; } */ if(!(b <= n)) { $s = 8; continue; } + $r = symMerge(data, a, a + blockSize >> 0, b); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + a = b; + b = b + (($imul(2, blockSize))) >> 0; + $s = 7; continue; + case 8: + m = a + blockSize >> 0; + /* */ if (m < n) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (m < n) { */ case 10: + $r = symMerge(data, a, m, n); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 11: + blockSize = $imul(blockSize, (2)); + $s = 5; continue; + case 6: + $s = -1; return; + /* */ } return; } var $f = {$blk: stable, $c: true, $r, _tmp, _tmp$1, _tmp$2, _tmp$3, a, b, blockSize, data, m, n, $s};return $f; + }; + symMerge = function(data, a, m, b) { + var {_r, _r$1, _r$2, _tmp, _tmp$1, a, b, c, data, end, h, h$1, i, i$1, j, j$1, k, k$1, m, mid, n, p, r, start, $s, $r, $c} = $restore(this, {data, a, m, b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* */ if ((m - a >> 0) === 1) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((m - a >> 0) === 1) { */ case 1: + i = m; + j = b; + /* while (true) { */ case 3: + /* if (!(i < j)) { break; } */ if(!(i < j)) { $s = 4; continue; } + h = ((((((i + j >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); + _r = data.Less(h, a); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_r) { */ case 5: + i = h + 1 >> 0; + $s = 7; continue; + /* } else { */ case 6: + j = h; + /* } */ case 7: + $s = 3; continue; + case 4: + k = a; + /* while (true) { */ case 9: + /* if (!(k < (i - 1 >> 0))) { break; } */ if(!(k < (i - 1 >> 0))) { $s = 10; continue; } + $r = data.Swap(k, k + 1 >> 0); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + k = k + (1) >> 0; + $s = 9; continue; + case 10: + $s = -1; return; + /* } */ case 2: + /* */ if ((b - m >> 0) === 1) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if ((b - m >> 0) === 1) { */ case 12: + i$1 = a; + j$1 = m; + /* while (true) { */ case 14: + /* if (!(i$1 < j$1)) { break; } */ if(!(i$1 < j$1)) { $s = 15; continue; } + h$1 = ((((((i$1 + j$1 >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); + _r$1 = data.Less(m, h$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (!_r$1) { $s = 16; continue; } + /* */ $s = 17; continue; + /* if (!_r$1) { */ case 16: + i$1 = h$1 + 1 >> 0; + $s = 18; continue; + /* } else { */ case 17: + j$1 = h$1; + /* } */ case 18: + $s = 14; continue; + case 15: + k$1 = m; + /* while (true) { */ case 20: + /* if (!(k$1 > i$1)) { break; } */ if(!(k$1 > i$1)) { $s = 21; continue; } + $r = data.Swap(k$1, k$1 - 1 >> 0); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + k$1 = k$1 - (1) >> 0; + $s = 20; continue; + case 21: + $s = -1; return; + /* } */ case 13: + mid = ((((((a + b >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); + n = mid + m >> 0; + _tmp = 0; + _tmp$1 = 0; + start = _tmp; + r = _tmp$1; + if (m > mid) { + start = n - b >> 0; + r = mid; + } else { + start = a; + r = m; + } + p = n - 1 >> 0; + /* while (true) { */ case 23: + /* if (!(start < r)) { break; } */ if(!(start < r)) { $s = 24; continue; } + c = ((((((start + r >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); + _r$2 = data.Less(p - c >> 0, c); /* */ $s = 28; case 28: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (!_r$2) { $s = 25; continue; } + /* */ $s = 26; continue; + /* if (!_r$2) { */ case 25: + start = c + 1 >> 0; + $s = 27; continue; + /* } else { */ case 26: + r = c; + /* } */ case 27: + $s = 23; continue; + case 24: + end = n - start >> 0; + /* */ if (start < m && m < end) { $s = 29; continue; } + /* */ $s = 30; continue; + /* if (start < m && m < end) { */ case 29: + $r = rotate(data, start, m, end); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 30: + /* */ if (a < start && start < mid) { $s = 32; continue; } + /* */ $s = 33; continue; + /* if (a < start && start < mid) { */ case 32: + $r = symMerge(data, a, start, mid); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 33: + /* */ if (mid < end && end < b) { $s = 35; continue; } + /* */ $s = 36; continue; + /* if (mid < end && end < b) { */ case 35: + $r = symMerge(data, mid, end, b); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 36: + $s = -1; return; + /* */ } return; } var $f = {$blk: symMerge, $c: true, $r, _r, _r$1, _r$2, _tmp, _tmp$1, a, b, c, data, end, h, h$1, i, i$1, j, j$1, k, k$1, m, mid, n, p, r, start, $s};return $f; + }; + rotate = function(data, a, m, b) { + var {a, b, data, i, j, m, $s, $r, $c} = $restore(this, {data, a, m, b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + i = m - a >> 0; + j = b - m >> 0; + /* while (true) { */ case 1: + /* if (!(!((i === j)))) { break; } */ if(!(!((i === j)))) { $s = 2; continue; } + /* */ if (i > j) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (i > j) { */ case 3: + $r = swapRange(data, m - i >> 0, m, j); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i = i - (j) >> 0; + $s = 5; continue; + /* } else { */ case 4: + $r = swapRange(data, m - i >> 0, (m + j >> 0) - i >> 0, i); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + j = j - (i) >> 0; + /* } */ case 5: + $s = 1; continue; + case 2: + $r = swapRange(data, m - i >> 0, m, i); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return; + /* */ } return; } var $f = {$blk: rotate, $c: true, $r, a, b, data, i, j, m, $s};return $f; + }; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = reflectlite.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/fmtsort"] = (function() { + var $pkg = {}, $init, reflect, sort, SortedMap, ptrType, sliceType, Sort, compare, nilCompare, floatCompare, isNaN; + reflect = $packages["reflect"]; + sort = $packages["sort"]; + SortedMap = $pkg.SortedMap = $newType(0, $kindStruct, "fmtsort.SortedMap", true, "internal/fmtsort", true, function(Key_, Value_) { + this.$val = this; + if (arguments.length === 0) { + this.Key = sliceType.nil; + this.Value = sliceType.nil; + return; + } + this.Key = Key_; + this.Value = Value_; + }); + ptrType = $ptrType(SortedMap); + sliceType = $sliceType(reflect.Value); + SortedMap.ptr.prototype.Len = function() { + var o; + o = this; + return o.Key.$length; + }; + SortedMap.prototype.Len = function() { return this.$val.Len(); }; + SortedMap.ptr.prototype.Less = function(i, j) { + var {$24r, _r, i, j, o, x, x$1, $s, $r, $c} = $restore(this, {i, j}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + o = this; + _r = compare($clone((x = o.Key, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])), reflect.Value), $clone((x$1 = o.Key, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])), reflect.Value)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r < 0; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: SortedMap.ptr.prototype.Less, $c: true, $r, $24r, _r, i, j, o, x, x$1, $s};return $f; + }; + SortedMap.prototype.Less = function(i, j) { return this.$val.Less(i, j); }; + SortedMap.ptr.prototype.Swap = function(i, j) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, i, j, o, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; + o = this; + _tmp = (x = o.Key, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j])); + _tmp$1 = (x$1 = o.Key, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])); + (x$2 = o.Key, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i] = _tmp)); + (x$3 = o.Key, ((j < 0 || j >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + j] = _tmp$1)); + _tmp$2 = (x$4 = o.Value, ((j < 0 || j >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + j])); + _tmp$3 = (x$5 = o.Value, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])); + (x$6 = o.Value, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i] = _tmp$2)); + (x$7 = o.Value, ((j < 0 || j >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + j] = _tmp$3)); + }; + SortedMap.prototype.Swap = function(i, j) { return this.$val.Swap(i, j); }; + Sort = function(mapValue) { + var {_r, _r$1, _r$2, _r$3, iter, key, mapValue, n, sorted, value, $s, $r, $c} = $restore(this, {mapValue}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = $clone(mapValue, reflect.Value).Type().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 21))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 21))) { */ case 1: + $s = -1; return ptrType.nil; + /* } */ case 2: + n = $clone(mapValue, reflect.Value).Len(); + key = $makeSlice(sliceType, 0, n); + value = $makeSlice(sliceType, 0, n); + iter = $clone(mapValue, reflect.Value).MapRange(); + /* while (true) { */ case 4: + _r$1 = iter.Next(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* if (!(_r$1)) { break; } */ if(!(_r$1)) { $s = 5; continue; } + _r$2 = iter.Key(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + key = $append(key, _r$2); + _r$3 = iter.Value(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + value = $append(value, _r$3); + $s = 4; continue; + case 5: + sorted = new SortedMap.ptr(key, value); + $r = sort.Stable(sorted); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return sorted; + /* */ } return; } var $f = {$blk: Sort, $c: true, $r, _r, _r$1, _r$2, _r$3, iter, key, mapValue, n, sorted, value, $s};return $f; + }; + $pkg.Sort = Sort; + compare = function(aVal, bVal) { + var {$24r, _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, a, a$1, a$2, a$3, a$4, a$5, aType, aVal, ap, b, b$1, b$2, b$3, b$4, b$5, bType, bVal, bp, c, c$1, c$2, c$3, c$4, c$5, i, i$1, ok, ok$1, $s, $r, $c} = $restore(this, {aVal, bVal}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _tmp = $clone(aVal, reflect.Value).Type(); + _tmp$1 = $clone(bVal, reflect.Value).Type(); + aType = _tmp; + bType = _tmp$1; + if (!($interfaceIsEqual(aType, bType))) { + $s = -1; return -1; + } + _1 = $clone(aVal, reflect.Value).Kind(); + /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 2; continue; } + /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 3; continue; } + /* */ if (_1 === (24)) { $s = 4; continue; } + /* */ if ((_1 === (13)) || (_1 === (14))) { $s = 5; continue; } + /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 6; continue; } + /* */ if (_1 === (1)) { $s = 7; continue; } + /* */ if ((_1 === (22)) || (_1 === (26))) { $s = 8; continue; } + /* */ if (_1 === (18)) { $s = 9; continue; } + /* */ if (_1 === (25)) { $s = 10; continue; } + /* */ if (_1 === (17)) { $s = 11; continue; } + /* */ if (_1 === (20)) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 2: + _tmp$2 = $clone(aVal, reflect.Value).Int(); + _tmp$3 = $clone(bVal, reflect.Value).Int(); + a = _tmp$2; + b = _tmp$3; + if ((a.$high < b.$high || (a.$high === b.$high && a.$low < b.$low))) { + $s = -1; return -1; + } else if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { + $s = -1; return 1; + } else { + $s = -1; return 0; + } + $s = 14; continue; + /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 3: + _tmp$4 = $clone(aVal, reflect.Value).Uint(); + _tmp$5 = $clone(bVal, reflect.Value).Uint(); + a$1 = _tmp$4; + b$1 = _tmp$5; + if ((a$1.$high < b$1.$high || (a$1.$high === b$1.$high && a$1.$low < b$1.$low))) { + $s = -1; return -1; + } else if ((a$1.$high > b$1.$high || (a$1.$high === b$1.$high && a$1.$low > b$1.$low))) { + $s = -1; return 1; + } else { + $s = -1; return 0; + } + $s = 14; continue; + /* } else if (_1 === (24)) { */ case 4: + _r = $clone(aVal, reflect.Value).String(); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tmp$6 = _r; + _r$1 = $clone(bVal, reflect.Value).String(); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tmp$7 = _r$1; + a$2 = _tmp$6; + b$2 = _tmp$7; + if (a$2 < b$2) { + $s = -1; return -1; + } else if (a$2 > b$2) { + $s = -1; return 1; + } else { + $s = -1; return 0; + } + $s = 14; continue; + /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 5: + $s = -1; return floatCompare($clone(aVal, reflect.Value).Float(), $clone(bVal, reflect.Value).Float()); + /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 6: + _tmp$8 = $clone(aVal, reflect.Value).Complex(); + _tmp$9 = $clone(bVal, reflect.Value).Complex(); + a$3 = _tmp$8; + b$3 = _tmp$9; + c = floatCompare(a$3.$real, b$3.$real); + if (!((c === 0))) { + $s = -1; return c; + } + $s = -1; return floatCompare(a$3.$imag, b$3.$imag); + /* } else if (_1 === (1)) { */ case 7: + _tmp$10 = $clone(aVal, reflect.Value).Bool(); + _tmp$11 = $clone(bVal, reflect.Value).Bool(); + a$4 = _tmp$10; + b$4 = _tmp$11; + if (a$4 === b$4) { + $s = -1; return 0; + } else if (a$4) { + $s = -1; return 1; + } else { + $s = -1; return -1; + } + $s = 14; continue; + /* } else if ((_1 === (22)) || (_1 === (26))) { */ case 8: + _tmp$12 = $clone(aVal, reflect.Value).Pointer(); + _tmp$13 = $clone(bVal, reflect.Value).Pointer(); + a$5 = _tmp$12; + b$5 = _tmp$13; + if (a$5 < b$5) { + $s = -1; return -1; + } else if (a$5 > b$5) { + $s = -1; return 1; + } else { + $s = -1; return 0; + } + $s = 14; continue; + /* } else if (_1 === (18)) { */ case 9: + _tuple = nilCompare($clone(aVal, reflect.Value), $clone(bVal, reflect.Value)); + c$1 = _tuple[0]; + ok = _tuple[1]; + if (ok) { + $s = -1; return c$1; + } + _tmp$14 = $clone(aVal, reflect.Value).Pointer(); + _tmp$15 = $clone(bVal, reflect.Value).Pointer(); + ap = _tmp$14; + bp = _tmp$15; + if (ap < bp) { + $s = -1; return -1; + } else if (ap > bp) { + $s = -1; return 1; + } else { + $s = -1; return 0; + } + $s = 14; continue; + /* } else if (_1 === (25)) { */ case 10: + i = 0; + /* while (true) { */ case 17: + /* if (!(i < $clone(aVal, reflect.Value).NumField())) { break; } */ if(!(i < $clone(aVal, reflect.Value).NumField())) { $s = 18; continue; } + _r$2 = $clone(aVal, reflect.Value).Field(i); /* */ $s = 19; case 19: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _arg = $clone(_r$2, reflect.Value); + _r$3 = $clone(bVal, reflect.Value).Field(i); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _arg$1 = $clone(_r$3, reflect.Value); + _r$4 = compare(_arg, _arg$1); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + c$2 = _r$4; + if (!((c$2 === 0))) { + $s = -1; return c$2; + } + i = i + (1) >> 0; + $s = 17; continue; + case 18: + $s = -1; return 0; + /* } else if (_1 === (17)) { */ case 11: + i$1 = 0; + /* while (true) { */ case 22: + /* if (!(i$1 < $clone(aVal, reflect.Value).Len())) { break; } */ if(!(i$1 < $clone(aVal, reflect.Value).Len())) { $s = 23; continue; } + _r$5 = $clone(aVal, reflect.Value).Index(i$1); /* */ $s = 24; case 24: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$2 = $clone(_r$5, reflect.Value); + _r$6 = $clone(bVal, reflect.Value).Index(i$1); /* */ $s = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _arg$3 = $clone(_r$6, reflect.Value); + _r$7 = compare(_arg$2, _arg$3); /* */ $s = 26; case 26: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + c$3 = _r$7; + if (!((c$3 === 0))) { + $s = -1; return c$3; + } + i$1 = i$1 + (1) >> 0; + $s = 22; continue; + case 23: + $s = -1; return 0; + /* } else if (_1 === (20)) { */ case 12: + _tuple$1 = nilCompare($clone(aVal, reflect.Value), $clone(bVal, reflect.Value)); + c$4 = _tuple$1[0]; + ok$1 = _tuple$1[1]; + if (ok$1) { + $s = -1; return c$4; + } + _r$8 = $clone(aVal, reflect.Value).Elem(); /* */ $s = 27; case 27: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + _r$9 = $clone(_r$8, reflect.Value).Type(); /* */ $s = 28; case 28: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + _r$10 = reflect.ValueOf(_r$9); /* */ $s = 29; case 29: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _arg$4 = $clone(_r$10, reflect.Value); + _r$11 = $clone(bVal, reflect.Value).Elem(); /* */ $s = 30; case 30: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + _r$12 = $clone(_r$11, reflect.Value).Type(); /* */ $s = 31; case 31: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + _r$13 = reflect.ValueOf(_r$12); /* */ $s = 32; case 32: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + _arg$5 = $clone(_r$13, reflect.Value); + _r$14 = compare(_arg$4, _arg$5); /* */ $s = 33; case 33: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } + c$5 = _r$14; + if (!((c$5 === 0))) { + $s = -1; return c$5; + } + _r$15 = $clone(aVal, reflect.Value).Elem(); /* */ $s = 34; case 34: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } + _arg$6 = $clone(_r$15, reflect.Value); + _r$16 = $clone(bVal, reflect.Value).Elem(); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } + _arg$7 = $clone(_r$16, reflect.Value); + _r$17 = compare(_arg$6, _arg$7); /* */ $s = 36; case 36: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } + $24r = _r$17; + $s = 37; case 37: return $24r; + /* } else { */ case 13: + _r$18 = aType.String(); /* */ $s = 38; case 38: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } + $panic(new $String("bad type in compare: " + _r$18)); + /* } */ case 14: + case 1: + $s = -1; return 0; + /* */ } return; } var $f = {$blk: compare, $c: true, $r, $24r, _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, a, a$1, a$2, a$3, a$4, a$5, aType, aVal, ap, b, b$1, b$2, b$3, b$4, b$5, bType, bVal, bp, c, c$1, c$2, c$3, c$4, c$5, i, i$1, ok, ok$1, $s};return $f; + }; + nilCompare = function(aVal, bVal) { + var aVal, bVal; + if ($clone(aVal, reflect.Value).IsNil()) { + if ($clone(bVal, reflect.Value).IsNil()) { + return [0, true]; + } + return [-1, true]; + } + if ($clone(bVal, reflect.Value).IsNil()) { + return [1, true]; + } + return [0, false]; + }; + floatCompare = function(a, b) { + var a, b; + if (isNaN(a)) { + return -1; + } else if (isNaN(b)) { + return 1; + } else if (a < b) { + return -1; + } else if (a > b) { + return 1; + } + return 0; + }; + isNaN = function(a) { + var a; + return !((a === a)); + }; + ptrType.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}]; + SortedMap.init("", [{prop: "Key", name: "Key", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: sliceType, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = reflect.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sort.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/syscall/unix"] = (function() { + var $pkg = {}, $init, syscall, IsNonblock, RecvfromInet4, RecvfromInet6, SendtoInet4, SendtoInet6, SendmsgNInet4, SendmsgNInet6, RecvmsgInet4, RecvmsgInet6; + syscall = $packages["syscall"]; + IsNonblock = function(fd) { + var _tmp, _tmp$1, err, fd, nonblocking; + nonblocking = false; + err = $ifaceNil; + _tmp = false; + _tmp$1 = $ifaceNil; + nonblocking = _tmp; + err = _tmp$1; + return [nonblocking, err]; + }; + $pkg.IsNonblock = IsNonblock; + RecvfromInet4 = function(fd, p, flags, from) { + var fd, flags, from, p; + return [0, new syscall.Errno(38)]; + }; + $pkg.RecvfromInet4 = RecvfromInet4; + RecvfromInet6 = function(fd, p, flags, from) { + var _tmp, _tmp$1, err, fd, flags, from, n, p; + n = 0; + err = $ifaceNil; + _tmp = 0; + _tmp$1 = new syscall.Errno(38); + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + $pkg.RecvfromInet6 = RecvfromInet6; + SendtoInet4 = function(fd, p, flags, to) { + var err, fd, flags, p, to; + err = $ifaceNil; + err = new syscall.Errno(38); + return err; + }; + $pkg.SendtoInet4 = SendtoInet4; + SendtoInet6 = function(fd, p, flags, to) { + var err, fd, flags, p, to; + err = $ifaceNil; + err = new syscall.Errno(38); + return err; + }; + $pkg.SendtoInet6 = SendtoInet6; + SendmsgNInet4 = function(fd, p, oob, to, flags) { + var _tmp, _tmp$1, err, fd, flags, n, oob, p, to; + n = 0; + err = $ifaceNil; + _tmp = 0; + _tmp$1 = new syscall.Errno(38); + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + $pkg.SendmsgNInet4 = SendmsgNInet4; + SendmsgNInet6 = function(fd, p, oob, to, flags) { + var _tmp, _tmp$1, err, fd, flags, n, oob, p, to; + n = 0; + err = $ifaceNil; + _tmp = 0; + _tmp$1 = new syscall.Errno(38); + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + $pkg.SendmsgNInet6 = SendmsgNInet6; + RecvmsgInet4 = function(fd, p, oob, flags, from) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, err, fd, flags, from, n, oob, oobn, p, recvflags; + n = 0; + oobn = 0; + recvflags = 0; + err = $ifaceNil; + _tmp = 0; + _tmp$1 = 0; + _tmp$2 = 0; + _tmp$3 = new syscall.Errno(38); + n = _tmp; + oobn = _tmp$1; + recvflags = _tmp$2; + err = _tmp$3; + return [n, oobn, recvflags, err]; + }; + $pkg.RecvmsgInet4 = RecvmsgInet4; + RecvmsgInet6 = function(fd, p, oob, flags, from) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, err, fd, flags, from, n, oob, oobn, p, recvflags; + n = 0; + oobn = 0; + recvflags = 0; + err = $ifaceNil; + _tmp = 0; + _tmp$1 = 0; + _tmp$2 = 0; + _tmp$3 = new syscall.Errno(38); + n = _tmp; + oobn = _tmp$1; + recvflags = _tmp$2; + err = _tmp$3; + return [n, oobn, recvflags, err]; + }; + $pkg.RecvmsgInet6 = RecvmsgInet6; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = syscall.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/poll"] = (function() { + var $pkg = {}, $init, errors, unix, io, atomic, syscall, time, FD, pollDesc, fdMutex, errNetClosing, DeadlineExceededError, ptrType, ptrType$1, ptrType$2, ptrType$3, sliceType, ptrType$4, sliceType$1, ptrType$5, ptrType$6, ptrType$7, funcType, funcType$1, ptrType$8, ptrType$9, ptrType$10, tryDupCloexec, tryDupCloexec$24ptr, accept, runtime_Semacquire, runtime_Semrelease, DupCloseOnExec, dupCloseOnExecOld, ignoringEINTRIO, ignoringEINTR, setDeadlineImpl, errClosing, fcntl; + errors = $packages["errors"]; + unix = $packages["internal/syscall/unix"]; + io = $packages["io"]; + atomic = $packages["sync/atomic"]; + syscall = $packages["syscall"]; + time = $packages["time"]; + FD = $pkg.FD = $newType(0, $kindStruct, "poll.FD", true, "internal/poll", true, function(fdmu_, Sysfd_, pd_, iovecs_, csema_, isBlocking_, IsStream_, ZeroReadIsEOF_, isFile_) { + this.$val = this; + if (arguments.length === 0) { + this.fdmu = new fdMutex.ptr(new $Uint64(0, 0), 0, 0); + this.Sysfd = 0; + this.pd = new pollDesc.ptr(ptrType$2.nil, false); + this.iovecs = ptrType$4.nil; + this.csema = 0; + this.isBlocking = 0; + this.IsStream = false; + this.ZeroReadIsEOF = false; + this.isFile = false; + return; + } + this.fdmu = fdmu_; + this.Sysfd = Sysfd_; + this.pd = pd_; + this.iovecs = iovecs_; + this.csema = csema_; + this.isBlocking = isBlocking_; + this.IsStream = IsStream_; + this.ZeroReadIsEOF = ZeroReadIsEOF_; + this.isFile = isFile_; + }); + pollDesc = $pkg.pollDesc = $newType(0, $kindStruct, "poll.pollDesc", true, "internal/poll", false, function(fd_, closing_) { + this.$val = this; + if (arguments.length === 0) { + this.fd = ptrType$2.nil; + this.closing = false; + return; + } + this.fd = fd_; + this.closing = closing_; + }); + fdMutex = $pkg.fdMutex = $newType(0, $kindStruct, "poll.fdMutex", true, "internal/poll", false, function(state_, rsema_, wsema_) { + this.$val = this; + if (arguments.length === 0) { + this.state = new $Uint64(0, 0); + this.rsema = 0; + this.wsema = 0; + return; + } + this.state = state_; + this.rsema = rsema_; + this.wsema = wsema_; + }); + errNetClosing = $pkg.errNetClosing = $newType(0, $kindStruct, "poll.errNetClosing", true, "internal/poll", false, function() { + this.$val = this; + if (arguments.length === 0) { + return; + } + }); + DeadlineExceededError = $pkg.DeadlineExceededError = $newType(0, $kindStruct, "poll.DeadlineExceededError", true, "internal/poll", true, function() { + this.$val = this; + if (arguments.length === 0) { + return; + } + }); + ptrType = $ptrType($Uint32); + ptrType$1 = $ptrType($Int32); + ptrType$2 = $ptrType(FD); + ptrType$3 = $ptrType($Uint64); + sliceType = $sliceType(syscall.Iovec); + ptrType$4 = $ptrType(sliceType); + sliceType$1 = $sliceType($Uint8); + ptrType$5 = $ptrType(syscall.SockaddrInet4); + ptrType$6 = $ptrType(syscall.SockaddrInet6); + ptrType$7 = $ptrType(syscall.Stat_t); + funcType = $funcType([$Uintptr], [$Bool], false); + funcType$1 = $funcType([$Uintptr], [], false); + ptrType$8 = $ptrType(pollDesc); + ptrType$9 = $ptrType(fdMutex); + ptrType$10 = $ptrType(DeadlineExceededError); + accept = function(s) { + var {_r, _r$1, _tuple, err, ns, s, sa, $s, $r, $c} = $restore(this, {s}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = $pkg.AcceptFunc(s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + ns = _tuple[0]; + sa = _tuple[1]; + err = _tuple[2]; + if ($interfaceIsEqual(err, $ifaceNil)) { + syscall.CloseOnExec(ns); + } + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [-1, $ifaceNil, "accept", err]; + } + err = syscall.SetNonblock(ns, true); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + _r$1 = $pkg.CloseFunc(ns); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + $s = -1; return [-1, $ifaceNil, "setnonblock", err]; + /* } */ case 3: + $s = -1; return [ns, sa, "", $ifaceNil]; + /* */ } return; } var $f = {$blk: accept, $c: true, $r, _r, _r$1, _tuple, err, ns, s, sa, $s};return $f; + }; + runtime_Semacquire = function() { + $throwRuntimeError("native function not implemented: internal/poll.runtime_Semacquire"); + }; + runtime_Semrelease = function() { + $throwRuntimeError("native function not implemented: internal/poll.runtime_Semrelease"); + }; + FD.ptr.prototype.Init = function(net, pollable) { + var err, fd, net, pollable; + fd = this; + if (net === "file") { + fd.isFile = true; + } + if (!pollable) { + fd.isBlocking = 1; + return $ifaceNil; + } + err = fd.pd.init(fd); + if (!($interfaceIsEqual(err, $ifaceNil))) { + fd.isBlocking = 1; + } + return err; + }; + FD.prototype.Init = function(net, pollable) { return this.$val.Init(net, pollable); }; + FD.ptr.prototype.destroy = function() { + var {_r, err, fd, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + fd.pd.close(); + _r = $pkg.CloseFunc(fd.Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + fd.Sysfd = -1; + $r = runtime_Semrelease((fd.$ptr_csema || (fd.$ptr_csema = new ptrType(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = -1; return err; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.destroy, $c: true, $r, _r, err, fd, $s};return $f; + }; + FD.prototype.destroy = function() { return this.$val.destroy(); }; + FD.ptr.prototype.Close = function() { + var {_r, _r$1, err, fd, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = fd.fdmu.increfAndClose(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!_r) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!_r) { */ case 1: + $s = -1; return errClosing(fd.isFile); + /* } */ case 2: + fd.pd.evict(); + _r$1 = fd.decref(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + err = _r$1; + /* */ if (fd.isBlocking === 0) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (fd.isBlocking === 0) { */ case 5: + $r = runtime_Semacquire((fd.$ptr_csema || (fd.$ptr_csema = new ptrType(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 6: + $s = -1; return err; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.Close, $c: true, $r, _r, _r$1, err, fd, $s};return $f; + }; + FD.prototype.Close = function() { return this.$val.Close(); }; + FD.ptr.prototype.SetBlocking = function() { + var {$24r, $24r$1, err, fd, $s, $deferred, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + atomic.StoreUint32((fd.$ptr_isBlocking || (fd.$ptr_isBlocking = new ptrType(function() { return this.$target.isBlocking; }, function($v) { this.$target.isBlocking = $v; }, fd))), 1); + $24r$1 = syscall.SetNonblock(fd.Sysfd, false); + $s = 4; case 4: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.SetBlocking, $c: true, $r, $24r, $24r$1, err, fd, $s, $deferred};return $f; } } + }; + FD.prototype.SetBlocking = function() { return this.$val.SetBlocking(); }; + FD.ptr.prototype.Read = function(p) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _tuple, err, err$1, err$2, fd, n, p, $s, $deferred, $r, $c} = $restore(this, {p}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + /* */ if (p.$length === 0) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (p.$length === 0) { */ case 5: + $24r$1 = [0, $ifaceNil]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 8: + $24r$2 = [0, err$1]; + $s = 10; case 10: return $24r$2; + /* } */ case 9: + if (fd.IsStream && p.$length > 1073741824) { + p = $subslice(p, 0, 1073741824); + } + /* while (true) { */ case 11: + _r$1 = ignoringEINTRIO(syscall.Read, fd.Sysfd, p); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + n = _tuple[0]; + err$2 = _tuple[1]; + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + n = 0; + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 11; continue; + } + } + } + err$2 = fd.eofError(n, err$2); + $24r$3 = [n, err$2]; + $s = 14; case 14: return $24r$3; + case 12: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Read, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _tuple, err, err$1, err$2, fd, n, p, $s, $deferred};return $f; } } + }; + FD.prototype.Read = function(p) { return this.$val.Read(p); }; + FD.ptr.prototype.Pread = function(p, off) { + var {_r, _r$1, _tuple, err, err$1, fd, n, off, p, $s, $r, $c} = $restore(this, {p, off}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + err = fd.incref(); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [0, err]; + } + if (fd.IsStream && p.$length > 1073741824) { + p = $subslice(p, 0, 1073741824); + } + n = 0; + err$1 = $ifaceNil; + /* while (true) { */ case 1: + _r = syscall.Pread(fd.Sysfd, p, off); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + n = _tuple[0]; + err$1 = _tuple[1]; + if (!($interfaceIsEqual(err$1, new syscall.Errno(4)))) { + /* break; */ $s = 2; continue; + } + $s = 1; continue; + case 2: + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + n = 0; + } + _r$1 = fd.decref(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + err$1 = fd.eofError(n, err$1); + $s = -1; return [n, err$1]; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.Pread, $c: true, $r, _r, _r$1, _tuple, err, err$1, fd, n, off, p, $s};return $f; + }; + FD.prototype.Pread = function(p, off) { return this.$val.Pread(p, off); }; + FD.ptr.prototype.ReadFrom = function(p) { + var {$24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, n, p, sa, $s, $deferred, $r, $c} = $restore(this, {p}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, $ifaceNil, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, $ifaceNil, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = syscall.Recvfrom(fd.Sysfd, p, 0); + n = _tuple[0]; + sa = _tuple[1]; + err$2 = _tuple[2]; + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + n = 0; + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + } + err$2 = fd.eofError(n, err$2); + $24r$2 = [n, sa, err$2]; + $s = 10; case 10: return $24r$2; + case 9: + $s = -1; return [0, $ifaceNil, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.ReadFrom, $c: true, $r, $24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, n, p, sa, $s, $deferred};return $f; } } + }; + FD.prototype.ReadFrom = function(p) { return this.$val.ReadFrom(p); }; + FD.ptr.prototype.ReadFromInet4 = function(p, from) { + var {$24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, from, n, p, $s, $deferred, $r, $c} = $restore(this, {p, from}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = unix.RecvfromInet4(fd.Sysfd, p, 0, from); + n = _tuple[0]; + err$2 = _tuple[1]; + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + n = 0; + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + } + err$2 = fd.eofError(n, err$2); + $24r$2 = [n, err$2]; + $s = 10; case 10: return $24r$2; + case 9: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.ReadFromInet4, $c: true, $r, $24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, from, n, p, $s, $deferred};return $f; } } + }; + FD.prototype.ReadFromInet4 = function(p, from) { return this.$val.ReadFromInet4(p, from); }; + FD.ptr.prototype.ReadFromInet6 = function(p, from) { + var {$24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, from, n, p, $s, $deferred, $r, $c} = $restore(this, {p, from}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = unix.RecvfromInet6(fd.Sysfd, p, 0, from); + n = _tuple[0]; + err$2 = _tuple[1]; + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + n = 0; + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + } + err$2 = fd.eofError(n, err$2); + $24r$2 = [n, err$2]; + $s = 10; case 10: return $24r$2; + case 9: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.ReadFromInet6, $c: true, $r, $24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, from, n, p, $s, $deferred};return $f; } } + }; + FD.prototype.ReadFromInet6 = function(p, from) { return this.$val.ReadFromInet6(p, from); }; + FD.ptr.prototype.ReadMsg = function(p, oob, flags) { + var {$24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa, sysflags, $s, $deferred, $r, $c} = $restore(this, {p, oob, flags}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, 0, 0, $ifaceNil, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, 0, 0, $ifaceNil, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = syscall.Recvmsg(fd.Sysfd, p, oob, flags); + n = _tuple[0]; + oobn = _tuple[1]; + sysflags = _tuple[2]; + sa = _tuple[3]; + err$2 = _tuple[4]; + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + } + err$2 = fd.eofError(n, err$2); + $24r$2 = [n, oobn, sysflags, sa, err$2]; + $s = 10; case 10: return $24r$2; + case 9: + $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.ReadMsg, $c: true, $r, $24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa, sysflags, $s, $deferred};return $f; } } + }; + FD.prototype.ReadMsg = function(p, oob, flags) { return this.$val.ReadMsg(p, oob, flags); }; + FD.ptr.prototype.ReadMsgInet4 = function(p, oob, flags, sa4) { + var {$24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa4, sysflags, $s, $deferred, $r, $c} = $restore(this, {p, oob, flags, sa4}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, 0, 0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, 0, 0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = unix.RecvmsgInet4(fd.Sysfd, p, oob, flags, sa4); + n = _tuple[0]; + oobn = _tuple[1]; + sysflags = _tuple[2]; + err$2 = _tuple[3]; + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + } + err$2 = fd.eofError(n, err$2); + $24r$2 = [n, oobn, sysflags, err$2]; + $s = 10; case 10: return $24r$2; + case 9: + $s = -1; return [0, 0, 0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.ReadMsgInet4, $c: true, $r, $24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa4, sysflags, $s, $deferred};return $f; } } + }; + FD.prototype.ReadMsgInet4 = function(p, oob, flags, sa4) { return this.$val.ReadMsgInet4(p, oob, flags, sa4); }; + FD.ptr.prototype.ReadMsgInet6 = function(p, oob, flags, sa6) { + var {$24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa6, sysflags, $s, $deferred, $r, $c} = $restore(this, {p, oob, flags, sa6}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, 0, 0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, 0, 0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = unix.RecvmsgInet6(fd.Sysfd, p, oob, flags, sa6); + n = _tuple[0]; + oobn = _tuple[1]; + sysflags = _tuple[2]; + err$2 = _tuple[3]; + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + } + err$2 = fd.eofError(n, err$2); + $24r$2 = [n, oobn, sysflags, err$2]; + $s = 10; case 10: return $24r$2; + case 9: + $s = -1; return [0, 0, 0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.ReadMsgInet6, $c: true, $r, $24r, $24r$1, $24r$2, _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa6, sysflags, $s, $deferred};return $f; } } + }; + FD.prototype.ReadMsgInet6 = function(p, oob, flags, sa6) { return this.$val.ReadMsgInet6(p, oob, flags, sa6); }; + FD.ptr.prototype.Write = function(p) { + var {$24r, $24r$1, $24r$2, $24r$3, $24r$4, _r, _r$1, _tuple, err, err$1, err$2, fd, max, n, nn, p, $s, $deferred, $r, $c} = $restore(this, {p}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + nn = 0; + /* while (true) { */ case 8: + max = p.$length; + if (fd.IsStream && (max - nn >> 0) > 1073741824) { + max = nn + 1073741824 >> 0; + } + _r$1 = ignoringEINTRIO(syscall.Write, fd.Sysfd, $subslice(p, nn, max)); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + n = _tuple[0]; + err$2 = _tuple[1]; + if (n > 0) { + nn = nn + (n) >> 0; + } + /* */ if (nn === p.$length) { $s = 11; continue; } + /* */ $s = 12; continue; + /* if (nn === p.$length) { */ case 11: + $24r$2 = [nn, err$2]; + $s = 13; case 13: return $24r$2; + /* } */ case 12: + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitWrite(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 14: + $24r$3 = [nn, err$2]; + $s = 16; case 16: return $24r$3; + /* } */ case 15: + /* */ if (n === 0) { $s = 17; continue; } + /* */ $s = 18; continue; + /* if (n === 0) { */ case 17: + $24r$4 = [nn, io.ErrUnexpectedEOF]; + $s = 19; case 19: return $24r$4; + /* } */ case 18: + $s = 8; continue; + case 9: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Write, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, $24r$4, _r, _r$1, _tuple, err, err$1, err$2, fd, max, n, nn, p, $s, $deferred};return $f; } } + }; + FD.prototype.Write = function(p) { return this.$val.Write(p); }; + FD.ptr.prototype.Pwrite = function(p, off) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, fd, max, n, nn, off, p, x, $s, $deferred, $r, $c} = $restore(this, {p, off}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = [0, err]; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + nn = 0; + /* while (true) { */ case 4: + max = p.$length; + if (fd.IsStream && (max - nn >> 0) > 1073741824) { + max = nn + 1073741824 >> 0; + } + _r = syscall.Pwrite(fd.Sysfd, $subslice(p, nn, max), (x = (new $Int64(0, nn)), new $Int64(off.$high + x.$high, off.$low + x.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + n = _tuple[0]; + err$1 = _tuple[1]; + if ($interfaceIsEqual(err$1, new syscall.Errno(4))) { + /* continue; */ $s = 4; continue; + } + if (n > 0) { + nn = nn + (n) >> 0; + } + /* */ if (nn === p.$length) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (nn === p.$length) { */ case 7: + $24r$1 = [nn, err$1]; + $s = 9; case 9: return $24r$1; + /* } */ case 8: + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 10: + $24r$2 = [nn, err$1]; + $s = 12; case 12: return $24r$2; + /* } */ case 11: + /* */ if (n === 0) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (n === 0) { */ case 13: + $24r$3 = [nn, io.ErrUnexpectedEOF]; + $s = 15; case 15: return $24r$3; + /* } */ case 14: + $s = 4; continue; + case 5: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Pwrite, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, fd, max, n, nn, off, p, x, $s, $deferred};return $f; } } + }; + FD.prototype.Pwrite = function(p, off) { return this.$val.Pwrite(p, off); }; + FD.ptr.prototype.WriteToInet4 = function(p, sa) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, err, err$1, err$2, fd, p, sa, $s, $deferred, $r, $c} = $restore(this, {p, sa}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + err$2 = unix.SendtoInet4(fd.Sysfd, p, 0, sa); + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitWrite(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 10: + $24r$2 = [0, err$2]; + $s = 12; case 12: return $24r$2; + /* } */ case 11: + $24r$3 = [p.$length, $ifaceNil]; + $s = 13; case 13: return $24r$3; + case 9: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.WriteToInet4, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, err, err$1, err$2, fd, p, sa, $s, $deferred};return $f; } } + }; + FD.prototype.WriteToInet4 = function(p, sa) { return this.$val.WriteToInet4(p, sa); }; + FD.ptr.prototype.WriteToInet6 = function(p, sa) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, err, err$1, err$2, fd, p, sa, $s, $deferred, $r, $c} = $restore(this, {p, sa}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + err$2 = unix.SendtoInet6(fd.Sysfd, p, 0, sa); + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitWrite(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 10: + $24r$2 = [0, err$2]; + $s = 12; case 12: return $24r$2; + /* } */ case 11: + $24r$3 = [p.$length, $ifaceNil]; + $s = 13; case 13: return $24r$3; + case 9: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.WriteToInet6, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, err, err$1, err$2, fd, p, sa, $s, $deferred};return $f; } } + }; + FD.prototype.WriteToInet6 = function(p, sa) { return this.$val.WriteToInet6(p, sa); }; + FD.ptr.prototype.WriteTo = function(p, sa) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, err, err$1, err$2, fd, p, sa, $s, $deferred, $r, $c} = $restore(this, {p, sa}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + err$2 = syscall.Sendto(fd.Sysfd, p, 0, sa); + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitWrite(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 10: + $24r$2 = [0, err$2]; + $s = 12; case 12: return $24r$2; + /* } */ case 11: + $24r$3 = [p.$length, $ifaceNil]; + $s = 13; case 13: return $24r$3; + case 9: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.WriteTo, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, err, err$1, err$2, fd, p, sa, $s, $deferred};return $f; } } + }; + FD.prototype.WriteTo = function(p, sa) { return this.$val.WriteTo(p, sa); }; + FD.ptr.prototype.WriteMsg = function(p, oob, sa) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred, $r, $c} = $restore(this, {p, oob, sa}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, 0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, 0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = syscall.SendmsgN(fd.Sysfd, p, oob, sa, 0); + n = _tuple[0]; + err$2 = _tuple[1]; + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitWrite(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 10: + $24r$2 = [n, 0, err$2]; + $s = 12; case 12: return $24r$2; + /* } */ case 11: + $24r$3 = [n, oob.$length, err$2]; + $s = 13; case 13: return $24r$3; + case 9: + $s = -1; return [0, 0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.WriteMsg, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred};return $f; } } + }; + FD.prototype.WriteMsg = function(p, oob, sa) { return this.$val.WriteMsg(p, oob, sa); }; + FD.ptr.prototype.WriteMsgInet4 = function(p, oob, sa) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred, $r, $c} = $restore(this, {p, oob, sa}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, 0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, 0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = unix.SendmsgNInet4(fd.Sysfd, p, oob, sa, 0); + n = _tuple[0]; + err$2 = _tuple[1]; + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitWrite(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 10: + $24r$2 = [n, 0, err$2]; + $s = 12; case 12: return $24r$2; + /* } */ case 11: + $24r$3 = [n, oob.$length, err$2]; + $s = 13; case 13: return $24r$3; + case 9: + $s = -1; return [0, 0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.WriteMsgInet4, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred};return $f; } } + }; + FD.prototype.WriteMsgInet4 = function(p, oob, sa) { return this.$val.WriteMsgInet4(p, oob, sa); }; + FD.ptr.prototype.WriteMsgInet6 = function(p, oob, sa) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred, $r, $c} = $restore(this, {p, oob, sa}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, 0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [0, 0, err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _tuple = unix.SendmsgNInet6(fd.Sysfd, p, oob, sa, 0); + n = _tuple[0]; + err$2 = _tuple[1]; + if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { + /* continue; */ $s = 8; continue; + } + if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { + err$2 = fd.pd.waitWrite(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 10: + $24r$2 = [n, 0, err$2]; + $s = 12; case 12: return $24r$2; + /* } */ case 11: + $24r$3 = [n, oob.$length, err$2]; + $s = 13; case 13: return $24r$3; + case 9: + $s = -1; return [0, 0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.WriteMsgInet6, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred};return $f; } } + }; + FD.prototype.WriteMsgInet6 = function(p, oob, sa) { return this.$val.WriteMsgInet6(p, oob, sa); }; + FD.ptr.prototype.Accept = function() { + var {$24r, $24r$1, $24r$2, $24r$3, _1, _r, _r$1, _tuple, err, err$1, err$2, errcall, fd, rsa, s, $s, $deferred, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [-1, $ifaceNil, "", err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = [-1, $ifaceNil, "", err$1]; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _r$1 = accept(fd.Sysfd); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + s = _tuple[0]; + rsa = _tuple[1]; + errcall = _tuple[2]; + err$2 = _tuple[3]; + /* */ if ($interfaceIsEqual(err$2, $ifaceNil)) { $s = 11; continue; } + /* */ $s = 12; continue; + /* if ($interfaceIsEqual(err$2, $ifaceNil)) { */ case 11: + $24r$2 = [s, rsa, "", err$2]; + $s = 13; case 13: return $24r$2; + /* } */ case 12: + _1 = err$2; + if ($interfaceIsEqual(_1, new syscall.Errno((4)))) { + /* continue; */ $s = 8; continue; + } else if ($interfaceIsEqual(_1, new syscall.Errno((11)))) { + if (fd.pd.pollable()) { + err$2 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + /* continue; */ $s = 8; continue; + } + } + } else if ($interfaceIsEqual(_1, new syscall.Errno((103)))) { + /* continue; */ $s = 8; continue; + } + $24r$3 = [-1, $ifaceNil, errcall, err$2]; + $s = 14; case 14: return $24r$3; + case 9: + $s = -1; return [0, $ifaceNil, "", $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Accept, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _1, _r, _r$1, _tuple, err, err$1, err$2, errcall, fd, rsa, s, $s, $deferred};return $f; } } + }; + FD.prototype.Accept = function() { return this.$val.Accept(); }; + FD.ptr.prototype.Seek = function(offset, whence) { + var {$24r, $24r$1, _r, err, fd, offset, whence, $s, $deferred, $r, $c} = $restore(this, {offset, whence}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = [new $Int64(0, 0), err]; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + _r = syscall.Seek(fd.Sysfd, offset, whence); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Seek, $c: true, $r, $24r, $24r$1, _r, err, fd, offset, whence, $s, $deferred};return $f; } } + }; + FD.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; + FD.ptr.prototype.ReadDirent = function(buf) { + var {$24r, $24r$1, _r, _tuple, buf, err, err$1, fd, n, $s, $deferred, $r, $c} = $restore(this, {buf}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = [0, err]; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + /* while (true) { */ case 4: + _r = ignoringEINTRIO(syscall.ReadDirent, fd.Sysfd, buf); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + n = _tuple[0]; + err$1 = _tuple[1]; + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + n = 0; + if ($interfaceIsEqual(err$1, new syscall.Errno(11)) && fd.pd.pollable()) { + err$1 = fd.pd.waitRead(fd.isFile); + if ($interfaceIsEqual(err$1, $ifaceNil)) { + /* continue; */ $s = 4; continue; + } + } + } + $24r$1 = [n, err$1]; + $s = 7; case 7: return $24r$1; + case 5: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.ReadDirent, $c: true, $r, $24r, $24r$1, _r, _tuple, buf, err, err$1, fd, n, $s, $deferred};return $f; } } + }; + FD.prototype.ReadDirent = function(buf) { return this.$val.ReadDirent(buf); }; + FD.ptr.prototype.Fchmod = function(mode) { + var {$24r, $24r$1, _r, err, fd, mode, $s, $deferred, $r, $c} = $restore(this, {mode}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = [fd]; + mode = [mode]; + fd[0] = this; + err = fd[0].incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd[0], "decref"), []]); + _r = ignoringEINTR((function(fd, mode) { return function $b() { + var {$24r$1, _r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = syscall.Fchmod(fd[0].Sysfd, mode[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 2; case 2: return $24r$1; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r$1, _r, $s};return $f; + }; })(fd, mode)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Fchmod, $c: true, $r, $24r, $24r$1, _r, err, fd, mode, $s, $deferred};return $f; } } + }; + FD.prototype.Fchmod = function(mode) { return this.$val.Fchmod(mode); }; + FD.ptr.prototype.Fchdir = function() { + var {$24r, $24r$1, _r, err, fd, $s, $deferred, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + _r = syscall.Fchdir(fd.Sysfd); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Fchdir, $c: true, $r, $24r, $24r$1, _r, err, fd, $s, $deferred};return $f; } } + }; + FD.prototype.Fchdir = function() { return this.$val.Fchdir(); }; + FD.ptr.prototype.Fstat = function(s) { + var {$24r, $24r$1, _r, err, fd, s, $s, $deferred, $r, $c} = $restore(this, {s}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = [fd]; + s = [s]; + fd[0] = this; + err = fd[0].incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd[0], "decref"), []]); + _r = ignoringEINTR((function(fd, s) { return function $b() { + var {$24r$1, _r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = syscall.Fstat(fd[0].Sysfd, s[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 2; case 2: return $24r$1; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r$1, _r, $s};return $f; + }; })(fd, s)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Fstat, $c: true, $r, $24r, $24r$1, _r, err, fd, s, $s, $deferred};return $f; } } + }; + FD.prototype.Fstat = function(s) { return this.$val.Fstat(s); }; + DupCloseOnExec = function(fd) { + var {$24r, _1, _r, _tuple, e1, fd, r0, $s, $r, $c} = $restore(this, {fd}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + if (true && (atomic.LoadInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$1(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; })))) === 1)) { + _tuple = fcntl(fd, 1, 0); + r0 = _tuple[0]; + e1 = _tuple[1]; + if ($interfaceIsEqual(e1, $ifaceNil)) { + $s = -1; return [r0, "", $ifaceNil]; + } + _1 = $assertType(e1, syscall.Errno); + if ((_1 === (22)) || (_1 === (38))) { + atomic.StoreInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$1(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; }))), 0); + } else { + $s = -1; return [-1, "fcntl", e1]; + } + } + _r = dupCloseOnExecOld(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: DupCloseOnExec, $c: true, $r, $24r, _1, _r, _tuple, e1, fd, r0, $s};return $f; + }; + $pkg.DupCloseOnExec = DupCloseOnExec; + dupCloseOnExecOld = function(fd) { + var {$24r, $24r$1, _tuple, err, fd, newfd, $s, $deferred, $r, $c} = $restore(this, {fd}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + $r = syscall.ForkLock.RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $deferred.push([$methodVal(syscall.ForkLock, "RUnlock"), []]); + _tuple = syscall.Dup(fd); + newfd = _tuple[0]; + err = _tuple[1]; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [-1, "dup", err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + syscall.CloseOnExec(newfd); + $24r$1 = [newfd, "", $ifaceNil]; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: dupCloseOnExecOld, $c: true, $r, $24r, $24r$1, _tuple, err, fd, newfd, $s, $deferred};return $f; } } + }; + FD.ptr.prototype.Dup = function() { + var {$24r, $24r$1, _r, err, fd, $s, $deferred, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = [-1, "", err]; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + _r = DupCloseOnExec(fd.Sysfd); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Dup, $c: true, $r, $24r, $24r$1, _r, err, fd, $s, $deferred};return $f; } } + }; + FD.prototype.Dup = function() { return this.$val.Dup(); }; + FD.ptr.prototype.WaitWrite = function() { + var fd; + fd = this; + return fd.pd.waitWrite(fd.isFile); + }; + FD.prototype.WaitWrite = function() { return this.$val.WaitWrite(); }; + FD.ptr.prototype.WriteOnce = function(p) { + var {$24r, $24r$1, _r, _r$1, err, fd, p, $s, $deferred, $r, $c} = $restore(this, {p}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = [0, err]; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + _r$1 = ignoringEINTRIO(syscall.Write, fd.Sysfd, p); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r$1 = _r$1; + $s = 6; case 6: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.WriteOnce, $c: true, $r, $24r, $24r$1, _r, _r$1, err, fd, p, $s, $deferred};return $f; } } + }; + FD.prototype.WriteOnce = function(p) { return this.$val.WriteOnce(p); }; + FD.ptr.prototype.RawRead = function(f) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r, $c} = $restore(this, {f}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = err; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "readUnlock"), []]); + err$1 = fd.pd.prepareRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = err$1; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (_r$1) { */ case 10: + $24r$2 = $ifaceNil; + $s = 13; case 13: return $24r$2; + /* } */ case 11: + err$2 = fd.pd.waitRead(fd.isFile); + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 14: + $24r$3 = err$2; + $s = 16; case 16: return $24r$3; + /* } */ case 15: + $s = 8; continue; + case 9: + $s = -1; return $ifaceNil; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.RawRead, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred};return $f; } } + }; + FD.prototype.RawRead = function(f) { return this.$val.RawRead(f); }; + FD.ptr.prototype.RawWrite = function(f) { + var {$24r, $24r$1, $24r$2, $24r$3, _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r, $c} = $restore(this, {f}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: + $24r = err; + $s = 4; case 4: return $24r; + /* } */ case 3: + $deferred.push([$methodVal(fd, "writeUnlock"), []]); + err$1 = fd.pd.prepareWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: + $24r$1 = err$1; + $s = 7; case 7: return $24r$1; + /* } */ case 6: + /* while (true) { */ case 8: + _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (_r$1) { */ case 10: + $24r$2 = $ifaceNil; + $s = 13; case 13: return $24r$2; + /* } */ case 11: + err$2 = fd.pd.waitWrite(fd.isFile); + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 14: + $24r$3 = err$2; + $s = 16; case 16: return $24r$3; + /* } */ case 15: + $s = 8; continue; + case 9: + $s = -1; return $ifaceNil; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.RawWrite, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred};return $f; } } + }; + FD.prototype.RawWrite = function(f) { return this.$val.RawWrite(f); }; + ignoringEINTRIO = function(fn, fd, p) { + var {_r, _tuple, err, fd, fn, n, p, $s, $r, $c} = $restore(this, {fn, fd, p}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* while (true) { */ case 1: + _r = fn(fd, p); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + n = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, new syscall.Errno(4)))) { + $s = -1; return [n, err]; + } + $s = 1; continue; + case 2: + $s = -1; return [0, $ifaceNil]; + /* */ } return; } var $f = {$blk: ignoringEINTRIO, $c: true, $r, _r, _tuple, err, fd, fn, n, p, $s};return $f; + }; + FD.ptr.prototype.eofError = function(n, err) { + var err, fd, n; + fd = this; + if ((n === 0) && $interfaceIsEqual(err, $ifaceNil) && fd.ZeroReadIsEOF) { + return io.EOF; + } + return err; + }; + FD.prototype.eofError = function(n, err) { return this.$val.eofError(n, err); }; + FD.ptr.prototype.Shutdown = function(how) { + var {$24r, $24r$1, err, fd, how, $s, $deferred, $r, $c} = $restore(this, {how}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + $24r$1 = syscall.Shutdown(fd.Sysfd, how); + $s = 4; case 4: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Shutdown, $c: true, $r, $24r, $24r$1, err, fd, how, $s, $deferred};return $f; } } + }; + FD.prototype.Shutdown = function(how) { return this.$val.Shutdown(how); }; + FD.ptr.prototype.Fchown = function(uid, gid) { + var {$24r, $24r$1, _r, err, fd, gid, uid, $s, $deferred, $r, $c} = $restore(this, {uid, gid}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = [fd]; + gid = [gid]; + uid = [uid]; + fd[0] = this; + err = fd[0].incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd[0], "decref"), []]); + _r = ignoringEINTR((function(fd, gid, uid) { return function $b() { + var {$24r$1, _r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = syscall.Fchown(fd[0].Sysfd, uid[0], gid[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 2; case 2: return $24r$1; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r$1, _r, $s};return $f; + }; })(fd, gid, uid)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Fchown, $c: true, $r, $24r, $24r$1, _r, err, fd, gid, uid, $s, $deferred};return $f; } } + }; + FD.prototype.Fchown = function(uid, gid) { return this.$val.Fchown(uid, gid); }; + FD.ptr.prototype.Ftruncate = function(size) { + var {$24r, $24r$1, _r, err, fd, size, $s, $deferred, $r, $c} = $restore(this, {size}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = [fd]; + size = [size]; + fd[0] = this; + err = fd[0].incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd[0], "decref"), []]); + _r = ignoringEINTR((function(fd, size) { return function $b() { + var {$24r$1, _r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = syscall.Ftruncate(fd[0].Sysfd, size[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 2; case 2: return $24r$1; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r$1, _r, $s};return $f; + }; })(fd, size)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Ftruncate, $c: true, $r, $24r, $24r$1, _r, err, fd, size, $s, $deferred};return $f; } } + }; + FD.prototype.Ftruncate = function(size) { return this.$val.Ftruncate(size); }; + FD.ptr.prototype.RawControl = function(f) { + var {$24r, $24r$1, err, f, fd, $s, $deferred, $r, $c} = $restore(this, {f}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = this; + err = fd.incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd, "decref"), []]); + $r = f(((fd.Sysfd >>> 0))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $24r$1 = $ifaceNil; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.RawControl, $c: true, $r, $24r, $24r$1, err, f, fd, $s, $deferred};return $f; } } + }; + FD.prototype.RawControl = function(f) { return this.$val.RawControl(f); }; + ignoringEINTR = function(fn) { + var {_r, err, fn, $s, $r, $c} = $restore(this, {fn}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* while (true) { */ case 1: + _r = fn(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + if (!($interfaceIsEqual(err, new syscall.Errno(4)))) { + $s = -1; return err; + } + $s = 1; continue; + case 2: + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: ignoringEINTR, $c: true, $r, _r, err, fn, $s};return $f; + }; + pollDesc.ptr.prototype.init = function(fd) { + var fd, pd; + pd = this; + pd.fd = fd; + return $ifaceNil; + }; + pollDesc.prototype.init = function(fd) { return this.$val.init(fd); }; + pollDesc.ptr.prototype.close = function() { + var pd; + pd = this; + }; + pollDesc.prototype.close = function() { return this.$val.close(); }; + pollDesc.ptr.prototype.evict = function() { + var pd; + pd = this; + pd.closing = true; + if (!(pd.fd === ptrType$2.nil)) { + syscall.StopIO(pd.fd.Sysfd); + } + }; + pollDesc.prototype.evict = function() { return this.$val.evict(); }; + pollDesc.ptr.prototype.prepare = function(mode, isFile) { + var isFile, mode, pd; + pd = this; + if (pd.closing) { + return errClosing(isFile); + } + return $ifaceNil; + }; + pollDesc.prototype.prepare = function(mode, isFile) { return this.$val.prepare(mode, isFile); }; + pollDesc.ptr.prototype.prepareRead = function(isFile) { + var isFile, pd; + pd = this; + return pd.prepare(114, isFile); + }; + pollDesc.prototype.prepareRead = function(isFile) { return this.$val.prepareRead(isFile); }; + pollDesc.ptr.prototype.prepareWrite = function(isFile) { + var isFile, pd; + pd = this; + return pd.prepare(119, isFile); + }; + pollDesc.prototype.prepareWrite = function(isFile) { return this.$val.prepareWrite(isFile); }; + pollDesc.ptr.prototype.wait = function(mode, isFile) { + var isFile, mode, pd; + pd = this; + if (pd.closing) { + return errClosing(isFile); + } + if (isFile) { + return $ifaceNil; + } + return $pkg.ErrDeadlineExceeded; + }; + pollDesc.prototype.wait = function(mode, isFile) { return this.$val.wait(mode, isFile); }; + pollDesc.ptr.prototype.waitRead = function(isFile) { + var isFile, pd; + pd = this; + return pd.wait(114, isFile); + }; + pollDesc.prototype.waitRead = function(isFile) { return this.$val.waitRead(isFile); }; + pollDesc.ptr.prototype.waitWrite = function(isFile) { + var isFile, pd; + pd = this; + return pd.wait(119, isFile); + }; + pollDesc.prototype.waitWrite = function(isFile) { return this.$val.waitWrite(isFile); }; + pollDesc.ptr.prototype.pollable = function() { + var pd; + pd = this; + return true; + }; + pollDesc.prototype.pollable = function() { return this.$val.pollable(); }; + FD.ptr.prototype.SetDeadline = function(t) { + var {$24r, _r, fd, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = setDeadlineImpl(fd, $clone(t, time.Time), 233); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.SetDeadline, $c: true, $r, $24r, _r, fd, t, $s};return $f; + }; + FD.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; + FD.ptr.prototype.SetReadDeadline = function(t) { + var {$24r, _r, fd, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = setDeadlineImpl(fd, $clone(t, time.Time), 114); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.SetReadDeadline, $c: true, $r, $24r, _r, fd, t, $s};return $f; + }; + FD.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; + FD.ptr.prototype.SetWriteDeadline = function(t) { + var {$24r, _r, fd, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = setDeadlineImpl(fd, $clone(t, time.Time), 119); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.SetWriteDeadline, $c: true, $r, $24r, _r, fd, t, $s};return $f; + }; + FD.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; + setDeadlineImpl = function(fd, t, mode) { + var {_1, _r, d, err, fd, mode, t, $s, $r, $c} = $restore(this, {fd, t, mode}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + d = $clone(t, time.Time).UnixNano(); + if ($clone(t, time.Time).IsZero()) { + d = new $Int64(0, 0); + } + err = fd.incref(); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _1 = mode; + if (_1 === (114)) { + syscall.SetReadDeadline(fd.Sysfd, d); + } else if (_1 === (119)) { + syscall.SetWriteDeadline(fd.Sysfd, d); + } else if (_1 === (233)) { + syscall.SetReadDeadline(fd.Sysfd, d); + syscall.SetWriteDeadline(fd.Sysfd, d); + } + _r = fd.decref(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r; + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: setDeadlineImpl, $c: true, $r, _1, _r, d, err, fd, mode, t, $s};return $f; + }; + fdMutex.ptr.prototype.incref = function() { + var mu, new$1, old, x, x$1; + mu = this; + while (true) { + old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); + if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { + return false; + } + new$1 = new $Uint64(old.$high + 0, old.$low + 8); + if ((x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { + $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); + } + if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { + return true; + } + } + }; + fdMutex.prototype.incref = function() { return this.$val.incref(); }; + fdMutex.ptr.prototype.increfAndClose = function() { + var {mu, new$1, old, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + mu = this; + /* while (true) { */ case 1: + old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); + if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { + $s = -1; return false; + } + new$1 = (x$1 = new $Uint64(old.$high | 0, (old.$low | 1) >>> 0), new $Uint64(x$1.$high + 0, x$1.$low + 8)); + if ((x$2 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$2.$high === 0 && x$2.$low === 0))) { + $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); + } + new$1 = (x$3 = new $Uint64(2147483647, 4286578688), new $Uint64(new$1.$high & ~x$3.$high, (new$1.$low & ~x$3.$low) >>> 0)); + /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: + /* while (true) { */ case 5: + /* if (!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { break; } */ if(!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { $s = 6; continue; } + old = (x$5 = new $Uint64(0, 8388608), new $Uint64(old.$high - x$5.$high, old.$low - x$5.$low)); + $r = runtime_Semrelease((mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 5; continue; + case 6: + /* while (true) { */ case 8: + /* if (!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { break; } */ if(!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { $s = 9; continue; } + old = (x$7 = new $Uint64(2048, 0), new $Uint64(old.$high - x$7.$high, old.$low - x$7.$low)); + $r = runtime_Semrelease((mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu)))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 8; continue; + case 9: + $s = -1; return true; + /* } */ case 4: + $s = 1; continue; + case 2: + $s = -1; return false; + /* */ } return; } var $f = {$blk: fdMutex.ptr.prototype.increfAndClose, $c: true, $r, mu, new$1, old, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, $s};return $f; + }; + fdMutex.prototype.increfAndClose = function() { return this.$val.increfAndClose(); }; + fdMutex.ptr.prototype.decref = function() { + var mu, new$1, old, x, x$1; + mu = this; + while (true) { + old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); + if ((x = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x.$high === 0 && x.$low === 0))) { + $panic(new $String("inconsistent poll.fdMutex")); + } + new$1 = new $Uint64(old.$high - 0, old.$low - 8); + if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { + return (x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$1.$high === 0 && x$1.$low === 1)); + } + } + }; + fdMutex.prototype.decref = function() { return this.$val.decref(); }; + fdMutex.ptr.prototype.rwlock = function(read) { + var {_tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, $s, $r, $c} = $restore(this, {read}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + mu = this; + _tmp = new $Uint64(0, 0); + _tmp$1 = new $Uint64(0, 0); + _tmp$2 = new $Uint64(0, 0); + mutexBit = _tmp; + mutexWait = _tmp$1; + mutexMask = _tmp$2; + mutexSema = ptrType.nil; + if (read) { + mutexBit = new $Uint64(0, 2); + mutexWait = new $Uint64(0, 8388608); + mutexMask = new $Uint64(2047, 4286578688); + mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); + } else { + mutexBit = new $Uint64(0, 4); + mutexWait = new $Uint64(2048, 0); + mutexMask = new $Uint64(2147481600, 0); + mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); + } + /* while (true) { */ case 1: + old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); + if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { + $s = -1; return false; + } + new$1 = new $Uint64(0, 0); + if ((x$1 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { + new$1 = (x$2 = new $Uint64(old.$high | mutexBit.$high, (old.$low | mutexBit.$low) >>> 0), new $Uint64(x$2.$high + 0, x$2.$low + 8)); + if ((x$3 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$3.$high === 0 && x$3.$low === 0))) { + $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); + } + } else { + new$1 = new $Uint64(old.$high + mutexWait.$high, old.$low + mutexWait.$low); + if ((x$4 = new $Uint64(new$1.$high & mutexMask.$high, (new$1.$low & mutexMask.$low) >>> 0), (x$4.$high === 0 && x$4.$low === 0))) { + $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); + } + } + /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: + if ((x$5 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0))) { + $s = -1; return true; + } + $r = runtime_Semacquire(mutexSema); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 4: + $s = 1; continue; + case 2: + $s = -1; return false; + /* */ } return; } var $f = {$blk: fdMutex.ptr.prototype.rwlock, $c: true, $r, _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, $s};return $f; + }; + fdMutex.prototype.rwlock = function(read) { return this.$val.rwlock(read); }; + fdMutex.ptr.prototype.rwunlock = function(read) { + var {_tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r, $c} = $restore(this, {read}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + mu = this; + _tmp = new $Uint64(0, 0); + _tmp$1 = new $Uint64(0, 0); + _tmp$2 = new $Uint64(0, 0); + mutexBit = _tmp; + mutexWait = _tmp$1; + mutexMask = _tmp$2; + mutexSema = ptrType.nil; + if (read) { + mutexBit = new $Uint64(0, 2); + mutexWait = new $Uint64(0, 8388608); + mutexMask = new $Uint64(2047, 4286578688); + mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); + } else { + mutexBit = new $Uint64(0, 4); + mutexWait = new $Uint64(2048, 0); + mutexMask = new $Uint64(2147481600, 0); + mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); + } + /* while (true) { */ case 1: + old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); + if ((x = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x.$high === 0 && x.$low === 0)) || (x$1 = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { + $panic(new $String("inconsistent poll.fdMutex")); + } + new$1 = (x$2 = new $Uint64(old.$high & ~mutexBit.$high, (old.$low & ~mutexBit.$low) >>> 0), new $Uint64(x$2.$high - 0, x$2.$low - 8)); + if (!((x$3 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$3.$high === 0 && x$3.$low === 0)))) { + new$1 = (x$4 = mutexWait, new $Uint64(new$1.$high - x$4.$high, new$1.$low - x$4.$low)); + } + /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$3(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: + /* */ if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { */ case 5: + $r = runtime_Semrelease(mutexSema); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 6: + $s = -1; return (x$6 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$6.$high === 0 && x$6.$low === 1)); + /* } */ case 4: + $s = 1; continue; + case 2: + $s = -1; return false; + /* */ } return; } var $f = {$blk: fdMutex.ptr.prototype.rwunlock, $c: true, $r, _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, x$6, $s};return $f; + }; + fdMutex.prototype.rwunlock = function(read) { return this.$val.rwunlock(read); }; + FD.ptr.prototype.incref = function() { + var fd; + fd = this; + if (!fd.fdmu.incref()) { + return errClosing(fd.isFile); + } + return $ifaceNil; + }; + FD.prototype.incref = function() { return this.$val.incref(); }; + FD.ptr.prototype.decref = function() { + var {$24r, _r, fd, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + /* */ if (fd.fdmu.decref()) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (fd.fdmu.decref()) { */ case 1: + _r = fd.destroy(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 4; case 4: return $24r; + /* } */ case 2: + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.decref, $c: true, $r, $24r, _r, fd, $s};return $f; + }; + FD.prototype.decref = function() { return this.$val.decref(); }; + FD.ptr.prototype.readLock = function() { + var {_r, fd, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = fd.fdmu.rwlock(true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!_r) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!_r) { */ case 1: + $s = -1; return errClosing(fd.isFile); + /* } */ case 2: + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.readLock, $c: true, $r, _r, fd, $s};return $f; + }; + FD.prototype.readLock = function() { return this.$val.readLock(); }; + FD.ptr.prototype.readUnlock = function() { + var {_r, _r$1, fd, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = fd.fdmu.rwunlock(true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_r) { */ case 1: + _r$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + /* } */ case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.readUnlock, $c: true, $r, _r, _r$1, fd, $s};return $f; + }; + FD.prototype.readUnlock = function() { return this.$val.readUnlock(); }; + FD.ptr.prototype.writeLock = function() { + var {_r, fd, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = fd.fdmu.rwlock(false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!_r) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!_r) { */ case 1: + $s = -1; return errClosing(fd.isFile); + /* } */ case 2: + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.writeLock, $c: true, $r, _r, fd, $s};return $f; + }; + FD.prototype.writeLock = function() { return this.$val.writeLock(); }; + FD.ptr.prototype.writeUnlock = function() { + var {_r, _r$1, fd, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fd = this; + _r = fd.fdmu.rwunlock(false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_r) { */ case 1: + _r$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + /* } */ case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: FD.ptr.prototype.writeUnlock, $c: true, $r, _r, _r$1, fd, $s};return $f; + }; + FD.prototype.writeUnlock = function() { return this.$val.writeUnlock(); }; + FD.ptr.prototype.Fsync = function() { + var {$24r, $24r$1, _r, err, fd, $s, $deferred, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + fd = [fd]; + fd[0] = this; + err = fd[0].incref(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + $24r = err; + $s = 3; case 3: return $24r; + /* } */ case 2: + $deferred.push([$methodVal(fd[0], "decref"), []]); + _r = ignoringEINTR((function(fd) { return function $b() { + var {$24r$1, _r, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = syscall.Fsync(fd[0].Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 2; case 2: return $24r$1; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r$1, _r, $s};return $f; + }; })(fd)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r$1 = _r; + $s = 5; case 5: return $24r$1; + /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FD.ptr.prototype.Fsync, $c: true, $r, $24r, $24r$1, _r, err, fd, $s, $deferred};return $f; } } + }; + FD.prototype.Fsync = function() { return this.$val.Fsync(); }; + errNetClosing.ptr.prototype.Error = function() { + var e; + e = this; + return "use of closed network connection"; + }; + errNetClosing.prototype.Error = function() { return this.$val.Error(); }; + errNetClosing.ptr.prototype.Timeout = function() { + var e; + e = this; + return false; + }; + errNetClosing.prototype.Timeout = function() { return this.$val.Timeout(); }; + errNetClosing.ptr.prototype.Temporary = function() { + var e; + e = this; + return false; + }; + errNetClosing.prototype.Temporary = function() { return this.$val.Temporary(); }; + errClosing = function(isFile) { + var isFile; + if (isFile) { + return $pkg.ErrFileClosing; + } + return new $pkg.ErrNetClosing.constructor.elem($pkg.ErrNetClosing); + }; + DeadlineExceededError.ptr.prototype.Error = function() { + var e; + e = this; + return "i/o timeout"; + }; + DeadlineExceededError.prototype.Error = function() { return this.$val.Error(); }; + DeadlineExceededError.ptr.prototype.Timeout = function() { + var e; + e = this; + return true; + }; + DeadlineExceededError.prototype.Timeout = function() { return this.$val.Timeout(); }; + DeadlineExceededError.ptr.prototype.Temporary = function() { + var e; + e = this; + return true; + }; + DeadlineExceededError.prototype.Temporary = function() { return this.$val.Temporary(); }; + fcntl = function(fd, cmd, arg) { + var arg, cmd, fd; + return [0, new syscall.Errno(38)]; + }; + ptrType$2.methods = [{prop: "Init", name: "Init", pkg: "", typ: $funcType([$String, $Bool], [$error], false)}, {prop: "destroy", name: "destroy", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "SetBlocking", name: "SetBlocking", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Pread", name: "Pread", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$1], [$Int, syscall.Sockaddr, $error], false)}, {prop: "ReadFromInet4", name: "ReadFromInet4", pkg: "", typ: $funcType([sliceType$1, ptrType$5], [$Int, $error], false)}, {prop: "ReadFromInet6", name: "ReadFromInet6", pkg: "", typ: $funcType([sliceType$1, ptrType$6], [$Int, $error], false)}, {prop: "ReadMsg", name: "ReadMsg", pkg: "", typ: $funcType([sliceType$1, sliceType$1, $Int], [$Int, $Int, $Int, syscall.Sockaddr, $error], false)}, {prop: "ReadMsgInet4", name: "ReadMsgInet4", pkg: "", typ: $funcType([sliceType$1, sliceType$1, $Int, ptrType$5], [$Int, $Int, $Int, $error], false)}, {prop: "ReadMsgInet6", name: "ReadMsgInet6", pkg: "", typ: $funcType([sliceType$1, sliceType$1, $Int, ptrType$6], [$Int, $Int, $Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Pwrite", name: "Pwrite", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "WriteToInet4", name: "WriteToInet4", pkg: "", typ: $funcType([sliceType$1, ptrType$5], [$Int, $error], false)}, {prop: "WriteToInet6", name: "WriteToInet6", pkg: "", typ: $funcType([sliceType$1, ptrType$6], [$Int, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$1, syscall.Sockaddr], [$Int, $error], false)}, {prop: "WriteMsg", name: "WriteMsg", pkg: "", typ: $funcType([sliceType$1, sliceType$1, syscall.Sockaddr], [$Int, $Int, $error], false)}, {prop: "WriteMsgInet4", name: "WriteMsgInet4", pkg: "", typ: $funcType([sliceType$1, sliceType$1, ptrType$5], [$Int, $Int, $error], false)}, {prop: "WriteMsgInet6", name: "WriteMsgInet6", pkg: "", typ: $funcType([sliceType$1, sliceType$1, ptrType$6], [$Int, $Int, $error], false)}, {prop: "Accept", name: "Accept", pkg: "", typ: $funcType([], [$Int, syscall.Sockaddr, $String, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "ReadDirent", name: "ReadDirent", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Fchmod", name: "Fchmod", pkg: "", typ: $funcType([$Uint32], [$error], false)}, {prop: "Fchdir", name: "Fchdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Fstat", name: "Fstat", pkg: "", typ: $funcType([ptrType$7], [$error], false)}, {prop: "Dup", name: "Dup", pkg: "", typ: $funcType([], [$Int, $String, $error], false)}, {prop: "WaitWrite", name: "WaitWrite", pkg: "", typ: $funcType([], [$error], false)}, {prop: "WriteOnce", name: "WriteOnce", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "RawRead", name: "RawRead", pkg: "", typ: $funcType([funcType], [$error], false)}, {prop: "RawWrite", name: "RawWrite", pkg: "", typ: $funcType([funcType], [$error], false)}, {prop: "eofError", name: "eofError", pkg: "internal/poll", typ: $funcType([$Int, $error], [$error], false)}, {prop: "Shutdown", name: "Shutdown", pkg: "", typ: $funcType([$Int], [$error], false)}, {prop: "Fchown", name: "Fchown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Ftruncate", name: "Ftruncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "RawControl", name: "RawControl", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readLock", name: "readLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readUnlock", name: "readUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "writeLock", name: "writeLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "writeUnlock", name: "writeUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "Fsync", name: "Fsync", pkg: "", typ: $funcType([], [$error], false)}]; + ptrType$8.methods = [{prop: "init", name: "init", pkg: "internal/poll", typ: $funcType([ptrType$2], [$error], false)}, {prop: "close", name: "close", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "evict", name: "evict", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "prepare", name: "prepare", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "prepareRead", name: "prepareRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "prepareWrite", name: "prepareWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "wait", name: "wait", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "waitRead", name: "waitRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitWrite", name: "waitWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitCanceled", name: "waitCanceled", pkg: "internal/poll", typ: $funcType([$Int], [], false)}, {prop: "pollable", name: "pollable", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}]; + ptrType$9.methods = [{prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "increfAndClose", name: "increfAndClose", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "rwlock", name: "rwlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}, {prop: "rwunlock", name: "rwunlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}]; + errNetClosing.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; + ptrType$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; + FD.init("internal/poll", [{prop: "fdmu", name: "fdmu", embedded: false, exported: false, typ: fdMutex, tag: ""}, {prop: "Sysfd", name: "Sysfd", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "pd", name: "pd", embedded: false, exported: false, typ: pollDesc, tag: ""}, {prop: "iovecs", name: "iovecs", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "csema", name: "csema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "isBlocking", name: "isBlocking", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "IsStream", name: "IsStream", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ZeroReadIsEOF", name: "ZeroReadIsEOF", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "isFile", name: "isFile", embedded: false, exported: false, typ: $Bool, tag: ""}]); + pollDesc.init("internal/poll", [{prop: "fd", name: "fd", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "closing", name: "closing", embedded: false, exported: false, typ: $Bool, tag: ""}]); + fdMutex.init("internal/poll", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "rsema", name: "rsema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "wsema", name: "wsema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); + errNetClosing.init("", []); + DeadlineExceededError.init("", []); + $pkg.$initLinknames = function() { + runtime_Semacquire = $linknames["sync.runtime_Semacquire"]; + runtime_Semrelease = $linknames["sync.runtime_Semrelease"]; +}; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unix.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = syscall.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.CloseFunc = syscall.Close; + $pkg.AcceptFunc = syscall.Accept; + tryDupCloexec = 1; + $pkg.ErrNetClosing = new errNetClosing.ptr(); + $pkg.ErrFileClosing = errors.New("use of closed file"); + $pkg.ErrNoDeadline = errors.New("file type does not support deadline"); + $pkg.ErrDeadlineExceeded = new DeadlineExceededError.ptr(); + $pkg.ErrNotPollable = errors.New("not pollable"); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/syscall/execenv"] = (function() { + var $pkg = {}, $init, syscall; + syscall = $packages["syscall"]; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = syscall.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/testlog"] = (function() { + var $pkg = {}, $init, sync, atomic, Interface, ptrType, logger, Logger, Stat; + sync = $packages["sync"]; + atomic = $packages["sync/atomic"]; + Interface = $pkg.Interface = $newType(8, $kindInterface, "testlog.Interface", true, "internal/testlog", true, null); + ptrType = $ptrType(Interface); + Logger = function() { + var impl; + impl = logger.Load(); + if ($interfaceIsEqual(impl, $ifaceNil)) { + return $ifaceNil; + } + return $assertType(impl, ptrType).$get(); + }; + $pkg.Logger = Logger; + Stat = function(name) { + var {log, name, $s, $r, $c} = $restore(this, {name}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + log = Logger(); + /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: + $r = log.Stat(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: Stat, $c: true, $r, log, name, $s};return $f; + }; + $pkg.Stat = Stat; + Interface.init([{prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Getenv", name: "Getenv", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([$String], [], false)}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = sync.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = atomic.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + logger = new atomic.Value.ptr($ifaceNil); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["path"] = (function() { + var $pkg = {}, $init, errors, bytealg, utf8; + errors = $packages["errors"]; + bytealg = $packages["internal/bytealg"]; + utf8 = $packages["unicode/utf8"]; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = bytealg.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.ErrBadPattern = errors.New("syntax error in pattern"); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["io/fs"] = (function() { + var $pkg = {}, $init, errors, oserror, io, path, sort, time, utf8, DirEntry, FileInfo, FileMode, PathError, ptrType, sliceType$2, arrayType, interfaceType, errInvalid, errPermission, errExist, errNotExist, errClosed; + errors = $packages["errors"]; + oserror = $packages["internal/oserror"]; + io = $packages["io"]; + path = $packages["path"]; + sort = $packages["sort"]; + time = $packages["time"]; + utf8 = $packages["unicode/utf8"]; + DirEntry = $pkg.DirEntry = $newType(8, $kindInterface, "fs.DirEntry", true, "io/fs", true, null); + FileInfo = $pkg.FileInfo = $newType(8, $kindInterface, "fs.FileInfo", true, "io/fs", true, null); + FileMode = $pkg.FileMode = $newType(4, $kindUint32, "fs.FileMode", true, "io/fs", true, null); + PathError = $pkg.PathError = $newType(0, $kindStruct, "fs.PathError", true, "io/fs", true, function(Op_, Path_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Op = ""; + this.Path = ""; + this.Err = $ifaceNil; + return; + } + this.Op = Op_; + this.Path = Path_; + this.Err = Err_; + }); + ptrType = $ptrType(PathError); + sliceType$2 = $sliceType($Uint8); + arrayType = $arrayType($Uint8, 32); + interfaceType = $interfaceType([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); + errInvalid = function() { + return oserror.ErrInvalid; + }; + errPermission = function() { + return oserror.ErrPermission; + }; + errExist = function() { + return oserror.ErrExist; + }; + errNotExist = function() { + return oserror.ErrNotExist; + }; + errClosed = function() { + return oserror.ErrClosed; + }; + FileMode.prototype.String = function() { + var _i, _i$1, _ref, _ref$1, _rune, _rune$1, buf, c, c$1, i, i$1, m, w, y, y$1; + m = this.$val; + buf = arrayType.zero(); + w = 0; + _ref = "dalTLDpSugct?"; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + c = _rune[0]; + if (!((((m & (((y = (((31 - i >> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0) === 0))) { + ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = ((c << 24 >>> 24))); + w = w + (1) >> 0; + } + _i += _rune[1]; + } + if (w === 0) { + ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); + w = w + (1) >> 0; + } + _ref$1 = "rwxrwxrwx"; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.length)) { break; } + _rune$1 = $decodeRune(_ref$1, _i$1); + i$1 = _i$1; + c$1 = _rune$1[0]; + if (!((((m & (((y$1 = (((8 - i$1 >> 0) >>> 0)), y$1 < 32 ? (1 << y$1) : 0) >>> 0))) >>> 0) === 0))) { + ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = ((c$1 << 24 >>> 24))); + } else { + ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); + } + w = w + (1) >> 0; + _i$1 += _rune$1[1]; + } + return ($bytesToString($subslice(new sliceType$2(buf), 0, w))); + }; + $ptrType(FileMode).prototype.String = function() { return new FileMode(this.$get()).String(); }; + FileMode.prototype.IsDir = function() { + var m; + m = this.$val; + return !((((m & 2147483648) >>> 0) === 0)); + }; + $ptrType(FileMode).prototype.IsDir = function() { return new FileMode(this.$get()).IsDir(); }; + FileMode.prototype.IsRegular = function() { + var m; + m = this.$val; + return ((m & 2401763328) >>> 0) === 0; + }; + $ptrType(FileMode).prototype.IsRegular = function() { return new FileMode(this.$get()).IsRegular(); }; + FileMode.prototype.Perm = function() { + var m; + m = this.$val; + return (m & 511) >>> 0; + }; + $ptrType(FileMode).prototype.Perm = function() { return new FileMode(this.$get()).Perm(); }; + FileMode.prototype.Type = function() { + var m; + m = this.$val; + return (m & 2401763328) >>> 0; + }; + $ptrType(FileMode).prototype.Type = function() { return new FileMode(this.$get()).Type(); }; + PathError.ptr.prototype.Error = function() { + var {$24r, _r, e, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + e = this; + _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = e.Op + " " + e.Path + ": " + _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: PathError.ptr.prototype.Error, $c: true, $r, $24r, _r, e, $s};return $f; + }; + PathError.prototype.Error = function() { return this.$val.Error(); }; + PathError.ptr.prototype.Unwrap = function() { + var e; + e = this; + return e.Err; + }; + PathError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; + PathError.ptr.prototype.Timeout = function() { + var {$24r, _r, _tuple, _v, e, ok, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + e = this; + _tuple = $assertType(e.Err, interfaceType, true); + t = _tuple[0]; + ok = _tuple[1]; + if (!(ok)) { _v = false; $s = 1; continue s; } + _r = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 1: + $24r = _v; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: PathError.ptr.prototype.Timeout, $c: true, $r, $24r, _r, _tuple, _v, e, ok, t, $s};return $f; + }; + PathError.prototype.Timeout = function() { return this.$val.Timeout(); }; + FileMode.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsRegular", name: "IsRegular", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [FileMode], false)}]; + ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; + DirEntry.init([{prop: "Info", name: "Info", pkg: "", typ: $funcType([], [FileInfo, $error], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [FileMode], false)}]); + FileInfo.init([{prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]); + PathError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = oserror.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = path.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sort.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.SkipDir = errors.New("skip this directory"); + $pkg.ErrInvalid = errInvalid(); + $pkg.ErrPermission = errPermission(); + $pkg.ErrExist = errExist(); + $pkg.ErrNotExist = errNotExist(); + $pkg.ErrClosed = errClosed(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["os"] = (function() { + var $pkg = {}, $init, errors, js, itoa, oserror, poll, execenv, unix, testlog, unsafeheader, io, fs, runtime, sort, sync, atomic, syscall, time, fileStat, File, rawConn, file, unixDirent, LinkError, onlyWriter, timeout, SyscallError, dirInfo, readdirMode, sliceType, sliceType$1, sliceType$2, ptrType, ptrType$1, ptrType$2, ptrType$3, ptrType$5, ptrType$6, sliceType$4, ptrType$7, ptrType$8, ptrType$9, funcType, ptrType$17, ptrType$18, sliceType$7, sliceType$8, funcType$2, funcType$3, ptrType$19, ptrType$20, errPatternHasSeparator, errWriteAtInAppendMode, lstat, dirBufPool, testingForceReadDirLstat, _r, _r$1, _r$2, lstatNolog, fillFileStatFromSys, timespecToTime, Lstat, newRawConn, init, IsPathSeparator, basename, runtime_args, init$1, NewFile, newFile, epipecheck, newUnixDirent, sigpipe, syscallMode, ignoringEINTR, genericReadFrom, errNoDeadline, errDeadlineExceeded, IsNotExist, underlyingErrorIs, underlyingError, direntIno, direntReclen, direntNamlen, direntType, readInt, readIntBE, readIntLE; + errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + itoa = $packages["internal/itoa"]; + oserror = $packages["internal/oserror"]; + poll = $packages["internal/poll"]; + execenv = $packages["internal/syscall/execenv"]; + unix = $packages["internal/syscall/unix"]; + testlog = $packages["internal/testlog"]; + unsafeheader = $packages["internal/unsafeheader"]; + io = $packages["io"]; + fs = $packages["io/fs"]; + runtime = $packages["runtime"]; + sort = $packages["sort"]; + sync = $packages["sync"]; + atomic = $packages["sync/atomic"]; + syscall = $packages["syscall"]; + time = $packages["time"]; + fileStat = $pkg.fileStat = $newType(0, $kindStruct, "os.fileStat", true, "os", false, function(name_, size_, mode_, modTime_, sys_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.size = new $Int64(0, 0); + this.mode = 0; + this.modTime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$3.nil); + this.sys = new syscall.Stat_t.ptr(new $Int64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Int64(0, 0), new $Int64(0, 0), 0, 0, new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0)); + return; + } + this.name = name_; + this.size = size_; + this.mode = mode_; + this.modTime = modTime_; + this.sys = sys_; + }); + File = $pkg.File = $newType(0, $kindStruct, "os.File", true, "os", true, function(file_) { + this.$val = this; + if (arguments.length === 0) { + this.file = ptrType$9.nil; + return; + } + this.file = file_; + }); + rawConn = $pkg.rawConn = $newType(0, $kindStruct, "os.rawConn", true, "os", false, function(file_) { + this.$val = this; + if (arguments.length === 0) { + this.file = ptrType$2.nil; + return; + } + this.file = file_; + }); + file = $pkg.file = $newType(0, $kindStruct, "os.file", true, "os", false, function(pfd_, name_, dirinfo_, nonblock_, stdoutOrErr_, appendMode_) { + this.$val = this; + if (arguments.length === 0) { + this.pfd = new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), 0, new poll.pollDesc.ptr(ptrType$6.nil, false), ptrType$7.nil, 0, 0, false, false, false); + this.name = ""; + this.dirinfo = ptrType$8.nil; + this.nonblock = false; + this.stdoutOrErr = false; + this.appendMode = false; + return; + } + this.pfd = pfd_; + this.name = name_; + this.dirinfo = dirinfo_; + this.nonblock = nonblock_; + this.stdoutOrErr = stdoutOrErr_; + this.appendMode = appendMode_; + }); + unixDirent = $pkg.unixDirent = $newType(0, $kindStruct, "os.unixDirent", true, "os", false, function(parent_, name_, typ_, info_) { + this.$val = this; + if (arguments.length === 0) { + this.parent = ""; + this.name = ""; + this.typ = 0; + this.info = $ifaceNil; + return; + } + this.parent = parent_; + this.name = name_; + this.typ = typ_; + this.info = info_; + }); + LinkError = $pkg.LinkError = $newType(0, $kindStruct, "os.LinkError", true, "os", true, function(Op_, Old_, New_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Op = ""; + this.Old = ""; + this.New = ""; + this.Err = $ifaceNil; + return; + } + this.Op = Op_; + this.Old = Old_; + this.New = New_; + this.Err = Err_; + }); + onlyWriter = $pkg.onlyWriter = $newType(0, $kindStruct, "os.onlyWriter", true, "os", false, function(Writer_) { + this.$val = this; + if (arguments.length === 0) { + this.Writer = $ifaceNil; + return; + } + this.Writer = Writer_; + }); + timeout = $pkg.timeout = $newType(8, $kindInterface, "os.timeout", true, "os", false, null); + SyscallError = $pkg.SyscallError = $newType(0, $kindStruct, "os.SyscallError", true, "os", true, function(Syscall_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Syscall = ""; + this.Err = $ifaceNil; + return; + } + this.Syscall = Syscall_; + this.Err = Err_; + }); + dirInfo = $pkg.dirInfo = $newType(0, $kindStruct, "os.dirInfo", true, "os", false, function(buf_, nbuf_, bufp_) { + this.$val = this; + if (arguments.length === 0) { + this.buf = ptrType.nil; + this.nbuf = 0; + this.bufp = 0; + return; + } + this.buf = buf_; + this.nbuf = nbuf_; + this.bufp = bufp_; + }); + readdirMode = $pkg.readdirMode = $newType(4, $kindInt, "os.readdirMode", true, "os", false, null); + sliceType = $sliceType($String); + sliceType$1 = $sliceType($emptyInterface); + sliceType$2 = $sliceType($Uint8); + ptrType = $ptrType(sliceType$2); + ptrType$1 = $ptrType(fileStat); + ptrType$2 = $ptrType(File); + ptrType$3 = $ptrType(time.Location); + ptrType$5 = $ptrType(fs.PathError); + ptrType$6 = $ptrType(poll.FD); + sliceType$4 = $sliceType(syscall.Iovec); + ptrType$7 = $ptrType(sliceType$4); + ptrType$8 = $ptrType(dirInfo); + ptrType$9 = $ptrType(file); + funcType = $funcType([ptrType$9], [$error], false); + ptrType$17 = $ptrType(LinkError); + ptrType$18 = $ptrType(SyscallError); + sliceType$7 = $sliceType(fs.DirEntry); + sliceType$8 = $sliceType(fs.FileInfo); + funcType$2 = $funcType([$Uintptr], [], false); + funcType$3 = $funcType([$Uintptr], [$Bool], false); + ptrType$19 = $ptrType(rawConn); + ptrType$20 = $ptrType(unixDirent); + fileStat.ptr.prototype.Size = function() { + var fs$1; + fs$1 = this; + return fs$1.size; + }; + fileStat.prototype.Size = function() { return this.$val.Size(); }; + fileStat.ptr.prototype.Mode = function() { + var fs$1; + fs$1 = this; + return fs$1.mode; + }; + fileStat.prototype.Mode = function() { return this.$val.Mode(); }; + fileStat.ptr.prototype.ModTime = function() { + var fs$1; + fs$1 = this; + return fs$1.modTime; + }; + fileStat.prototype.ModTime = function() { return this.$val.ModTime(); }; + fileStat.ptr.prototype.Sys = function() { + var fs$1; + fs$1 = this; + return fs$1.sys; + }; + fileStat.prototype.Sys = function() { return this.$val.Sys(); }; + fileStat.ptr.prototype.Name = function() { + var fs$1; + fs$1 = this; + return fs$1.name; + }; + fileStat.prototype.Name = function() { return this.$val.Name(); }; + fileStat.ptr.prototype.IsDir = function() { + var fs$1; + fs$1 = this; + return new fs.FileMode(fs$1.Mode()).IsDir(); + }; + fileStat.prototype.IsDir = function() { return this.$val.IsDir(); }; + File.ptr.prototype.Stat = function() { + var {_r$3, err, f, fs$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fs$1 = [fs$1]; + f = this; + if (f === ptrType$2.nil) { + $s = -1; return [$ifaceNil, $pkg.ErrInvalid]; + } + fs$1[0] = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$3.nil), new syscall.Stat_t.ptr(new $Int64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Int64(0, 0), new $Int64(0, 0), 0, 0, new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0))); + _r$3 = f.file.pfd.Fstat(fs$1[0].sys); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err = _r$3; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [$ifaceNil, new fs.PathError.ptr("stat", f.file.name, err)]; + } + fillFileStatFromSys(fs$1[0], f.file.name); + $s = -1; return [fs$1[0], $ifaceNil]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Stat, $c: true, $r, _r$3, err, f, fs$1, $s};return $f; + }; + File.prototype.Stat = function() { return this.$val.Stat(); }; + lstatNolog = function(name) { + var {_r$3, err, fs$1, name, $s, $r, $c} = $restore(this, {name}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fs$1 = [fs$1]; + name = [name]; + fs$1[0] = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$3.nil), new syscall.Stat_t.ptr(new $Int64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Int64(0, 0), new $Int64(0, 0), 0, 0, new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0))); + _r$3 = ignoringEINTR((function(fs$1, name) { return function $b() { + var {$24r, _r$3, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$3 = syscall.Lstat(name[0], fs$1[0].sys); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r, _r$3, $s};return $f; + }; })(fs$1, name)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err = _r$3; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [$ifaceNil, new fs.PathError.ptr("lstat", name[0], err)]; + } + fillFileStatFromSys(fs$1[0], name[0]); + $s = -1; return [fs$1[0], $ifaceNil]; + /* */ } return; } var $f = {$blk: lstatNolog, $c: true, $r, _r$3, err, fs$1, name, $s};return $f; + }; + fillFileStatFromSys = function(fs$1, name) { + var _1, fs$1, name; + fs$1.name = basename(name); + fs$1.size = fs$1.sys.Size; + time.Time.copy(fs$1.modTime, timespecToTime(fs$1.sys.Mtime, fs$1.sys.MtimeNsec)); + fs$1.mode = ((((fs$1.sys.Mode & 511) >>> 0) >>> 0)); + _1 = (fs$1.sys.Mode & 126976) >>> 0; + if (_1 === (24576)) { + fs$1.mode = (fs$1.mode | (67108864)) >>> 0; + } else if (_1 === (8192)) { + fs$1.mode = (fs$1.mode | (69206016)) >>> 0; + } else if (_1 === (16384)) { + fs$1.mode = (fs$1.mode | (2147483648)) >>> 0; + } else if (_1 === (4096)) { + fs$1.mode = (fs$1.mode | (33554432)) >>> 0; + } else if (_1 === (40960)) { + fs$1.mode = (fs$1.mode | (134217728)) >>> 0; + } else if (_1 === (32768)) { + } else if (_1 === (49152)) { + fs$1.mode = (fs$1.mode | (16777216)) >>> 0; + } + if (!((((fs$1.sys.Mode & 1024) >>> 0) === 0))) { + fs$1.mode = (fs$1.mode | (4194304)) >>> 0; + } + if (!((((fs$1.sys.Mode & 2048) >>> 0) === 0))) { + fs$1.mode = (fs$1.mode | (8388608)) >>> 0; + } + if (!((((fs$1.sys.Mode & 512) >>> 0) === 0))) { + fs$1.mode = (fs$1.mode | (1048576)) >>> 0; + } + }; + timespecToTime = function(sec, nsec) { + var nsec, sec; + return time.Unix(sec, nsec); + }; + Lstat = function(name) { + var {$24r, _r$3, name, $s, $r, $c} = $restore(this, {name}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + $r = testlog.Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$3 = lstatNolog(name); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: Lstat, $c: true, $r, $24r, _r$3, name, $s};return $f; + }; + $pkg.Lstat = Lstat; + File.ptr.prototype.readFrom = function(r) { + var _tmp, _tmp$1, _tmp$2, err, f, handled, n, r; + n = new $Int64(0, 0); + handled = false; + err = $ifaceNil; + f = this; + _tmp = new $Int64(0, 0); + _tmp$1 = false; + _tmp$2 = $ifaceNil; + n = _tmp; + handled = _tmp$1; + err = _tmp$2; + return [n, handled, err]; + }; + File.prototype.readFrom = function(r) { return this.$val.readFrom(r); }; + rawConn.ptr.prototype.Control = function(f) { + var {_r$3, c, err, err$1, f, $s, $r, $c} = $restore(this, {f}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + err = c.file.checkValid("SyscallConn.Control"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = c.file.file.pfd.RawControl(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err$1 = _r$3; + runtime.KeepAlive(c.file); + $s = -1; return err$1; + /* */ } return; } var $f = {$blk: rawConn.ptr.prototype.Control, $c: true, $r, _r$3, c, err, err$1, f, $s};return $f; + }; + rawConn.prototype.Control = function(f) { return this.$val.Control(f); }; + rawConn.ptr.prototype.Read = function(f) { + var {_r$3, c, err, err$1, f, $s, $r, $c} = $restore(this, {f}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + err = c.file.checkValid("SyscallConn.Read"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = c.file.file.pfd.RawRead(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err$1 = _r$3; + runtime.KeepAlive(c.file); + $s = -1; return err$1; + /* */ } return; } var $f = {$blk: rawConn.ptr.prototype.Read, $c: true, $r, _r$3, c, err, err$1, f, $s};return $f; + }; + rawConn.prototype.Read = function(f) { return this.$val.Read(f); }; + rawConn.ptr.prototype.Write = function(f) { + var {_r$3, c, err, err$1, f, $s, $r, $c} = $restore(this, {f}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + err = c.file.checkValid("SyscallConn.Write"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = c.file.file.pfd.RawWrite(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err$1 = _r$3; + runtime.KeepAlive(c.file); + $s = -1; return err$1; + /* */ } return; } var $f = {$blk: rawConn.ptr.prototype.Write, $c: true, $r, _r$3, c, err, err$1, f, $s};return $f; + }; + rawConn.prototype.Write = function(f) { return this.$val.Write(f); }; + newRawConn = function(file$1) { + var file$1; + return [new rawConn.ptr(file$1), $ifaceNil]; + }; + init = function() { + if (false) { + return; + } + $pkg.Args = runtime_args(); + }; + IsPathSeparator = function(c) { + var c; + return 47 === c; + }; + $pkg.IsPathSeparator = IsPathSeparator; + basename = function(name) { + var i, name; + i = name.length - 1 >> 0; + while (true) { + if (!(i > 0 && (name.charCodeAt(i) === 47))) { break; } + name = $substring(name, 0, i); + i = i - (1) >> 0; + } + i = i - (1) >> 0; + while (true) { + if (!(i >= 0)) { break; } + if (name.charCodeAt(i) === 47) { + name = $substring(name, (i + 1 >> 0)); + break; + } + i = i - (1) >> 0; + } + return name; + }; + runtime_args = function() { + return $pkg.Args; + }; + init$1 = function() { + var argv, i, process; + process = $global.process; + if (!(process === undefined)) { + argv = process.argv; + if (!(argv === undefined) && $parseInt(argv.length) >= 1) { + $pkg.Args = $makeSlice(sliceType, ($parseInt(argv.length) - 1 >> 0)); + i = 0; + while (true) { + if (!(i < ($parseInt(argv.length) - 1 >> 0))) { break; } + ((i < 0 || i >= $pkg.Args.$length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.Args.$array[$pkg.Args.$offset + i] = $internalize(argv[(i + 1 >> 0)], $String)); + i = i + (1) >> 0; + } + } + } + if ($pkg.Args.$length === 0) { + $pkg.Args = new sliceType(["?"]); + } + }; + File.ptr.prototype.WriteString = function(s) { + var {$24r, _r$3, _tuple, err, f, n, s, $s, $r, $c} = $restore(this, {s}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + _r$3 = f.Write((new sliceType$2($stringToBytes(s)))); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + $24r = [n, err]; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.WriteString, $c: true, $r, $24r, _r$3, _tuple, err, f, n, s, $s};return $f; + }; + File.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; + File.ptr.prototype.Fd = function() { + var {_r$3, f, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + if (f === ptrType$2.nil) { + $s = -1; return 4294967295; + } + /* */ if (f.file.nonblock) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (f.file.nonblock) { */ case 1: + _r$3 = f.file.pfd.SetBlocking(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + /* } */ case 2: + $s = -1; return ((f.file.pfd.Sysfd >>> 0)); + /* */ } return; } var $f = {$blk: File.ptr.prototype.Fd, $c: true, $r, _r$3, f, $s};return $f; + }; + File.prototype.Fd = function() { return this.$val.Fd(); }; + NewFile = function(fd, name) { + var {$24r, _r$3, _tuple, err, fd, kind, name, nb, $s, $r, $c} = $restore(this, {fd, name}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + kind = 0; + _tuple = unix.IsNonblock(((fd >> 0))); + nb = _tuple[0]; + err = _tuple[1]; + if ($interfaceIsEqual(err, $ifaceNil) && nb) { + kind = 3; + } + _r$3 = newFile(fd, name, kind); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: NewFile, $c: true, $r, $24r, _r$3, _tuple, err, fd, kind, name, nb, $s};return $f; + }; + $pkg.NewFile = NewFile; + newFile = function(fd, name, kind) { + var {_1, _r$3, err, err$1, err$2, f, fd, fdi, kind, name, pollable, st, typ, $s, $r, $c} = $restore(this, {fd, name, kind}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + fdi = [fdi]; + st = [st]; + fdi[0] = ((fd >> 0)); + if (fdi[0] < 0) { + $s = -1; return ptrType$2.nil; + } + f = new File.ptr(new file.ptr(new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), fdi[0], new poll.pollDesc.ptr(ptrType$6.nil, false), ptrType$7.nil, 0, 0, true, true, false), name, ptrType$8.nil, false, (fdi[0] === 1) || (fdi[0] === 2), false)); + pollable = (kind === 1) || (kind === 2) || (kind === 3); + /* */ if (kind === 1) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (kind === 1) { */ case 1: + _1 = "js"; + /* */ if (_1 === ("darwin") || _1 === ("ios") || _1 === ("dragonfly") || _1 === ("freebsd") || _1 === ("netbsd") || _1 === ("openbsd")) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_1 === ("darwin") || _1 === ("ios") || _1 === ("dragonfly") || _1 === ("freebsd") || _1 === ("netbsd") || _1 === ("openbsd")) { */ case 4: + st[0] = new syscall.Stat_t.ptr(new $Int64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Int64(0, 0), new $Int64(0, 0), 0, 0, new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0)); + _r$3 = ignoringEINTR((function(fdi, st) { return function $b() { + var {$24r, _r$3, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$3 = syscall.Fstat(fdi[0], st[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: $b, $c: true, $r, $24r, _r$3, $s};return $f; + }; })(fdi, st)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err = _r$3; + typ = (st[0].Mode & 126976) >>> 0; + if ($interfaceIsEqual(err, $ifaceNil) && ((typ === 32768) || (typ === 16384))) { + pollable = false; + } + if (false && (typ === 4096)) { + pollable = false; + } + /* } */ case 5: + case 3: + /* } */ case 2: + err$1 = f.file.pfd.Init("file", pollable); + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + } else if (pollable) { + err$2 = syscall.SetNonblock(fdi[0], true); + if ($interfaceIsEqual(err$2, $ifaceNil)) { + f.file.nonblock = true; + } + } + runtime.SetFinalizer(f.file, new funcType($methodExpr(ptrType$9, "close"))); + $s = -1; return f; + /* */ } return; } var $f = {$blk: newFile, $c: true, $r, _1, _r$3, err, err$1, err$2, f, fd, fdi, kind, name, pollable, st, typ, $s};return $f; + }; + epipecheck = function(file$1, e) { + var {e, file$1, $s, $r, $c} = $restore(this, {file$1, e}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* */ if ($interfaceIsEqual(e, new syscall.Errno(32)) && file$1.file.stdoutOrErr) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ($interfaceIsEqual(e, new syscall.Errno(32)) && file$1.file.stdoutOrErr) { */ case 1: + $r = sigpipe(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: epipecheck, $c: true, $r, e, file$1, $s};return $f; + }; + file.ptr.prototype.close = function() { + var {_r$3, e, err, file$1, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + file$1 = this; + if (file$1 === ptrType$9.nil) { + $s = -1; return new syscall.Errno(22); + } + if (!(file$1.dirinfo === ptrType$8.nil)) { + file$1.dirinfo.close(); + file$1.dirinfo = ptrType$8.nil; + } + err = $ifaceNil; + _r$3 = file$1.pfd.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + e = _r$3; + if (!($interfaceIsEqual(e, $ifaceNil))) { + if ($interfaceIsEqual(e, poll.ErrFileClosing)) { + e = $pkg.ErrClosed; + } + err = new fs.PathError.ptr("close", file$1.name, e); + } + runtime.SetFinalizer(file$1, $ifaceNil); + $s = -1; return err; + /* */ } return; } var $f = {$blk: file.ptr.prototype.close, $c: true, $r, _r$3, e, err, file$1, $s};return $f; + }; + file.prototype.close = function() { return this.$val.close(); }; + File.ptr.prototype.seek = function(offset, whence) { + var {_r$3, _tmp, _tmp$1, _tuple, err, f, offset, ret, whence, $s, $r, $c} = $restore(this, {offset, whence}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + ret = new $Int64(0, 0); + err = $ifaceNil; + f = this; + if (!(f.file.dirinfo === ptrType$8.nil)) { + f.file.dirinfo.close(); + f.file.dirinfo = ptrType$8.nil; + } + _r$3 = f.file.pfd.Seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + ret = _tuple[0]; + err = _tuple[1]; + runtime.KeepAlive(f); + _tmp = ret; + _tmp$1 = err; + ret = _tmp; + err = _tmp$1; + $s = -1; return [ret, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.seek, $c: true, $r, _r$3, _tmp, _tmp$1, _tuple, err, f, offset, ret, whence, $s};return $f; + }; + File.prototype.seek = function(offset, whence) { return this.$val.seek(offset, whence); }; + unixDirent.ptr.prototype.Name = function() { + var d; + d = this; + return d.name; + }; + unixDirent.prototype.Name = function() { return this.$val.Name(); }; + unixDirent.ptr.prototype.IsDir = function() { + var d; + d = this; + return new fs.FileMode(d.typ).IsDir(); + }; + unixDirent.prototype.IsDir = function() { return this.$val.IsDir(); }; + unixDirent.ptr.prototype.Type = function() { + var d; + d = this; + return d.typ; + }; + unixDirent.prototype.Type = function() { return this.$val.Type(); }; + unixDirent.ptr.prototype.Info = function() { + var {$24r, _r$3, d, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + d = this; + if (!($interfaceIsEqual(d.info, $ifaceNil))) { + $s = -1; return [d.info, $ifaceNil]; + } + _r$3 = lstat(d.parent + "/" + d.name); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: unixDirent.ptr.prototype.Info, $c: true, $r, $24r, _r$3, d, $s};return $f; + }; + unixDirent.prototype.Info = function() { return this.$val.Info(); }; + newUnixDirent = function(parent, name, typ) { + var {_r$3, _r$4, _r$5, _tuple, err, info, name, parent, typ, ude, $s, $r, $c} = $restore(this, {parent, name, typ}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + ude = new unixDirent.ptr(parent, name, typ, $ifaceNil); + if (!((typ === 4294967295)) && !testingForceReadDirLstat) { + $s = -1; return [ude, $ifaceNil]; + } + _r$3 = lstat(parent + "/" + name); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + info = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return [$ifaceNil, err]; + } + _r$4 = info.Mode(); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$5 = new fs.FileMode(_r$4).Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + ude.typ = _r$5; + ude.info = info; + $s = -1; return [ude, $ifaceNil]; + /* */ } return; } var $f = {$blk: newUnixDirent, $c: true, $r, _r$3, _r$4, _r$5, _tuple, err, info, name, parent, typ, ude, $s};return $f; + }; + sigpipe = function() { + $throwRuntimeError("native function not implemented: os.sigpipe"); + }; + File.ptr.prototype.Close = function() { + var {$24r, _r$3, f, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + if (f === ptrType$2.nil) { + $s = -1; return $pkg.ErrInvalid; + } + _r$3 = f.file.close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Close, $c: true, $r, $24r, _r$3, f, $s};return $f; + }; + File.prototype.Close = function() { return this.$val.Close(); }; + File.ptr.prototype.read = function(b) { + var {_r$3, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r, $c} = $restore(this, {b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + _r$3 = f.file.pfd.Read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + runtime.KeepAlive(f); + _tmp = n; + _tmp$1 = err; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.read, $c: true, $r, _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, $s};return $f; + }; + File.prototype.read = function(b) { return this.$val.read(b); }; + File.ptr.prototype.pread = function(b, off) { + var {_r$3, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r, $c} = $restore(this, {b, off}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + _r$3 = f.file.pfd.Pread(b, off); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + runtime.KeepAlive(f); + _tmp = n; + _tmp$1 = err; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.pread, $c: true, $r, _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s};return $f; + }; + File.prototype.pread = function(b, off) { return this.$val.pread(b, off); }; + File.ptr.prototype.write = function(b) { + var {_r$3, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r, $c} = $restore(this, {b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + _r$3 = f.file.pfd.Write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + runtime.KeepAlive(f); + _tmp = n; + _tmp$1 = err; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.write, $c: true, $r, _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, $s};return $f; + }; + File.prototype.write = function(b) { return this.$val.write(b); }; + File.ptr.prototype.pwrite = function(b, off) { + var {_r$3, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r, $c} = $restore(this, {b, off}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + _r$3 = f.file.pfd.Pwrite(b, off); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + runtime.KeepAlive(f); + _tmp = n; + _tmp$1 = err; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.pwrite, $c: true, $r, _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s};return $f; + }; + File.prototype.pwrite = function(b, off) { return this.$val.pwrite(b, off); }; + syscallMode = function(i) { + var i, o; + o = 0; + o = (o | (((new fs.FileMode(i).Perm() >>> 0)))) >>> 0; + if (!((((i & 8388608) >>> 0) === 0))) { + o = (o | (2048)) >>> 0; + } + if (!((((i & 4194304) >>> 0) === 0))) { + o = (o | (1024)) >>> 0; + } + if (!((((i & 1048576) >>> 0) === 0))) { + o = (o | (512)) >>> 0; + } + return o; + }; + File.ptr.prototype.chmod = function(mode) { + var {_r$3, e, err, f, mode, $s, $r, $c} = $restore(this, {mode}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("chmod"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.Fchmod(syscallMode(mode)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + e = _r$3; + if (!($interfaceIsEqual(e, $ifaceNil))) { + $s = -1; return f.wrapErr("chmod", e); + } + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: File.ptr.prototype.chmod, $c: true, $r, _r$3, e, err, f, mode, $s};return $f; + }; + File.prototype.chmod = function(mode) { return this.$val.chmod(mode); }; + File.ptr.prototype.Chown = function(uid, gid) { + var {_r$3, e, err, f, gid, uid, $s, $r, $c} = $restore(this, {uid, gid}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("chown"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.Fchown(uid, gid); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + e = _r$3; + if (!($interfaceIsEqual(e, $ifaceNil))) { + $s = -1; return f.wrapErr("chown", e); + } + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Chown, $c: true, $r, _r$3, e, err, f, gid, uid, $s};return $f; + }; + File.prototype.Chown = function(uid, gid) { return this.$val.Chown(uid, gid); }; + File.ptr.prototype.Truncate = function(size) { + var {_r$3, e, err, f, size, $s, $r, $c} = $restore(this, {size}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("truncate"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.Ftruncate(size); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + e = _r$3; + if (!($interfaceIsEqual(e, $ifaceNil))) { + $s = -1; return f.wrapErr("truncate", e); + } + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Truncate, $c: true, $r, _r$3, e, err, f, size, $s};return $f; + }; + File.prototype.Truncate = function(size) { return this.$val.Truncate(size); }; + File.ptr.prototype.Sync = function() { + var {_r$3, e, err, f, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("sync"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.Fsync(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + e = _r$3; + if (!($interfaceIsEqual(e, $ifaceNil))) { + $s = -1; return f.wrapErr("sync", e); + } + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Sync, $c: true, $r, _r$3, e, err, f, $s};return $f; + }; + File.prototype.Sync = function() { return this.$val.Sync(); }; + File.ptr.prototype.Chdir = function() { + var {_r$3, e, err, f, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("chdir"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.Fchdir(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + e = _r$3; + if (!($interfaceIsEqual(e, $ifaceNil))) { + $s = -1; return f.wrapErr("chdir", e); + } + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Chdir, $c: true, $r, _r$3, e, err, f, $s};return $f; + }; + File.prototype.Chdir = function() { return this.$val.Chdir(); }; + File.ptr.prototype.setDeadline = function(t) { + var {$24r, _r$3, err, f, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("SetDeadline"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.SetDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.setDeadline, $c: true, $r, $24r, _r$3, err, f, t, $s};return $f; + }; + File.prototype.setDeadline = function(t) { return this.$val.setDeadline(t); }; + File.ptr.prototype.setReadDeadline = function(t) { + var {$24r, _r$3, err, f, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("SetReadDeadline"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.SetReadDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.setReadDeadline, $c: true, $r, $24r, _r$3, err, f, t, $s};return $f; + }; + File.prototype.setReadDeadline = function(t) { return this.$val.setReadDeadline(t); }; + File.ptr.prototype.setWriteDeadline = function(t) { + var {$24r, _r$3, err, f, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + err = f.checkValid("SetWriteDeadline"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + $s = -1; return err; + } + _r$3 = f.file.pfd.SetWriteDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.setWriteDeadline, $c: true, $r, $24r, _r$3, err, f, t, $s};return $f; + }; + File.prototype.setWriteDeadline = function(t) { return this.$val.setWriteDeadline(t); }; + File.ptr.prototype.checkValid = function(op) { + var f, op; + f = this; + if (f === ptrType$2.nil) { + return $pkg.ErrInvalid; + } + return $ifaceNil; + }; + File.prototype.checkValid = function(op) { return this.$val.checkValid(op); }; + ignoringEINTR = function(fn) { + var {_r$3, err, fn, $s, $r, $c} = $restore(this, {fn}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + /* while (true) { */ case 1: + _r$3 = fn(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err = _r$3; + if (!($interfaceIsEqual(err, new syscall.Errno(4)))) { + $s = -1; return err; + } + $s = 1; continue; + case 2: + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: ignoringEINTR, $c: true, $r, _r$3, err, fn, $s};return $f; + }; + File.ptr.prototype.Name = function() { + var f; + f = this; + return f.file.name; + }; + File.prototype.Name = function() { return this.$val.Name(); }; + LinkError.ptr.prototype.Error = function() { + var {$24r, _r$3, e, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + e = this; + _r$3 = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = e.Op + " " + e.Old + " " + e.New + ": " + _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: LinkError.ptr.prototype.Error, $c: true, $r, $24r, _r$3, e, $s};return $f; + }; + LinkError.prototype.Error = function() { return this.$val.Error(); }; + LinkError.ptr.prototype.Unwrap = function() { + var e; + e = this; + return e.Err; + }; + LinkError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; + File.ptr.prototype.Read = function(b) { + var {_r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r, $c} = $restore(this, {b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + err$1 = f.checkValid("read"); + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp = 0; + _tmp$1 = err$1; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + } + _r$3 = f.read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + e = _tuple[1]; + _tmp$2 = n; + _tmp$3 = f.wrapErr("read", e); + n = _tmp$2; + err = _tmp$3; + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Read, $c: true, $r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s};return $f; + }; + File.prototype.Read = function(b) { return this.$val.Read(b); }; + File.ptr.prototype.ReadAt = function(b, off) { + var {_r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r, $c} = $restore(this, {b, off}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + err$1 = f.checkValid("read"); + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp = 0; + _tmp$1 = err$1; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + } + if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { + _tmp$2 = 0; + _tmp$3 = new fs.PathError.ptr("readat", f.file.name, errors.New("negative offset")); + n = _tmp$2; + err = _tmp$3; + $s = -1; return [n, err]; + } + /* while (true) { */ case 1: + /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } + _r$3 = f.pread(b, off); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + m = _tuple[0]; + e = _tuple[1]; + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = f.wrapErr("read", e); + /* break; */ $s = 2; continue; + } + n = n + (m) >> 0; + b = $subslice(b, m); + off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); + $s = 1; continue; + case 2: + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.ReadAt, $c: true, $r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, m, n, off, x, $s};return $f; + }; + File.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; + File.ptr.prototype.ReadFrom = function(r) { + var {$24r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, e, err, err$1, f, handled, n, r, $s, $r, $c} = $restore(this, {r}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = new $Int64(0, 0); + err = $ifaceNil; + f = this; + err$1 = f.checkValid("write"); + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp = new $Int64(0, 0); + _tmp$1 = err$1; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + } + _tuple = f.readFrom(r); + n = _tuple[0]; + handled = _tuple[1]; + e = _tuple[2]; + /* */ if (!handled) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!handled) { */ case 1: + _r$3 = genericReadFrom(f, r); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple$1 = _r$3; + n = _tuple$1[0]; + err = _tuple$1[1]; + $24r = [n, err]; + $s = 4; case 4: return $24r; + /* } */ case 2: + _tmp$2 = n; + _tmp$3 = f.wrapErr("write", e); + n = _tmp$2; + err = _tmp$3; + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.ReadFrom, $c: true, $r, $24r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, e, err, err$1, f, handled, n, r, $s};return $f; + }; + File.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; + genericReadFrom = function(f, r) { + var {$24r, _r$3, f, r, x, $s, $r, $c} = $restore(this, {f, r}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r$3 = io.Copy((x = new onlyWriter.ptr(f), new x.constructor.elem(x)), r); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: genericReadFrom, $c: true, $r, $24r, _r$3, f, r, x, $s};return $f; + }; + File.ptr.prototype.Write = function(b) { + var {_r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r, $c} = $restore(this, {b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + err$1 = f.checkValid("write"); + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp = 0; + _tmp$1 = err$1; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + } + _r$3 = f.write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + e = _tuple[1]; + if (n < 0) { + n = 0; + } + if (!((n === b.$length))) { + err = io.ErrShortWrite; + } + $r = epipecheck(f, e); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = f.wrapErr("write", e); + } + _tmp$2 = n; + _tmp$3 = err; + n = _tmp$2; + err = _tmp$3; + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Write, $c: true, $r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s};return $f; + }; + File.prototype.Write = function(b) { return this.$val.Write(b); }; + File.ptr.prototype.WriteAt = function(b, off) { + var {_r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r, $c} = $restore(this, {b, off}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + f = this; + err$1 = f.checkValid("write"); + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp = 0; + _tmp$1 = err$1; + n = _tmp; + err = _tmp$1; + $s = -1; return [n, err]; + } + if (f.file.appendMode) { + _tmp$2 = 0; + _tmp$3 = errWriteAtInAppendMode; + n = _tmp$2; + err = _tmp$3; + $s = -1; return [n, err]; + } + if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { + _tmp$4 = 0; + _tmp$5 = new fs.PathError.ptr("writeat", f.file.name, errors.New("negative offset")); + n = _tmp$4; + err = _tmp$5; + $s = -1; return [n, err]; + } + /* while (true) { */ case 1: + /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } + _r$3 = f.pwrite(b, off); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + m = _tuple[0]; + e = _tuple[1]; + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = f.wrapErr("write", e); + /* break; */ $s = 2; continue; + } + n = n + (m) >> 0; + b = $subslice(b, m); + off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); + $s = 1; continue; + case 2: + $s = -1; return [n, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.WriteAt, $c: true, $r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, e, err, err$1, f, m, n, off, x, $s};return $f; + }; + File.prototype.WriteAt = function(b, off) { return this.$val.WriteAt(b, off); }; + File.ptr.prototype.Seek = function(offset, whence) { + var {_r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, err, err$1, f, offset, r, ret, whence, $s, $r, $c} = $restore(this, {offset, whence}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + ret = new $Int64(0, 0); + err = $ifaceNil; + f = this; + err$1 = f.checkValid("seek"); + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp = new $Int64(0, 0); + _tmp$1 = err$1; + ret = _tmp; + err = _tmp$1; + $s = -1; return [ret, err]; + } + _r$3 = f.seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + r = _tuple[0]; + e = _tuple[1]; + if ($interfaceIsEqual(e, $ifaceNil) && !(f.file.dirinfo === ptrType$8.nil) && !((r.$high === 0 && r.$low === 0))) { + e = new syscall.Errno(21); + } + if (!($interfaceIsEqual(e, $ifaceNil))) { + _tmp$2 = new $Int64(0, 0); + _tmp$3 = f.wrapErr("seek", e); + ret = _tmp$2; + err = _tmp$3; + $s = -1; return [ret, err]; + } + _tmp$4 = r; + _tmp$5 = $ifaceNil; + ret = _tmp$4; + err = _tmp$5; + $s = -1; return [ret, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Seek, $c: true, $r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, err, err$1, f, offset, r, ret, whence, $s};return $f; + }; + File.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; + File.ptr.prototype.wrapErr = function(op, err) { + var err, f, op; + f = this; + if ($interfaceIsEqual(err, $ifaceNil) || $interfaceIsEqual(err, io.EOF)) { + return err; + } + if ($interfaceIsEqual(err, poll.ErrFileClosing)) { + err = $pkg.ErrClosed; + } + return new fs.PathError.ptr(op, f.file.name, err); + }; + File.prototype.wrapErr = function(op, err) { return this.$val.wrapErr(op, err); }; + File.ptr.prototype.Chmod = function(mode) { + var {$24r, _r$3, f, mode, $s, $r, $c} = $restore(this, {mode}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + _r$3 = f.chmod(mode); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Chmod, $c: true, $r, $24r, _r$3, f, mode, $s};return $f; + }; + File.prototype.Chmod = function(mode) { return this.$val.Chmod(mode); }; + File.ptr.prototype.SetDeadline = function(t) { + var {$24r, _r$3, f, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + _r$3 = f.setDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.SetDeadline, $c: true, $r, $24r, _r$3, f, t, $s};return $f; + }; + File.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; + File.ptr.prototype.SetReadDeadline = function(t) { + var {$24r, _r$3, f, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + _r$3 = f.setReadDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.SetReadDeadline, $c: true, $r, $24r, _r$3, f, t, $s};return $f; + }; + File.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; + File.ptr.prototype.SetWriteDeadline = function(t) { + var {$24r, _r$3, f, t, $s, $r, $c} = $restore(this, {t}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + _r$3 = f.setWriteDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: File.ptr.prototype.SetWriteDeadline, $c: true, $r, $24r, _r$3, f, t, $s};return $f; + }; + File.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; + File.ptr.prototype.SyscallConn = function() { + var _returncast, err, f; + f = this; + err = f.checkValid("SyscallConn"); + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [$ifaceNil, err]; + } + _returncast = newRawConn(f); + return [_returncast[0], _returncast[1]]; + }; + File.prototype.SyscallConn = function() { return this.$val.SyscallConn(); }; + errNoDeadline = function() { + return poll.ErrNoDeadline; + }; + errDeadlineExceeded = function() { + return poll.ErrDeadlineExceeded; + }; + SyscallError.ptr.prototype.Error = function() { + var {$24r, _r$3, e, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + e = this; + _r$3 = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $24r = e.Syscall + ": " + _r$3; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: SyscallError.ptr.prototype.Error, $c: true, $r, $24r, _r$3, e, $s};return $f; + }; + SyscallError.prototype.Error = function() { return this.$val.Error(); }; + SyscallError.ptr.prototype.Unwrap = function() { + var e; + e = this; + return e.Err; + }; + SyscallError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; + SyscallError.ptr.prototype.Timeout = function() { + var {$24r, _r$3, _tuple, _v, e, ok, t, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + e = this; + _tuple = $assertType(e.Err, timeout, true); + t = _tuple[0]; + ok = _tuple[1]; + if (!(ok)) { _v = false; $s = 1; continue s; } + _r$3 = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _v = _r$3; case 1: + $24r = _v; + $s = 3; case 3: return $24r; + /* */ } return; } var $f = {$blk: SyscallError.ptr.prototype.Timeout, $c: true, $r, $24r, _r$3, _tuple, _v, e, ok, t, $s};return $f; + }; + SyscallError.prototype.Timeout = function() { return this.$val.Timeout(); }; + IsNotExist = function(err) { + var err; + return underlyingErrorIs(err, $pkg.ErrNotExist); + }; + $pkg.IsNotExist = IsNotExist; + underlyingErrorIs = function(err, target) { + var _tuple, e, err, ok, target; + err = underlyingError(err); + if ($interfaceIsEqual(err, target)) { + return true; + } + _tuple = $assertType(err, syscall.Errno, true); + e = _tuple[0]; + ok = _tuple[1]; + return ok && new syscall.Errno(e).Is(target); + }; + underlyingError = function(err) { + var _ref, err, err$1, err$2, err$3; + _ref = err; + if ($assertType(_ref, ptrType$5, true)[1]) { + err$1 = _ref.$val; + return err$1.Err; + } else if ($assertType(_ref, ptrType$17, true)[1]) { + err$2 = _ref.$val; + return err$2.Err; + } else if ($assertType(_ref, ptrType$18, true)[1]) { + err$3 = _ref.$val; + return err$3.Err; + } + return err; + }; + direntIno = function(buf) { + var buf; + return [new $Uint64(0, 1), true]; + }; + direntReclen = function(buf) { + var buf; + return readInt(buf, 0, 2); + }; + direntNamlen = function(buf) { + var _tuple, buf, ok, reclen; + _tuple = direntReclen(buf); + reclen = _tuple[0]; + ok = _tuple[1]; + if (!ok) { + return [new $Uint64(0, 0), false]; + } + return [new $Uint64(reclen.$high - 0, reclen.$low - 2), true]; + }; + direntType = function(buf) { + var buf; + return 4294967295; + }; + dirInfo.ptr.prototype.close = function() { + var d; + d = this; + if (!(d.buf === ptrType.nil)) { + dirBufPool.Put(d.buf); + d.buf = ptrType.nil; + } + }; + dirInfo.prototype.close = function() { return this.$val.close(); }; + File.ptr.prototype.readdir = function(n, mode) { + var {_i, _r$3, _r$4, _r$5, _r$6, _ref, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, buf, c, d, de, dirents, err, err$1, err$2, errno, f, i, info, infos, ino, mode, n, name, names, namlen, ok, rec, reclen, x, x$1, x$2, $s, $r, $c} = $restore(this, {n, mode}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + names = sliceType.nil; + dirents = sliceType$7.nil; + infos = sliceType$8.nil; + err = $ifaceNil; + f = this; + /* */ if (f.file.dirinfo === ptrType$8.nil) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (f.file.dirinfo === ptrType$8.nil) { */ case 1: + f.file.dirinfo = new dirInfo.ptr(ptrType.nil, 0, 0); + _r$3 = dirBufPool.Get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + f.file.dirinfo.buf = $assertType(_r$3, ptrType); + /* } */ case 2: + d = f.file.dirinfo; + if (n === 0) { + n = -1; + } + /* while (true) { */ case 4: + /* if (!(!((n === 0)))) { break; } */ if(!(!((n === 0)))) { $s = 5; continue; } + /* */ if (d.bufp >= d.nbuf) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (d.bufp >= d.nbuf) { */ case 6: + d.bufp = 0; + errno = $ifaceNil; + _r$4 = f.file.pfd.ReadDirent(d.buf.$get()); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _tuple = _r$4; + d.nbuf = _tuple[0]; + errno = _tuple[1]; + runtime.KeepAlive(f); + if (!($interfaceIsEqual(errno, $ifaceNil))) { + _tmp = names; + _tmp$1 = dirents; + _tmp$2 = infos; + _tmp$3 = new fs.PathError.ptr("readdirent", f.file.name, errno); + names = _tmp; + dirents = _tmp$1; + infos = _tmp$2; + err = _tmp$3; + $s = -1; return [names, dirents, infos, err]; + } + if (d.nbuf <= 0) { + /* break; */ $s = 5; continue; + } + /* } */ case 7: + buf = $subslice((d.buf.$get()), d.bufp, d.nbuf); + _tuple$1 = direntReclen(buf); + reclen = _tuple$1[0]; + ok = _tuple$1[1]; + if (!ok || (x = (new $Uint64(0, buf.$length)), (reclen.$high > x.$high || (reclen.$high === x.$high && reclen.$low > x.$low)))) { + /* break; */ $s = 5; continue; + } + rec = $subslice(buf, 0, $flatten64(reclen)); + d.bufp = d.bufp + (((reclen.$low >> 0))) >> 0; + _tuple$2 = direntIno(rec); + ino = _tuple$2[0]; + ok = _tuple$2[1]; + if (!ok) { + /* break; */ $s = 5; continue; + } + if ((ino.$high === 0 && ino.$low === 0)) { + /* continue; */ $s = 4; continue; + } + _tuple$3 = direntNamlen(rec); + namlen = _tuple$3[0]; + ok = _tuple$3[1]; + if (!ok || (x$1 = new $Uint64(0 + namlen.$high, 2 + namlen.$low), x$2 = (new $Uint64(0, rec.$length)), (x$1.$high > x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { + /* break; */ $s = 5; continue; + } + name = $subslice(rec, 2, $flatten64(new $Uint64(0 + namlen.$high, 2 + namlen.$low))); + _ref = name; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + if (c === 0) { + name = $subslice(name, 0, i); + break; + } + _i++; + } + if (($bytesToString(name)) === "." || ($bytesToString(name)) === "..") { + /* continue; */ $s = 4; continue; + } + if (n > 0) { + n = n - (1) >> 0; + } + /* */ if (mode === 0) { $s = 9; continue; } + /* */ if (mode === 1) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (mode === 0) { */ case 9: + names = $append(names, ($bytesToString(name))); + $s = 12; continue; + /* } else if (mode === 1) { */ case 10: + _r$5 = newUnixDirent(f.file.name, ($bytesToString(name)), direntType(rec)); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _tuple$4 = _r$5; + de = _tuple$4[0]; + err$1 = _tuple$4[1]; + if (IsNotExist(err$1)) { + /* continue; */ $s = 4; continue; + } + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp$4 = sliceType.nil; + _tmp$5 = dirents; + _tmp$6 = sliceType$8.nil; + _tmp$7 = err$1; + names = _tmp$4; + dirents = _tmp$5; + infos = _tmp$6; + err = _tmp$7; + $s = -1; return [names, dirents, infos, err]; + } + dirents = $append(dirents, de); + $s = 12; continue; + /* } else { */ case 11: + _r$6 = lstat(f.file.name + "/" + ($bytesToString(name))); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _tuple$5 = _r$6; + info = _tuple$5[0]; + err$2 = _tuple$5[1]; + if (IsNotExist(err$2)) { + /* continue; */ $s = 4; continue; + } + if (!($interfaceIsEqual(err$2, $ifaceNil))) { + _tmp$8 = sliceType.nil; + _tmp$9 = sliceType$7.nil; + _tmp$10 = infos; + _tmp$11 = err$2; + names = _tmp$8; + dirents = _tmp$9; + infos = _tmp$10; + err = _tmp$11; + $s = -1; return [names, dirents, infos, err]; + } + infos = $append(infos, info); + /* } */ case 12: + $s = 4; continue; + case 5: + if (n > 0 && (((names.$length + dirents.$length >> 0) + infos.$length >> 0) === 0)) { + _tmp$12 = sliceType.nil; + _tmp$13 = sliceType$7.nil; + _tmp$14 = sliceType$8.nil; + _tmp$15 = io.EOF; + names = _tmp$12; + dirents = _tmp$13; + infos = _tmp$14; + err = _tmp$15; + $s = -1; return [names, dirents, infos, err]; + } + _tmp$16 = names; + _tmp$17 = dirents; + _tmp$18 = infos; + _tmp$19 = $ifaceNil; + names = _tmp$16; + dirents = _tmp$17; + infos = _tmp$18; + err = _tmp$19; + $s = -1; return [names, dirents, infos, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.readdir, $c: true, $r, _i, _r$3, _r$4, _r$5, _r$6, _ref, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, buf, c, d, de, dirents, err, err$1, err$2, errno, f, i, info, infos, ino, mode, n, name, names, namlen, ok, rec, reclen, x, x$1, x$2, $s};return $f; + }; + File.prototype.readdir = function(n, mode) { return this.$val.readdir(n, mode); }; + readInt = function(b, off, size) { + var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, off, ok, size, u; + u = new $Uint64(0, 0); + ok = false; + if (b.$length < (((off + size >>> 0) >> 0))) { + _tmp = new $Uint64(0, 0); + _tmp$1 = false; + u = _tmp; + ok = _tmp$1; + return [u, ok]; + } + if (false) { + _tmp$2 = readIntBE($subslice(b, off), size); + _tmp$3 = true; + u = _tmp$2; + ok = _tmp$3; + return [u, ok]; + } + _tmp$4 = readIntLE($subslice(b, off), size); + _tmp$5 = true; + u = _tmp$4; + ok = _tmp$5; + return [u, ok]; + }; + readIntBE = function(b, size) { + var _1, b, size, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + _1 = size; + if (_1 === (1)) { + return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); + } else if (_1 === (2)) { + $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); + return (x = (new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), x$1 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); + } else if (_1 === (4)) { + $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); + return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), x$5 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); + } else if (_1 === (8)) { + $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); + return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$15 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); + } else { + $panic(new $String("syscall: readInt with unsupported size")); + } + }; + readIntLE = function(b, size) { + var _1, b, size, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + _1 = size; + if (_1 === (1)) { + return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); + } else if (_1 === (2)) { + $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); + return (x = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$1 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); + } else if (_1 === (4)) { + $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); + return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$5 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); + } else if (_1 === (8)) { + $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); + return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$15 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); + } else { + $panic(new $String("syscall: readInt with unsupported size")); + } + }; + File.ptr.prototype.Readdir = function(n) { + var {_r$3, _tuple, err, f, infos, n, $s, $r, $c} = $restore(this, {n}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + if (f === ptrType$2.nil) { + $s = -1; return [sliceType$8.nil, $pkg.ErrInvalid]; + } + _r$3 = f.readdir(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + infos = _tuple[2]; + err = _tuple[3]; + if (infos === sliceType$8.nil) { + infos = new sliceType$8([]); + } + $s = -1; return [infos, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Readdir, $c: true, $r, _r$3, _tuple, err, f, infos, n, $s};return $f; + }; + File.prototype.Readdir = function(n) { return this.$val.Readdir(n); }; + File.ptr.prototype.Readdirnames = function(n) { + var {_r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, f, n, names, $s, $r, $c} = $restore(this, {n}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + names = sliceType.nil; + err = $ifaceNil; + f = this; + if (f === ptrType$2.nil) { + _tmp = sliceType.nil; + _tmp$1 = $pkg.ErrInvalid; + names = _tmp; + err = _tmp$1; + $s = -1; return [names, err]; + } + _r$3 = f.readdir(n, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + names = _tuple[0]; + err = _tuple[3]; + if (names === sliceType.nil) { + names = new sliceType([]); + } + _tmp$2 = names; + _tmp$3 = err; + names = _tmp$2; + err = _tmp$3; + $s = -1; return [names, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.Readdirnames, $c: true, $r, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, f, n, names, $s};return $f; + }; + File.prototype.Readdirnames = function(n) { return this.$val.Readdirnames(n); }; + File.ptr.prototype.ReadDir = function(n) { + var {_r$3, _tuple, dirents, err, f, n, $s, $r, $c} = $restore(this, {n}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + f = this; + if (f === ptrType$2.nil) { + $s = -1; return [sliceType$7.nil, $pkg.ErrInvalid]; + } + _r$3 = f.readdir(n, 1); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + dirents = _tuple[1]; + err = _tuple[3]; + if (dirents === sliceType$7.nil) { + dirents = new sliceType$7([]); + } + $s = -1; return [dirents, err]; + /* */ } return; } var $f = {$blk: File.ptr.prototype.ReadDir, $c: true, $r, _r$3, _tuple, dirents, err, f, n, $s};return $f; + }; + File.prototype.ReadDir = function(n) { return this.$val.ReadDir(n); }; + ptrType$1.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [fs.FileMode], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}]; + ptrType$2.methods = [{prop: "Stat", name: "Stat", pkg: "", typ: $funcType([], [fs.FileInfo, $error], false)}, {prop: "readFrom", name: "readFrom", pkg: "os", typ: $funcType([io.Reader], [$Int64, $Bool, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "Fd", name: "Fd", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "seek", name: "seek", pkg: "os", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "read", name: "read", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pread", name: "pread", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pwrite", name: "pwrite", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "chmod", name: "chmod", pkg: "os", typ: $funcType([fs.FileMode], [$error], false)}, {prop: "Chown", name: "Chown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "Sync", name: "Sync", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "setDeadline", name: "setDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setReadDeadline", name: "setReadDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setWriteDeadline", name: "setWriteDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "checkValid", name: "checkValid", pkg: "os", typ: $funcType([$String], [$error], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteAt", name: "WriteAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "wrapErr", name: "wrapErr", pkg: "os", typ: $funcType([$String, $error], [$error], false)}, {prop: "Chmod", name: "Chmod", pkg: "", typ: $funcType([fs.FileMode], [$error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SyscallConn", name: "SyscallConn", pkg: "", typ: $funcType([], [syscall.RawConn, $error], false)}, {prop: "readdir", name: "readdir", pkg: "os", typ: $funcType([$Int, readdirMode], [sliceType, sliceType$7, sliceType$8, $error], false)}, {prop: "Readdir", name: "Readdir", pkg: "", typ: $funcType([$Int], [sliceType$8, $error], false)}, {prop: "Readdirnames", name: "Readdirnames", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "ReadDir", name: "ReadDir", pkg: "", typ: $funcType([$Int], [sliceType$7, $error], false)}]; + ptrType$19.methods = [{prop: "Control", name: "Control", pkg: "", typ: $funcType([funcType$2], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([funcType$3], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([funcType$3], [$error], false)}]; + ptrType$9.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [$error], false)}]; + ptrType$20.methods = [{prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [fs.FileMode], false)}, {prop: "Info", name: "Info", pkg: "", typ: $funcType([], [fs.FileInfo, $error], false)}]; + ptrType$17.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; + ptrType$18.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; + ptrType$8.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [], false)}]; + fileStat.init("os", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "mode", name: "mode", embedded: false, exported: false, typ: fs.FileMode, tag: ""}, {prop: "modTime", name: "modTime", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "sys", name: "sys", embedded: false, exported: false, typ: syscall.Stat_t, tag: ""}]); + File.init("os", [{prop: "file", name: "file", embedded: true, exported: false, typ: ptrType$9, tag: ""}]); + rawConn.init("os", [{prop: "file", name: "file", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); + file.init("os", [{prop: "pfd", name: "pfd", embedded: false, exported: false, typ: poll.FD, tag: ""}, {prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "dirinfo", name: "dirinfo", embedded: false, exported: false, typ: ptrType$8, tag: ""}, {prop: "nonblock", name: "nonblock", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "stdoutOrErr", name: "stdoutOrErr", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "appendMode", name: "appendMode", embedded: false, exported: false, typ: $Bool, tag: ""}]); + unixDirent.init("os", [{prop: "parent", name: "parent", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: fs.FileMode, tag: ""}, {prop: "info", name: "info", embedded: false, exported: false, typ: fs.FileInfo, tag: ""}]); + LinkError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Old", name: "Old", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); + onlyWriter.init("", [{prop: "Writer", name: "Writer", embedded: true, exported: true, typ: io.Writer, tag: ""}]); + timeout.init([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); + SyscallError.init("", [{prop: "Syscall", name: "Syscall", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); + dirInfo.init("os", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "nbuf", name: "nbuf", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bufp", name: "bufp", embedded: false, exported: false, typ: $Int, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = itoa.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = oserror.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = poll.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = execenv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unix.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = testlog.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unsafeheader.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = fs.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sort.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = atomic.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = syscall.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.Args = sliceType.nil; + testingForceReadDirLstat = false; + errPatternHasSeparator = errors.New("pattern contains path separator"); + errWriteAtInAppendMode = errors.New("os: invalid use of WriteAt on file opened with O_APPEND"); + lstat = Lstat; + $pkg.ErrProcessDone = errors.New("os: process already finished"); + $pkg.ErrInvalid = fs.ErrInvalid; + $pkg.ErrNotExist = fs.ErrNotExist; + $pkg.ErrClosed = fs.ErrClosed; + $pkg.ErrNoDeadline = errNoDeadline(); + $pkg.ErrDeadlineExceeded = errDeadlineExceeded(); + dirBufPool = new sync.Pool.ptr(sliceType$1.nil, (function() { + var buf, buf$24ptr; + buf = $makeSlice(sliceType$2, 8192); + return (buf$24ptr || (buf$24ptr = new ptrType(function() { return buf; }, function($v) { buf = $convertSliceType($v, sliceType$2); }))); + })); + _r = NewFile(0, "/dev/stdin"); /* */ $s = 18; case 18: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $pkg.Stdin = _r; + _r$1 = NewFile(1, "/dev/stdout"); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $pkg.Stdout = _r$1; + _r$2 = NewFile(2, "/dev/stderr"); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $pkg.Stderr = _r$2; + init(); + init$1(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["fmt"] = (function() { - var $pkg = {}, $init, errors, io, math, os, reflect, strconv, sync, utf8, fmtFlags, fmt, State, Formatter, Stringer, GoStringer, buffer, pp, scanError, ss, ssave, sliceType, ptrType, ptrType$1, arrayType, arrayType$1, sliceType$1, sliceType$2, arrayType$2, ptrType$2, ptrType$5, ptrType$25, funcType, ppFree, space, ssFree, complexError, boolError, newPrinter, Sprintf, Errorf, getField, tooLarge, parsenum, intFromArg, parseArgNumber, isSpace, notSpace, indexRune; + var $pkg = {}, $init, errors, fmtsort, io, math, os, reflect, strconv, sync, utf8, scanError, ss, ssave, State, Formatter, Stringer, GoStringer, buffer, pp, fmtFlags, fmt, wrapError, arrayType, sliceType, sliceType$1, ptrType, ptrType$1, arrayType$1, sliceType$2, ptrType$4, ptrType$24, arrayType$3, funcType, ptrType$26, ptrType$27, space, ssFree, complexError, boolError, ppFree, isSpace, notSpace, indexRune, newPrinter, Sprintf, getField, tooLarge, parsenum, intFromArg, parseArgNumber, Errorf; errors = $packages["errors"]; + fmtsort = $packages["internal/fmtsort"]; io = $packages["io"]; math = $packages["math"]; os = $packages["os"]; @@ -17124,73 +24685,6 @@ $packages["fmt"] = (function() { strconv = $packages["strconv"]; sync = $packages["sync"]; utf8 = $packages["unicode/utf8"]; - fmtFlags = $pkg.fmtFlags = $newType(0, $kindStruct, "fmt.fmtFlags", true, "fmt", false, function(widPresent_, precPresent_, minus_, plus_, sharp_, space_, zero_, plusV_, sharpV_) { - this.$val = this; - if (arguments.length === 0) { - this.widPresent = false; - this.precPresent = false; - this.minus = false; - this.plus = false; - this.sharp = false; - this.space = false; - this.zero = false; - this.plusV = false; - this.sharpV = false; - return; - } - this.widPresent = widPresent_; - this.precPresent = precPresent_; - this.minus = minus_; - this.plus = plus_; - this.sharp = sharp_; - this.space = space_; - this.zero = zero_; - this.plusV = plusV_; - this.sharpV = sharpV_; - }); - fmt = $pkg.fmt = $newType(0, $kindStruct, "fmt.fmt", true, "fmt", false, function(buf_, fmtFlags_, wid_, prec_, intbuf_) { - this.$val = this; - if (arguments.length === 0) { - this.buf = ptrType$1.nil; - this.fmtFlags = new fmtFlags.ptr(false, false, false, false, false, false, false, false, false); - this.wid = 0; - this.prec = 0; - this.intbuf = arrayType.zero(); - return; - } - this.buf = buf_; - this.fmtFlags = fmtFlags_; - this.wid = wid_; - this.prec = prec_; - this.intbuf = intbuf_; - }); - State = $pkg.State = $newType(8, $kindInterface, "fmt.State", true, "fmt", true, null); - Formatter = $pkg.Formatter = $newType(8, $kindInterface, "fmt.Formatter", true, "fmt", true, null); - Stringer = $pkg.Stringer = $newType(8, $kindInterface, "fmt.Stringer", true, "fmt", true, null); - GoStringer = $pkg.GoStringer = $newType(8, $kindInterface, "fmt.GoStringer", true, "fmt", true, null); - buffer = $pkg.buffer = $newType(12, $kindSlice, "fmt.buffer", true, "fmt", false, null); - pp = $pkg.pp = $newType(0, $kindStruct, "fmt.pp", true, "fmt", false, function(buf_, arg_, value_, fmt_, reordered_, goodArgNum_, panicking_, erroring_) { - this.$val = this; - if (arguments.length === 0) { - this.buf = buffer.nil; - this.arg = $ifaceNil; - this.value = new reflect.Value.ptr(ptrType.nil, 0, 0); - this.fmt = new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType.zero()); - this.reordered = false; - this.goodArgNum = false; - this.panicking = false; - this.erroring = false; - return; - } - this.buf = buf_; - this.arg = arg_; - this.value = value_; - this.fmt = fmt_; - this.reordered = reordered_; - this.goodArgNum = goodArgNum_; - this.panicking = panicking_; - this.erroring = erroring_; - }); scanError = $pkg.scanError = $newType(0, $kindStruct, "fmt.scanError", true, "fmt", false, function(err_) { this.$val = this; if (arguments.length === 0) { @@ -17233,485 +24727,392 @@ $packages["fmt"] = (function() { this.limit = limit_; this.maxWid = maxWid_; }); - sliceType = $sliceType($emptyInterface); - ptrType = $ptrType(reflect.rtype); - ptrType$1 = $ptrType(buffer); - arrayType = $arrayType($Uint8, 68); - arrayType$1 = $arrayType($Uint16, 2); - sliceType$1 = $sliceType(arrayType$1); - sliceType$2 = $sliceType($Uint8); - arrayType$2 = $arrayType($Uint8, 5); - ptrType$2 = $ptrType(pp); - ptrType$5 = $ptrType(ss); - ptrType$25 = $ptrType(fmt); - funcType = $funcType([$Int32], [$Bool], false); - fmt.ptr.prototype.clearflags = function() { - var f; - f = this; - fmtFlags.copy(f.fmtFlags, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false)); - }; - fmt.prototype.clearflags = function() { return this.$val.clearflags(); }; - fmt.ptr.prototype.init = function(buf) { - var buf, f; - f = this; - f.buf = buf; - f.clearflags(); - }; - fmt.prototype.init = function(buf) { return this.$val.init(buf); }; - fmt.ptr.prototype.writePadding = function(n) { - var _i, _ref, buf, f, i, n, newLen, oldLen, padByte, padding; - f = this; - if (n <= 0) { + State = $pkg.State = $newType(8, $kindInterface, "fmt.State", true, "fmt", true, null); + Formatter = $pkg.Formatter = $newType(8, $kindInterface, "fmt.Formatter", true, "fmt", true, null); + Stringer = $pkg.Stringer = $newType(8, $kindInterface, "fmt.Stringer", true, "fmt", true, null); + GoStringer = $pkg.GoStringer = $newType(8, $kindInterface, "fmt.GoStringer", true, "fmt", true, null); + buffer = $pkg.buffer = $newType(12, $kindSlice, "fmt.buffer", true, "fmt", false, null); + pp = $pkg.pp = $newType(0, $kindStruct, "fmt.pp", true, "fmt", false, function(buf_, arg_, value_, fmt_, reordered_, goodArgNum_, panicking_, erroring_, wrapErrs_, wrappedErr_) { + this.$val = this; + if (arguments.length === 0) { + this.buf = buffer.nil; + this.arg = $ifaceNil; + this.value = new reflect.Value.ptr(ptrType.nil, 0, 0); + this.fmt = new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType$1.zero()); + this.reordered = false; + this.goodArgNum = false; + this.panicking = false; + this.erroring = false; + this.wrapErrs = false; + this.wrappedErr = $ifaceNil; return; } - buf = f.buf.$get(); - oldLen = buf.$length; - newLen = oldLen + n >> 0; - if (newLen > buf.$capacity) { - buf = $makeSlice(buffer, (($imul(buf.$capacity, 2)) + n >> 0)); - $copySlice(buf, f.buf.$get()); + this.buf = buf_; + this.arg = arg_; + this.value = value_; + this.fmt = fmt_; + this.reordered = reordered_; + this.goodArgNum = goodArgNum_; + this.panicking = panicking_; + this.erroring = erroring_; + this.wrapErrs = wrapErrs_; + this.wrappedErr = wrappedErr_; + }); + fmtFlags = $pkg.fmtFlags = $newType(0, $kindStruct, "fmt.fmtFlags", true, "fmt", false, function(widPresent_, precPresent_, minus_, plus_, sharp_, space_, zero_, plusV_, sharpV_) { + this.$val = this; + if (arguments.length === 0) { + this.widPresent = false; + this.precPresent = false; + this.minus = false; + this.plus = false; + this.sharp = false; + this.space = false; + this.zero = false; + this.plusV = false; + this.sharpV = false; + return; } - padByte = 32; - if (f.fmtFlags.zero) { - padByte = 48; + this.widPresent = widPresent_; + this.precPresent = precPresent_; + this.minus = minus_; + this.plus = plus_; + this.sharp = sharp_; + this.space = space_; + this.zero = zero_; + this.plusV = plusV_; + this.sharpV = sharpV_; + }); + fmt = $pkg.fmt = $newType(0, $kindStruct, "fmt.fmt", true, "fmt", false, function(buf_, fmtFlags_, wid_, prec_, intbuf_) { + this.$val = this; + if (arguments.length === 0) { + this.buf = ptrType$1.nil; + this.fmtFlags = new fmtFlags.ptr(false, false, false, false, false, false, false, false, false); + this.wid = 0; + this.prec = 0; + this.intbuf = arrayType$1.zero(); + return; } - padding = $subslice(buf, oldLen, newLen); - _ref = padding; + this.buf = buf_; + this.fmtFlags = fmtFlags_; + this.wid = wid_; + this.prec = prec_; + this.intbuf = intbuf_; + }); + wrapError = $pkg.wrapError = $newType(0, $kindStruct, "fmt.wrapError", true, "fmt", false, function(msg_, err_) { + this.$val = this; + if (arguments.length === 0) { + this.msg = ""; + this.err = $ifaceNil; + return; + } + this.msg = msg_; + this.err = err_; + }); + arrayType = $arrayType($Uint16, 2); + sliceType = $sliceType(arrayType); + sliceType$1 = $sliceType($emptyInterface); + ptrType = $ptrType(reflect.rtype); + ptrType$1 = $ptrType(buffer); + arrayType$1 = $arrayType($Uint8, 68); + sliceType$2 = $sliceType($Uint8); + ptrType$4 = $ptrType(ss); + ptrType$24 = $ptrType(pp); + arrayType$3 = $arrayType($Uint8, 6); + funcType = $funcType([$Int32], [$Bool], false); + ptrType$26 = $ptrType(fmt); + ptrType$27 = $ptrType(wrapError); + ss.ptr.prototype.Read = function(buf) { + var _tmp, _tmp$1, buf, err, n, s; + n = 0; + err = $ifaceNil; + s = this; + _tmp = 0; + _tmp$1 = errors.New("ScanState's Read should not be called. Use ReadRune"); + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + ss.prototype.Read = function(buf) { return this.$val.Read(buf); }; + ss.ptr.prototype.ReadRune = function() { + var {_r, _tuple, err, r, s, size, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + r = 0; + size = 0; + err = $ifaceNil; + s = this; + if (s.atEOF || s.count >= s.ssave.argLimit) { + err = io.EOF; + $s = -1; return [r, size, err]; + } + _r = s.rs.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + r = _tuple[0]; + size = _tuple[1]; + err = _tuple[2]; + if ($interfaceIsEqual(err, $ifaceNil)) { + s.count = s.count + (1) >> 0; + if (s.ssave.nlIsEnd && (r === 10)) { + s.atEOF = true; + } + } else if ($interfaceIsEqual(err, io.EOF)) { + s.atEOF = true; + } + $s = -1; return [r, size, err]; + /* */ } return; } var $f = {$blk: ss.ptr.prototype.ReadRune, $c: true, $r, _r, _tuple, err, r, s, size, $s};return $f; + }; + ss.prototype.ReadRune = function() { return this.$val.ReadRune(); }; + ss.ptr.prototype.Width = function() { + var _tmp, _tmp$1, _tmp$2, _tmp$3, ok, s, wid; + wid = 0; + ok = false; + s = this; + if (s.ssave.maxWid === 1073741824) { + _tmp = 0; + _tmp$1 = false; + wid = _tmp; + ok = _tmp$1; + return [wid, ok]; + } + _tmp$2 = s.ssave.maxWid; + _tmp$3 = true; + wid = _tmp$2; + ok = _tmp$3; + return [wid, ok]; + }; + ss.prototype.Width = function() { return this.$val.Width(); }; + ss.ptr.prototype.getRune = function() { + var {_r, _tuple, err, r, s, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + r = 0; + s = this; + _r = s.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + r = _tuple[0]; + err = _tuple[2]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + if ($interfaceIsEqual(err, io.EOF)) { + r = -1; + $s = -1; return r; + } + s.error(err); + } + $s = -1; return r; + /* */ } return; } var $f = {$blk: ss.ptr.prototype.getRune, $c: true, $r, _r, _tuple, err, r, s, $s};return $f; + }; + ss.prototype.getRune = function() { return this.$val.getRune(); }; + ss.ptr.prototype.UnreadRune = function() { + var {_r, s, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + s = this; + _r = s.rs.UnreadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r; + s.atEOF = false; + s.count = s.count - (1) >> 0; + $s = -1; return $ifaceNil; + /* */ } return; } var $f = {$blk: ss.ptr.prototype.UnreadRune, $c: true, $r, _r, s, $s};return $f; + }; + ss.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; + ss.ptr.prototype.error = function(err) { + var err, s, x; + s = this; + $panic((x = new scanError.ptr(err), new x.constructor.elem(x))); + }; + ss.prototype.error = function(err) { return this.$val.error(err); }; + ss.ptr.prototype.errorString = function(err) { + var err, s, x; + s = this; + $panic((x = new scanError.ptr(errors.New(err)), new x.constructor.elem(x))); + }; + ss.prototype.errorString = function(err) { return this.$val.errorString(err); }; + ss.ptr.prototype.Token = function(skipSpace, f) { + var {$24r, _r, err, f, s, skipSpace, tok, $s, $deferred, $r, $c} = $restore(this, {skipSpace, f}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); + err = [err]; + tok = sliceType$2.nil; + err[0] = $ifaceNil; + s = this; + $deferred.push([(function(err) { return function() { + var _tuple, e, ok, se; + e = $recover(); + if (!($interfaceIsEqual(e, $ifaceNil))) { + _tuple = $assertType(e, scanError, true); + se = $clone(_tuple[0], scanError); + ok = _tuple[1]; + if (ok) { + err[0] = se.err; + } else { + $panic(e); + } + } + }; })(err), []]); + if (f === $throwNilPointerError) { + f = notSpace; + } + s.buf = $subslice(s.buf, 0, 0); + _r = s.token(skipSpace, f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + tok = _r; + $24r = [tok, err[0]]; + $s = 2; case 2: return $24r; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [tok, err[0]]; } if($curGoroutine.asleep) { var $f = {$blk: ss.ptr.prototype.Token, $c: true, $r, $24r, _r, err, f, s, skipSpace, tok, $s, $deferred};return $f; } } + }; + ss.prototype.Token = function(skipSpace, f) { return this.$val.Token(skipSpace, f); }; + isSpace = function(r) { + var _i, _ref, r, rng, rx; + if (r >= 65536) { + return false; + } + rx = ((r << 16 >>> 16)); + _ref = space; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } - i = _i; - ((i < 0 || i >= padding.$length) ? ($throwRuntimeError("index out of range"), undefined) : padding.$array[padding.$offset + i] = padByte); + rng = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), arrayType); + if (rx < rng[0]) { + return false; + } + if (rx <= rng[1]) { + return true; + } _i++; } - f.buf.$set($subslice(buf, 0, newLen)); + return false; }; - fmt.prototype.writePadding = function(n) { return this.$val.writePadding(n); }; - fmt.ptr.prototype.pad = function(b) { - var b, f, width; - f = this; - if (!f.fmtFlags.widPresent || (f.wid === 0)) { - f.buf.Write(b); + notSpace = function(r) { + var r; + return !isSpace(r); + }; + ss.ptr.prototype.free = function(old) { + var old, s; + s = this; + if (old.validSave) { + ssave.copy(s.ssave, old); return; } - width = f.wid - utf8.RuneCount(b) >> 0; - if (!f.fmtFlags.minus) { - f.writePadding(width); - f.buf.Write(b); - } else { - f.buf.Write(b); - f.writePadding(width); - } - }; - fmt.prototype.pad = function(b) { return this.$val.pad(b); }; - fmt.ptr.prototype.padString = function(s) { - var f, s, width; - f = this; - if (!f.fmtFlags.widPresent || (f.wid === 0)) { - f.buf.WriteString(s); + if (s.buf.$capacity > 1024) { return; } - width = f.wid - utf8.RuneCountInString(s) >> 0; - if (!f.fmtFlags.minus) { - f.writePadding(width); - f.buf.WriteString(s); - } else { - f.buf.WriteString(s); - f.writePadding(width); - } + s.buf = $subslice(s.buf, 0, 0); + s.rs = $ifaceNil; + ssFree.Put(s); }; - fmt.prototype.padString = function(s) { return this.$val.padString(s); }; - fmt.ptr.prototype.fmtBoolean = function(v) { - var f, v; - f = this; - if (v) { - f.padString("true"); - } else { - f.padString("false"); - } - }; - fmt.prototype.fmtBoolean = function(v) { return this.$val.fmtBoolean(v); }; - fmt.ptr.prototype.fmtUnicode = function(u) { - var buf, f, i, oldZero, prec, u, width; - f = this; - buf = $subslice(new sliceType$2(f.intbuf), 0); - prec = 4; - if (f.fmtFlags.precPresent && f.prec > 4) { - prec = f.prec; - width = (((2 + prec >> 0) + 2 >> 0) + 4 >> 0) + 1 >> 0; - if (width > buf.$length) { - buf = $makeSlice(sliceType$2, width); + ss.prototype.free = function(old) { return this.$val.free(old); }; + ss.ptr.prototype.SkipSpace = function() { + var {_r, _r$1, _r$2, _v, r, s, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + s = this; + /* while (true) { */ case 1: + _r = s.getRune(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + r = _r; + if (r === -1) { + $s = -1; return; } - } - i = buf.$length; - if (f.fmtFlags.sharp && (u.$high < 0 || (u.$high === 0 && u.$low <= 1114111)) && strconv.IsPrint(((u.$low >> 0)))) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); - i = i - (utf8.RuneLen(((u.$low >> 0)))) >> 0; - utf8.EncodeRune($subslice(buf, i), ((u.$low >> 0))); - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 32); - } + if (!(r === 13)) { _v = false; $s = 6; continue s; } + _r$1 = s.peek("\n"); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = _r$1; case 6: + /* */ if (_v) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_v) { */ case 4: + /* continue; */ $s = 1; continue; + /* } */ case 5: + if (r === 10) { + if (s.ssave.nlIsSpace) { + /* continue; */ $s = 1; continue; + } + s.errorString("unexpected newline"); + $s = -1; return; + } + /* */ if (!isSpace(r)) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (!isSpace(r)) { */ case 8: + _r$2 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$2; + /* break; */ $s = 2; continue; + /* } */ case 9: + $s = 1; continue; + case 2: + $s = -1; return; + /* */ } return; } var $f = {$blk: ss.ptr.prototype.SkipSpace, $c: true, $r, _r, _r$1, _r$2, _v, r, s, $s};return $f; + }; + ss.prototype.SkipSpace = function() { return this.$val.SkipSpace(); }; + ss.ptr.prototype.token = function(skipSpace, f) { + var {_r, _r$1, _r$2, f, r, s, skipSpace, $s, $r, $c} = $restore(this, {skipSpace, f}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + s = this; + /* */ if (skipSpace) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (skipSpace) { */ case 1: + $r = s.SkipSpace(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + /* while (true) { */ case 4: + _r = s.getRune(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + r = _r; + if (r === -1) { + /* break; */ $s = 5; continue; + } + _r$1 = f(r); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (!_r$1) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!_r$1) { */ case 7: + _r$2 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$2; + /* break; */ $s = 5; continue; + /* } */ case 8: + (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).writeRune(r); + $s = 4; continue; + case 5: + $s = -1; return $convertSliceType(s.buf, sliceType$2); + /* */ } return; } var $f = {$blk: ss.ptr.prototype.token, $c: true, $r, _r, _r$1, _r$2, f, r, s, skipSpace, $s};return $f; + }; + ss.prototype.token = function(skipSpace, f) { return this.$val.token(skipSpace, f); }; + indexRune = function(s, r) { + var _i, _ref, _rune, c, i, r, s; + _ref = s; + _i = 0; while (true) { - if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); - prec = prec - (1) >> 0; - u = $shiftRightUint64(u, (4)); + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + c = _rune[0]; + if (c === r) { + return i; + } + _i += _rune[1]; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(u))); - prec = prec - (1) >> 0; - while (true) { - if (!(prec > 0)) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); - prec = prec - (1) >> 0; - } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 43); - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 85); - oldZero = f.fmtFlags.zero; - f.fmtFlags.zero = false; - f.pad($subslice(buf, i)); - f.fmtFlags.zero = oldZero; + return -1; }; - fmt.prototype.fmtUnicode = function(u) { return this.$val.fmtUnicode(u); }; - fmt.ptr.prototype.fmtInteger = function(u, base, isSigned, digits) { - var _1, _2, base, buf, digits, f, i, isSigned, negative, next, oldZero, oldZero$1, prec, u, width, x, x$1, x$2, x$3, x$4; - f = this; - negative = isSigned && (x = (new $Int64(u.$high, u.$low)), (x.$high < 0 || (x.$high === 0 && x.$low < 0))); - if (negative) { - u = new $Uint64(-u.$high, -u.$low); - } - buf = $subslice(new sliceType$2(f.intbuf), 0); - if (f.fmtFlags.widPresent || f.fmtFlags.precPresent) { - width = (3 + f.wid >> 0) + f.prec >> 0; - if (width > buf.$length) { - buf = $makeSlice(sliceType$2, width); - } - } - prec = 0; - if (f.fmtFlags.precPresent) { - prec = f.prec; - if ((prec === 0) && (u.$high === 0 && u.$low === 0)) { - oldZero = f.fmtFlags.zero; - f.fmtFlags.zero = false; - f.writePadding(f.wid); - f.fmtFlags.zero = oldZero; - return; - } - } else if (f.fmtFlags.zero && f.fmtFlags.widPresent) { - prec = f.wid; - if (negative || f.fmtFlags.plus || f.fmtFlags.space) { - prec = prec - (1) >> 0; - } - } - i = buf.$length; - _1 = base; - if (_1 === (10)) { - while (true) { - if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 10)))) { break; } - i = i - (1) >> 0; - next = $div64(u, new $Uint64(0, 10), false); - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$1 = new $Uint64(0 + u.$high, 48 + u.$low), x$2 = $mul64(next, new $Uint64(0, 10)), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)).$low << 24 >>> 24))); - u = next; - } - } else if (_1 === (16)) { - while (true) { - if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); - u = $shiftRightUint64(u, (4)); - } - } else if (_1 === (8)) { - while (true) { - if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 8)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$3 = new $Uint64(u.$high & 0, (u.$low & 7) >>> 0), new $Uint64(0 + x$3.$high, 48 + x$3.$low)).$low << 24 >>> 24))); - u = $shiftRightUint64(u, (3)); - } - } else if (_1 === (2)) { - while (true) { - if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 2)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$4 = new $Uint64(u.$high & 0, (u.$low & 1) >>> 0), new $Uint64(0 + x$4.$high, 48 + x$4.$low)).$low << 24 >>> 24))); - u = $shiftRightUint64(u, (1)); - } - } else { - $panic(new $String("fmt: unknown base; can't happen")); - } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(u))); - while (true) { - if (!(i > 0 && prec > (buf.$length - i >> 0))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); - } - if (f.fmtFlags.sharp) { - _2 = base; - if (_2 === (8)) { - if (!((((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i]) === 48))) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); - } - } else if (_2 === (16)) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt(16)); - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); - } - } - if (negative) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 45); - } else if (f.fmtFlags.plus) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 43); - } else if (f.fmtFlags.space) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 32); - } - oldZero$1 = f.fmtFlags.zero; - f.fmtFlags.zero = false; - f.pad($subslice(buf, i)); - f.fmtFlags.zero = oldZero$1; + ss.ptr.prototype.peek = function(ok) { + var {_r, _r$1, ok, r, s, $s, $r, $c} = $restore(this, {ok}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + s = this; + _r = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + r = _r; + /* */ if (!((r === -1))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((r === -1))) { */ case 2: + _r$1 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + /* } */ case 3: + $s = -1; return indexRune(ok, r) >= 0; + /* */ } return; } var $f = {$blk: ss.ptr.prototype.peek, $c: true, $r, _r, _r$1, ok, r, s, $s};return $f; }; - fmt.prototype.fmtInteger = function(u, base, isSigned, digits) { return this.$val.fmtInteger(u, base, isSigned, digits); }; - fmt.ptr.prototype.truncate = function(s) { - var _i, _ref, _rune, f, i, n, s; - f = this; - if (f.fmtFlags.precPresent) { - n = f.prec; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - i = _i; - n = n - (1) >> 0; - if (n < 0) { - return $substring(s, 0, i); - } - _i += _rune[1]; - } - } - return s; - }; - fmt.prototype.truncate = function(s) { return this.$val.truncate(s); }; - fmt.ptr.prototype.fmtS = function(s) { - var f, s; - f = this; - s = f.truncate(s); - f.padString(s); - }; - fmt.prototype.fmtS = function(s) { return this.$val.fmtS(s); }; - fmt.ptr.prototype.fmtSbx = function(s, b, digits) { - var b, buf, c, digits, f, i, length, s, width; - f = this; - length = b.$length; - if (b === sliceType$2.nil) { - length = s.length; - } - if (f.fmtFlags.precPresent && f.prec < length) { - length = f.prec; - } - width = $imul(2, length); - if (width > 0) { - if (f.fmtFlags.space) { - if (f.fmtFlags.sharp) { - width = $imul(width, (2)); - } - width = width + ((length - 1 >> 0)) >> 0; - } else if (f.fmtFlags.sharp) { - width = width + (2) >> 0; - } - } else { - if (f.fmtFlags.widPresent) { - f.writePadding(f.wid); - } - return; - } - if (f.fmtFlags.widPresent && f.wid > width && !f.fmtFlags.minus) { - f.writePadding(f.wid - width >> 0); - } - buf = f.buf.$get(); - if (f.fmtFlags.sharp) { - buf = $append(buf, 48, digits.charCodeAt(16)); - } - c = 0; - i = 0; - while (true) { - if (!(i < length)) { break; } - if (f.fmtFlags.space && i > 0) { - buf = $append(buf, 32); - if (f.fmtFlags.sharp) { - buf = $append(buf, 48, digits.charCodeAt(16)); - } - } - if (!(b === sliceType$2.nil)) { - c = ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]); - } else { - c = s.charCodeAt(i); - } - buf = $append(buf, digits.charCodeAt((c >>> 4 << 24 >>> 24)), digits.charCodeAt(((c & 15) >>> 0))); - i = i + (1) >> 0; - } - f.buf.$set(buf); - if (f.fmtFlags.widPresent && f.wid > width && f.fmtFlags.minus) { - f.writePadding(f.wid - width >> 0); - } - }; - fmt.prototype.fmtSbx = function(s, b, digits) { return this.$val.fmtSbx(s, b, digits); }; - fmt.ptr.prototype.fmtSx = function(s, digits) { - var digits, f, s; - f = this; - f.fmtSbx(s, sliceType$2.nil, digits); - }; - fmt.prototype.fmtSx = function(s, digits) { return this.$val.fmtSx(s, digits); }; - fmt.ptr.prototype.fmtBx = function(b, digits) { - var b, digits, f; - f = this; - f.fmtSbx("", b, digits); - }; - fmt.prototype.fmtBx = function(b, digits) { return this.$val.fmtBx(b, digits); }; - fmt.ptr.prototype.fmtQ = function(s) { - var buf, f, s; - f = this; - s = f.truncate(s); - if (f.fmtFlags.sharp && strconv.CanBackquote(s)) { - f.padString("`" + s + "`"); - return; - } - buf = $subslice(new sliceType$2(f.intbuf), 0, 0); - if (f.fmtFlags.plus) { - f.pad(strconv.AppendQuoteToASCII(buf, s)); - } else { - f.pad(strconv.AppendQuote(buf, s)); - } - }; - fmt.prototype.fmtQ = function(s) { return this.$val.fmtQ(s); }; - fmt.ptr.prototype.fmtC = function(c) { - var buf, c, f, r, w; - f = this; - r = ((c.$low >> 0)); - if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { - r = 65533; - } - buf = $subslice(new sliceType$2(f.intbuf), 0, 0); - w = utf8.EncodeRune($subslice(buf, 0, 4), r); - f.pad($subslice(buf, 0, w)); - }; - fmt.prototype.fmtC = function(c) { return this.$val.fmtC(c); }; - fmt.ptr.prototype.fmtQc = function(c) { - var buf, c, f, r; - f = this; - r = ((c.$low >> 0)); - if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { - r = 65533; - } - buf = $subslice(new sliceType$2(f.intbuf), 0, 0); - if (f.fmtFlags.plus) { - f.pad(strconv.AppendQuoteRuneToASCII(buf, r)); - } else { - f.pad(strconv.AppendQuoteRune(buf, r)); - } - }; - fmt.prototype.fmtQc = function(c) { return this.$val.fmtQc(c); }; - fmt.ptr.prototype.fmtFloat = function(v, size, verb, prec) { - var _1, _2, digits, f, hasDecimalPoint, i, num, oldZero, prec, size, tail, tailBuf, v, verb; - f = this; - if (f.fmtFlags.precPresent) { - prec = f.prec; - } - num = strconv.AppendFloat($subslice(new sliceType$2(f.intbuf), 0, 1), v, ((verb << 24 >>> 24)), prec, size); - if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 45) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 43)) { - num = $subslice(num, 1); - } else { - (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 43); - } - if (f.fmtFlags.space && ((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43) && !f.fmtFlags.plus) { - (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 32); - } - if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 73) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78)) { - oldZero = f.fmtFlags.zero; - f.fmtFlags.zero = false; - if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78) && !f.fmtFlags.space && !f.fmtFlags.plus) { - num = $subslice(num, 1); - } - f.pad(num); - f.fmtFlags.zero = oldZero; - return; - } - if (f.fmtFlags.sharp && !((verb === 98))) { - digits = 0; - _1 = verb; - if ((_1 === (118)) || (_1 === (103)) || (_1 === (71))) { - digits = prec; - if (digits === -1) { - digits = 6; - } - } - tailBuf = arrayType$2.zero(); - tail = $subslice(new sliceType$2(tailBuf), 0, 0); - hasDecimalPoint = false; - i = 1; - while (true) { - if (!(i < num.$length)) { break; } - _2 = ((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]); - if (_2 === (46)) { - hasDecimalPoint = true; - } else if ((_2 === (101)) || (_2 === (69))) { - tail = $appendSlice(tail, $subslice(num, i)); - num = $subslice(num, 0, i); - } else { - digits = digits - (1) >> 0; - } - i = i + (1) >> 0; - } - if (!hasDecimalPoint) { - num = $append(num, 46); - } - while (true) { - if (!(digits > 0)) { break; } - num = $append(num, 48); - digits = digits - (1) >> 0; - } - num = $appendSlice(num, tail); - } - if (f.fmtFlags.plus || !(((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43))) { - if (f.fmtFlags.zero && f.fmtFlags.widPresent && f.wid > num.$length) { - f.buf.WriteByte((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0])); - f.writePadding(f.wid - num.$length >> 0); - f.buf.Write($subslice(num, 1)); - return; - } - f.pad(num); - return; - } - f.pad($subslice(num, 1)); - }; - fmt.prototype.fmtFloat = function(v, size, verb, prec) { return this.$val.fmtFloat(v, size, verb, prec); }; - $ptrType(buffer).prototype.Write = function(p) { + ss.prototype.peek = function(ok) { return this.$val.peek(ok); }; + $ptrType(buffer).prototype.write = function(p) { var b, p; b = this; b.$set($appendSlice(b.$get(), p)); }; - $ptrType(buffer).prototype.WriteString = function(s) { + $ptrType(buffer).prototype.writeString = function(s) { var b, s; b = this; b.$set($appendSlice(b.$get(), s)); }; - $ptrType(buffer).prototype.WriteByte = function(c) { + $ptrType(buffer).prototype.writeByte = function(c) { var b, c; b = this; b.$set($append(b.$get(), c)); }; - $ptrType(buffer).prototype.WriteRune = function(r) { - var b, bp, n, r, w, x; + $ptrType(buffer).prototype.writeRune = function(r) { + var b, bp, n, r, w; bp = this; if (r < 128) { bp.$set($append(bp.$get(), ((r << 24 >>> 24)))); @@ -17723,26 +25124,31 @@ $packages["fmt"] = (function() { if (!((n + 4 >> 0) > b.$capacity)) { break; } b = $append(b, 0); } - w = utf8.EncodeRune((x = $subslice(b, n, (n + 4 >> 0)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)), r); + w = utf8.EncodeRune($convertSliceType($subslice(b, n, (n + 4 >> 0)), sliceType$2), r); bp.$set($subslice(b, 0, (n + w >> 0))); }; newPrinter = function() { - var _r, p, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, p, $s, $r, $c} = $restore(this, {}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = ppFree.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - p = $assertType(_r, ptrType$2); + p = $assertType(_r, ptrType$24); p.panicking = false; p.erroring = false; + p.wrapErrs = false; p.fmt.init((p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p)))); $s = -1; return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: newPrinter }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: newPrinter, $c: true, $r, _r, p, $s};return $f; }; pp.ptr.prototype.free = function() { var p; p = this; + if (p.buf.$capacity > 65536) { + return; + } p.buf = $subslice(p.buf, 0, 0); p.arg = $ifaceNil; p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); + p.wrappedErr = $ifaceNil; ppFree.Put(p); }; pp.prototype.free = function() { return this.$val.free(); }; @@ -17793,7 +25199,7 @@ $packages["fmt"] = (function() { ret = 0; err = $ifaceNil; p = this; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(b); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).write(b); _tmp = b.$length; _tmp$1 = $ifaceNil; ret = _tmp; @@ -17806,7 +25212,7 @@ $packages["fmt"] = (function() { ret = 0; err = $ifaceNil; p = this; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(s); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(s); _tmp = s.length; _tmp$1 = $ifaceNil; ret = _tmp; @@ -17815,29 +25221,20 @@ $packages["fmt"] = (function() { }; pp.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; Sprintf = function(format, a) { - var _r, a, format, p, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; format = $f.format; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, a, format, p, s, $s, $r, $c} = $restore(this, {format, a}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s = ($bytesToString(p.buf)); p.free(); $s = -1; return s; - /* */ } return; } if ($f === undefined) { $f = { $blk: Sprintf }; } $f._r = _r; $f.a = a; $f.format = format; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: Sprintf, $c: true, $r, _r, a, format, p, s, $s};return $f; }; $pkg.Sprintf = Sprintf; - Errorf = function(format, a) { - var _r, _r$1, a, format, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; a = $f.a; format = $f.format; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = Sprintf(format, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = errors.New(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Errorf }; } $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.format = format; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Errorf = Errorf; getField = function(v, i) { - var _r, _r$1, i, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; i = $f.i; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, _r$1, i, v, val, $s, $r, $c} = $restore(this, {v, i}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = $clone(v, reflect.Value).Field(i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } val = _r; /* */ if (($clone(val, reflect.Value).Kind() === 20) && !$clone(val, reflect.Value).IsNil()) { $s = 2; continue; } @@ -17847,7 +25244,7 @@ $packages["fmt"] = (function() { val = _r$1; /* } */ case 3: $s = -1; return val; - /* */ } return; } if ($f === undefined) { $f = { $blk: getField }; } $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: getField, $c: true, $r, _r, _r$1, i, v, val, $s};return $f; }; tooLarge = function(x) { var x; @@ -17886,57 +25283,57 @@ $packages["fmt"] = (function() { return [num, isnum, newi]; }; pp.ptr.prototype.unknownType = function(v) { - var _r, p, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, p, v, $s, $r, $c} = $restore(this, {v}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; if (!$clone(v, reflect.Value).IsValid()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = -1; return; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(63); _r = $clone(v, reflect.Value).Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(63); $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.unknownType }; } $f._r = _r; $f.p = p; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.unknownType, $c: true, $r, _r, p, v, $s};return $f; }; pp.prototype.unknownType = function(v) { return this.$val.unknownType(v); }; pp.ptr.prototype.badVerb = function(verb) { - var _r, _r$1, p, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; p = $f.p; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, _r$1, p, verb, $s, $r, $c} = $restore(this, {verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; p.erroring = true; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(40); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(40); /* */ if (!($interfaceIsEqual(p.arg, $ifaceNil))) { $s = 2; continue; } /* */ if ($clone(p.value, reflect.Value).IsValid()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(p.arg, $ifaceNil))) { */ case 2: _r = reflect.TypeOf(p.arg).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(61); $r = p.printArg(p.arg, 118); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if ($clone(p.value, reflect.Value).IsValid()) { */ case 3: _r$1 = $clone(p.value, reflect.Value).Type().String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(61); $r = p.printValue($clone(p.value, reflect.Value), 118, 0); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else { */ case 4: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); /* } */ case 5: case 1: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(41); p.erroring = false; $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.badVerb }; } $f._r = _r; $f._r$1 = _r$1; $f.p = p; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.badVerb, $c: true, $r, _r, _r$1, p, verb, $s};return $f; }; pp.prototype.badVerb = function(verb) { return this.$val.badVerb(verb); }; pp.ptr.prototype.fmtBool = function(v, verb) { - var _1, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, p, v, verb, $s, $r, $c} = $restore(this, {v, verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (116)) || (_1 === (118))) { $s = 2; continue; } @@ -17949,7 +25346,7 @@ $packages["fmt"] = (function() { /* } */ case 4: case 1: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBool }; } $f._1 = _1; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.fmtBool, $c: true, $r, _1, p, v, verb, $s};return $f; }; pp.prototype.fmtBool = function(v, verb) { return this.$val.fmtBool(v, verb); }; pp.ptr.prototype.fmt0x64 = function(v, leading0x) { @@ -17957,19 +25354,19 @@ $packages["fmt"] = (function() { p = this; sharp = p.fmt.fmtFlags.sharp; p.fmt.fmtFlags.sharp = leading0x; - p.fmt.fmtInteger(v, 16, false, "0123456789abcdefx"); + p.fmt.fmtInteger(v, 16, false, 118, "0123456789abcdefx"); p.fmt.fmtFlags.sharp = sharp; }; pp.prototype.fmt0x64 = function(v, leading0x) { return this.$val.fmt0x64(v, leading0x); }; pp.ptr.prototype.fmtInteger = function(v, isSigned, verb) { - var _1, isSigned, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; isSigned = $f.isSigned; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, isSigned, p, v, verb, $s, $r, $c} = $restore(this, {v, isSigned, verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } /* */ if (_1 === (100)) { $s = 3; continue; } /* */ if (_1 === (98)) { $s = 4; continue; } - /* */ if (_1 === (111)) { $s = 5; continue; } + /* */ if ((_1 === (111)) || (_1 === (79))) { $s = 5; continue; } /* */ if (_1 === (120)) { $s = 6; continue; } /* */ if (_1 === (88)) { $s = 7; continue; } /* */ if (_1 === (99)) { $s = 8; continue; } @@ -17980,62 +25377,55 @@ $packages["fmt"] = (function() { if (p.fmt.fmtFlags.sharpV && !isSigned) { p.fmt0x64(v, true); } else { - p.fmt.fmtInteger(v, 10, isSigned, "0123456789abcdefx"); + p.fmt.fmtInteger(v, 10, isSigned, verb, "0123456789abcdefx"); } $s = 12; continue; /* } else if (_1 === (100)) { */ case 3: - p.fmt.fmtInteger(v, 10, isSigned, "0123456789abcdefx"); + p.fmt.fmtInteger(v, 10, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (98)) { */ case 4: - p.fmt.fmtInteger(v, 2, isSigned, "0123456789abcdefx"); + p.fmt.fmtInteger(v, 2, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; - /* } else if (_1 === (111)) { */ case 5: - p.fmt.fmtInteger(v, 8, isSigned, "0123456789abcdefx"); + /* } else if ((_1 === (111)) || (_1 === (79))) { */ case 5: + p.fmt.fmtInteger(v, 8, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (120)) { */ case 6: - p.fmt.fmtInteger(v, 16, isSigned, "0123456789abcdefx"); + p.fmt.fmtInteger(v, 16, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (88)) { */ case 7: - p.fmt.fmtInteger(v, 16, isSigned, "0123456789ABCDEFX"); + p.fmt.fmtInteger(v, 16, isSigned, verb, "0123456789ABCDEFX"); $s = 12; continue; /* } else if (_1 === (99)) { */ case 8: p.fmt.fmtC(v); $s = 12; continue; /* } else if (_1 === (113)) { */ case 9: - /* */ if ((v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if ((v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { */ case 13: - p.fmt.fmtQc(v); - $s = 15; continue; - /* } else { */ case 14: - $r = p.badVerb(verb); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 15: + p.fmt.fmtQc(v); $s = 12; continue; /* } else if (_1 === (85)) { */ case 10: p.fmt.fmtUnicode(v); $s = 12; continue; /* } else { */ case 11: - $r = p.badVerb(verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = p.badVerb(verb); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: case 1: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtInteger }; } $f._1 = _1; $f.isSigned = isSigned; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.fmtInteger, $c: true, $r, _1, isSigned, p, v, verb, $s};return $f; }; pp.prototype.fmtInteger = function(v, isSigned, verb) { return this.$val.fmtInteger(v, isSigned, verb); }; pp.ptr.prototype.fmtFloat = function(v, size, verb) { - var _1, p, size, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; size = $f.size; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, p, size, v, verb, $s, $r, $c} = $restore(this, {v, size, verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } - /* */ if ((_1 === (98)) || (_1 === (103)) || (_1 === (71))) { $s = 3; continue; } + /* */ if ((_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88))) { $s = 3; continue; } /* */ if ((_1 === (102)) || (_1 === (101)) || (_1 === (69))) { $s = 4; continue; } /* */ if (_1 === (70)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (118)) { */ case 2: p.fmt.fmtFloat(v, size, 103, -1); $s = 7; continue; - /* } else if ((_1 === (98)) || (_1 === (103)) || (_1 === (71))) { */ case 3: + /* } else if ((_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88))) { */ case 3: p.fmt.fmtFloat(v, size, verb, -1); $s = 7; continue; /* } else if ((_1 === (102)) || (_1 === (101)) || (_1 === (69))) { */ case 4: @@ -18049,23 +25439,23 @@ $packages["fmt"] = (function() { /* } */ case 7: case 1: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtFloat }; } $f._1 = _1; $f.p = p; $f.size = size; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.fmtFloat, $c: true, $r, _1, p, size, v, verb, $s};return $f; }; pp.prototype.fmtFloat = function(v, size, verb) { return this.$val.fmtFloat(v, size, verb); }; pp.ptr.prototype.fmtComplex = function(v, size, verb) { - var _1, _q, _q$1, oldPlus, p, size, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _q = $f._q; _q$1 = $f._q$1; oldPlus = $f.oldPlus; p = $f.p; size = $f.size; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _q, _q$1, oldPlus, p, size, v, verb, $s, $r, $c} = $restore(this, {v, size, verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; _1 = verb; - /* */ if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { $s = 2; continue; } + /* */ if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { $s = 2; continue; } /* */ $s = 3; continue; - /* if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { */ case 2: + /* if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { */ case 2: oldPlus = p.fmt.fmtFlags.plus; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(40); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(40); $r = p.fmtFloat(v.$real, (_q = size / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), verb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p.fmt.fmtFlags.plus = true; $r = p.fmtFloat(v.$imag, (_q$1 = size / 2, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("i)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("i)"); p.fmt.fmtFlags.plus = oldPlus; $s = 4; continue; /* } else { */ case 3: @@ -18073,12 +25463,12 @@ $packages["fmt"] = (function() { /* } */ case 4: case 1: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtComplex }; } $f._1 = _1; $f._q = _q; $f._q$1 = _q$1; $f.oldPlus = oldPlus; $f.p = p; $f.size = size; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.fmtComplex, $c: true, $r, _1, _q, _q$1, oldPlus, p, size, v, verb, $s};return $f; }; pp.prototype.fmtComplex = function(v, size, verb) { return this.$val.fmtComplex(v, size, verb); }; pp.ptr.prototype.fmtString = function(v, verb) { - var _1, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, p, v, verb, $s, $r, $c} = $restore(this, {v, verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } @@ -18111,12 +25501,12 @@ $packages["fmt"] = (function() { /* } */ case 8: case 1: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtString }; } $f._1 = _1; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.fmtString, $c: true, $r, _1, p, v, verb, $s};return $f; }; pp.prototype.fmtString = function(v, verb) { return this.$val.fmtString(v, verb); }; pp.ptr.prototype.fmtBytes = function(v, verb, typeString) { - var _1, _i, _i$1, _r, _ref, _ref$1, c, c$1, i, i$1, p, typeString, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; c = $f.c; c$1 = $f.c$1; i = $f.i; i$1 = $f.i$1; p = $f.p; typeString = $f.typeString; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _i, _i$1, _r, _ref, _ref$1, c, c$1, i, i$1, p, typeString, v, verb, $s, $r, $c} = $restore(this, {v, verb, typeString}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (118)) || (_1 === (100))) { $s = 2; continue; } @@ -18127,12 +25517,12 @@ $packages["fmt"] = (function() { /* */ $s = 7; continue; /* if ((_1 === (118)) || (_1 === (100))) { */ case 2: if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(typeString); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(typeString); if (v === sliceType$2.nil) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); $s = -1; return; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); _ref = v; _i = 0; while (true) { @@ -18140,14 +25530,14 @@ $packages["fmt"] = (function() { i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i > 0) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } p.fmt0x64((new $Uint64(0, c)), true); _i++; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(125); } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(91); _ref$1 = v; _i$1 = 0; while (true) { @@ -18155,16 +25545,16 @@ $packages["fmt"] = (function() { i$1 = _i$1; c$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (i$1 > 0) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(32); } - p.fmt.fmtInteger((new $Uint64(0, c$1)), 10, false, "0123456789abcdefx"); + p.fmt.fmtInteger((new $Uint64(0, c$1)), 10, false, verb, "0123456789abcdefx"); _i$1++; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(93); } $s = 8; continue; /* } else if (_1 === (115)) { */ case 3: - p.fmt.fmtS(($bytesToString(v))); + p.fmt.fmtBs(v); $s = 8; continue; /* } else if (_1 === (120)) { */ case 4: p.fmt.fmtBx(v, "0123456789abcdefx"); @@ -18181,12 +25571,12 @@ $packages["fmt"] = (function() { /* } */ case 8: case 1: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBytes }; } $f._1 = _1; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.c = c; $f.c$1 = c$1; $f.i = i; $f.i$1 = i$1; $f.p = p; $f.typeString = typeString; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.fmtBytes, $c: true, $r, _1, _i, _i$1, _r, _ref, _ref$1, c, c$1, i, i$1, p, typeString, v, verb, $s};return $f; }; pp.prototype.fmtBytes = function(v, verb, typeString) { return this.$val.fmtBytes(v, verb, typeString); }; pp.ptr.prototype.fmtPointer = function(value, verb) { - var _1, _2, _r, p, u, value, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; p = $f.p; u = $f.u; value = $f.value; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _2, _r, p, u, value, verb, $s, $r, $c} = $restore(this, {value, verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; u = 0; _1 = $clone(value, reflect.Value).Kind(); @@ -18209,16 +25599,16 @@ $packages["fmt"] = (function() { /* */ if (p.fmt.fmtFlags.sharpV) { $s = 12; continue; } /* */ $s = 13; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 12: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(40); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(40); _r = $clone(value, reflect.Value).Type().String(); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(")("); + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(")("); if (u === 0) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("nil"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("nil"); } else { p.fmt0x64((new $Uint64(0, u.constructor === Number ? u : 1)), true); } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(41); $s = 14; continue; /* } else { */ case 13: if (u === 0) { @@ -18239,12 +25629,12 @@ $packages["fmt"] = (function() { /* } */ case 11: case 6: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtPointer }; } $f._1 = _1; $f._2 = _2; $f._r = _r; $f.p = p; $f.u = u; $f.value = value; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.fmtPointer, $c: true, $r, _1, _2, _r, p, u, value, verb, $s};return $f; }; pp.prototype.fmtPointer = function(value, verb) { return this.$val.fmtPointer(value, verb); }; - pp.ptr.prototype.catchPanic = function(arg, verb) { - var _r, arg, err, oldFlags, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; arg = $f.arg; err = $f.err; oldFlags = $f.oldFlags; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + pp.ptr.prototype.catchPanic = function(arg, verb, method) { + var {_r, arg, err, method, oldFlags, p, v, verb, $s, $r, $c} = $restore(this, {arg, verb, method}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; err = $recover(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } @@ -18253,7 +25643,7 @@ $packages["fmt"] = (function() { _r = reflect.ValueOf(arg); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; if (($clone(v, reflect.Value).Kind() === 22) && $clone(v, reflect.Value).IsNil()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = -1; return; } if (p.panicking) { @@ -18261,89 +25651,118 @@ $packages["fmt"] = (function() { } oldFlags = $clone(p.fmt.fmtFlags, fmtFlags); p.fmt.clearflags(); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(PANIC="); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(PANIC="); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(method); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(" method: "); p.panicking = true; $r = p.printArg(err, 118); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p.panicking = false; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(41); fmtFlags.copy(p.fmt.fmtFlags, oldFlags); /* } */ case 2: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.catchPanic }; } $f._r = _r; $f.arg = arg; $f.err = err; $f.oldFlags = oldFlags; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.catchPanic, $c: true, $r, _r, arg, err, method, oldFlags, p, v, verb, $s};return $f; }; - pp.prototype.catchPanic = function(arg, verb) { return this.$val.catchPanic(arg, verb); }; + pp.prototype.catchPanic = function(arg, verb, method) { return this.$val.catchPanic(arg, verb, method); }; pp.ptr.prototype.handleMethods = function(verb) { - var _1, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, formatter, handled, ok, ok$1, p, stringer, v, v$1, verb, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; formatter = $f.formatter; handled = $f.handled; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; stringer = $f.stringer; v = $f.v; v$1 = $f.v$1; verb = $f.verb; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + var {$24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _1, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, _tuple$2, err, formatter, handled, ok, ok$1, ok$2, p, stringer, v, v$1, verb, $s, $deferred, $r, $c} = $restore(this, {verb}); + /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); handled = false; p = this; - if (p.erroring) { - $s = -1; return handled; - } - _tuple = $assertType(p.arg, Formatter, true); - formatter = _tuple[0]; - ok = _tuple[1]; - /* */ if (ok) { $s = 1; continue; } + /* */ if (p.erroring) { $s = 1; continue; } /* */ $s = 2; continue; - /* if (ok) { */ case 1: - handled = true; - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - $r = formatter.Format(p, verb); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return handled; + /* if (p.erroring) { */ case 1: + $24r = handled; + $s = 3; case 3: return $24r; /* } */ case 2: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 4; continue; } + /* */ if (verb === 119) { $s = 4; continue; } /* */ $s = 5; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 4: - _tuple$1 = $assertType(p.arg, GoStringer, true); - stringer = _tuple$1[0]; - ok$1 = _tuple$1[1]; - /* */ if (ok$1) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (ok$1) { */ case 7: + /* if (verb === 119) { */ case 4: + _tuple = $assertType(p.arg, $error, true); + err = _tuple[0]; + ok = _tuple[1]; + /* */ if (!ok || !p.wrapErrs || !($interfaceIsEqual(p.wrappedErr, $ifaceNil))) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (!ok || !p.wrapErrs || !($interfaceIsEqual(p.wrappedErr, $ifaceNil))) { */ case 6: + p.wrappedErr = $ifaceNil; + p.wrapErrs = false; + $r = p.badVerb(verb); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } handled = true; - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - _r = stringer.GoString(); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $r = p.fmt.fmtS(_r); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return handled; - /* } */ case 8: - $s = 6; continue; - /* } else { */ case 5: + $24r$1 = handled; + $s = 9; case 9: return $24r$1; + /* } */ case 7: + p.wrappedErr = err; + verb = 118; + /* } */ case 5: + _tuple$1 = $assertType(p.arg, Formatter, true); + formatter = _tuple$1[0]; + ok$1 = _tuple$1[1]; + /* */ if (ok$1) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (ok$1) { */ case 10: + handled = true; + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "Format"]]); + $r = formatter.Format(p, verb); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $24r$2 = handled; + $s = 13; case 13: return $24r$2; + /* } */ case 11: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 14: + _tuple$2 = $assertType(p.arg, GoStringer, true); + stringer = _tuple$2[0]; + ok$2 = _tuple$2[1]; + /* */ if (ok$2) { $s = 17; continue; } + /* */ $s = 18; continue; + /* if (ok$2) { */ case 17: + handled = true; + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "GoString"]]); + _r = stringer.GoString(); /* */ $s = 19; case 19: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $r = p.fmt.fmtS(_r); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $24r$3 = handled; + $s = 21; case 21: return $24r$3; + /* } */ case 18: + $s = 16; continue; + /* } else { */ case 15: _1 = verb; - /* */ if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { */ case 12: + /* */ if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { $s = 23; continue; } + /* */ $s = 24; continue; + /* if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { */ case 23: _ref = p.arg; - /* */ if ($assertType(_ref, $error, true)[1]) { $s = 14; continue; } - /* */ if ($assertType(_ref, Stringer, true)[1]) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if ($assertType(_ref, $error, true)[1]) { */ case 14: + /* */ if ($assertType(_ref, $error, true)[1]) { $s = 25; continue; } + /* */ if ($assertType(_ref, Stringer, true)[1]) { $s = 26; continue; } + /* */ $s = 27; continue; + /* if ($assertType(_ref, $error, true)[1]) { */ case 25: v = _ref; handled = true; - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - _r$1 = v.Error(); /* */ $s = 17; case 17: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $r = p.fmtString(_r$1, verb); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return handled; - /* } else if ($assertType(_ref, Stringer, true)[1]) { */ case 15: + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "Error"]]); + _r$1 = v.Error(); /* */ $s = 28; case 28: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $r = p.fmtString(_r$1, verb); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $24r$4 = handled; + $s = 30; case 30: return $24r$4; + /* } else if ($assertType(_ref, Stringer, true)[1]) { */ case 26: v$1 = _ref; handled = true; - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - _r$2 = v$1.String(); /* */ $s = 19; case 19: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $r = p.fmtString(_r$2, verb); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return handled; - /* } */ case 16: - /* } */ case 13: - case 11: - /* } */ case 6: + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "String"]]); + _r$2 = v$1.String(); /* */ $s = 31; case 31: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $r = p.fmtString(_r$2, verb); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $24r$5 = handled; + $s = 33; case 33: return $24r$5; + /* } */ case 27: + /* } */ case 24: + case 22: + /* } */ case 16: handled = false; - $s = -1; return handled; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return handled; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: pp.ptr.prototype.handleMethods }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.formatter = formatter; $f.handled = handled; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.stringer = stringer; $f.v = v; $f.v$1 = v$1; $f.verb = verb; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + $24r$6 = handled; + $s = 34; case 34: return $24r$6; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return handled; } if($curGoroutine.asleep) { var $f = {$blk: pp.ptr.prototype.handleMethods, $c: true, $r, $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _1, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, _tuple$2, err, formatter, handled, ok, ok$1, ok$2, p, stringer, v, v$1, verb, $s, $deferred};return $f; } } }; pp.prototype.handleMethods = function(verb) { return this.$val.handleMethods(verb); }; pp.ptr.prototype.printArg = function(arg, verb) { - var _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, arg, f, f$1, f$10, f$11, f$12, f$13, f$14, f$15, f$16, f$17, f$18, f$19, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, p, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; arg = $f.arg; f = $f.f; f$1 = $f.f$1; f$10 = $f.f$10; f$11 = $f.f$11; f$12 = $f.f$12; f$13 = $f.f$13; f$14 = $f.f$14; f$15 = $f.f$15; f$16 = $f.f$16; f$17 = $f.f$17; f$18 = $f.f$18; f$19 = $f.f$19; f$2 = $f.f$2; f$3 = $f.f$3; f$4 = $f.f$4; f$5 = $f.f$5; f$6 = $f.f$6; f$7 = $f.f$7; f$8 = $f.f$8; f$9 = $f.f$9; p = $f.p; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, arg, f, f$1, f$10, f$11, f$12, f$13, f$14, f$15, f$16, f$17, f$18, f$19, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, p, verb, $s, $r, $c} = $restore(this, {arg, verb}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; p.arg = arg; p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); @@ -18496,12 +25915,12 @@ $packages["fmt"] = (function() { /* } */ case 63: /* } */ case 36: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printArg }; } $f._1 = _1; $f._2 = _2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f.arg = arg; $f.f = f; $f.f$1 = f$1; $f.f$10 = f$10; $f.f$11 = f$11; $f.f$12 = f$12; $f.f$13 = f$13; $f.f$14 = f$14; $f.f$15 = f$15; $f.f$16 = f$16; $f.f$17 = f$17; $f.f$18 = f$18; $f.f$19 = f$19; $f.f$2 = f$2; $f.f$3 = f$3; $f.f$4 = f$4; $f.f$5 = f$5; $f.f$6 = f$6; $f.f$7 = f$7; $f.f$8 = f$8; $f.f$9 = f$9; $f.p = p; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.printArg, $c: true, $r, _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, arg, f, f$1, f$10, f$11, f$12, f$13, f$14, f$15, f$16, f$17, f$18, f$19, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, p, verb, $s};return $f; }; pp.prototype.printArg = function(arg, verb) { return this.$val.printArg(arg, verb); }; pp.ptr.prototype.printValue = function(value, verb, depth) { - var _1, _2, _3, _4, _arg, _arg$1, _arg$2, _i, _i$1, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, a, bytes, depth, f, i, i$1, i$2, i$3, i$4, key, keys, name, p, t, value, value$1, verb, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; a = $f.a; bytes = $f.bytes; depth = $f.depth; f = $f.f; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; i$4 = $f.i$4; key = $f.key; keys = $f.keys; name = $f.name; p = $f.p; t = $f.t; value = $f.value; value$1 = $f.value$1; verb = $f.verb; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _2, _3, _4, _arg, _arg$1, _arg$2, _i, _i$1, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, a, bytes, depth, f, i, i$1, i$2, i$3, i$4, key, name, p, sorted, t, value, value$1, verb, x, x$1, $s, $r, $c} = $restore(this, {value, verb, depth}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; /* */ if (depth > 0 && $clone(value, reflect.Value).IsValid() && $clone(value, reflect.Value).CanInterface()) { $s = 1; continue; } /* */ $s = 2; continue; @@ -18539,14 +25958,14 @@ $packages["fmt"] = (function() { /* */ if (depth === 0) { $s = 25; continue; } /* */ $s = 26; continue; /* if (depth === 0) { */ case 25: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = 27; continue; /* } else { */ case 26: _2 = verb; /* */ if (_2 === (118)) { $s = 29; continue; } /* */ $s = 30; continue; /* if (_2 === (118)) { */ case 29: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = 31; continue; /* } else { */ case 30: $r = p.badVerb(verb); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } @@ -18584,19 +26003,19 @@ $packages["fmt"] = (function() { /* */ $s = 43; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 42: _r$3 = $clone(f, reflect.Value).Type().String(); /* */ $s = 45; case 45: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$3); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$3); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ($clone(f, reflect.Value).IsNil()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); $s = -1; return; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); $s = 44; continue; /* } else { */ case 43: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("map["); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("map["); /* } */ case 44: - _r$4 = $clone(f, reflect.Value).MapKeys(); /* */ $s = 47; case 47: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - keys = _r$4; - _ref = keys; + _r$4 = fmtsort.Sort($clone(f, reflect.Value)); /* */ $s = 47; case 47: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + sorted = _r$4; + _ref = sorted.Key; _i = 0; /* while (true) { */ case 48: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 49; continue; } @@ -18604,193 +26023,197 @@ $packages["fmt"] = (function() { key = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i > 0) { if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(32); } } $r = p.printValue($clone(key, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); - _r$5 = $clone(f, reflect.Value).MapIndex($clone(key, reflect.Value)); /* */ $s = 51; case 51: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - $r = p.printValue($clone(_r$5, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 52; case 52: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(58); + $r = p.printValue($clone((x$1 = sorted.Value, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])), reflect.Value), verb, depth + 1 >> 0); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; - /* } */ $s = 48; continue; case 49: + $s = 48; continue; + case 49: if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(125); } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(93); } $s = 24; continue; /* } else if (_1 === (25)) { */ case 18: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 53; continue; } - /* */ $s = 54; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 53: - _r$6 = $clone(f, reflect.Value).Type().String(); /* */ $s = 55; case 55: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$6); /* */ $s = 56; case 56: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 54: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 52; continue; } + /* */ $s = 53; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 52: + _r$5 = $clone(f, reflect.Value).Type().String(); /* */ $s = 54; case 54: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$5); /* */ $s = 55; case 55: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 53: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); i$1 = 0; - /* while (true) { */ case 57: - /* if (!(i$1 < $clone(f, reflect.Value).NumField())) { break; } */ if(!(i$1 < $clone(f, reflect.Value).NumField())) { $s = 58; continue; } + /* while (true) { */ case 56: + /* if (!(i$1 < $clone(f, reflect.Value).NumField())) { break; } */ if(!(i$1 < $clone(f, reflect.Value).NumField())) { $s = 57; continue; } if (i$1 > 0) { if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(32); } } - /* */ if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { $s = 59; continue; } - /* */ $s = 60; continue; - /* if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { */ case 59: - _r$7 = $clone(f, reflect.Value).Type().Field(i$1); /* */ $s = 61; case 61: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - name = _r$7.Name; + /* */ if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { $s = 58; continue; } + /* */ $s = 59; continue; + /* if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { */ case 58: + _r$6 = $clone(f, reflect.Value).Type().Field(i$1); /* */ $s = 60; case 60: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + name = _r$6.Name; if (!(name === "")) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(name); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(name); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(58); } - /* } */ case 60: - _r$8 = getField($clone(f, reflect.Value), i$1); /* */ $s = 62; case 62: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - $r = p.printValue($clone(_r$8, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 63; case 63: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 59: + _r$7 = getField($clone(f, reflect.Value), i$1); /* */ $s = 61; case 61: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + $r = p.printValue($clone(_r$7, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 62; case 62: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$1 = i$1 + (1) >> 0; - /* } */ $s = 57; continue; case 58: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); + $s = 56; continue; + case 57: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(125); $s = 24; continue; /* } else if (_1 === (20)) { */ case 19: - _r$9 = $clone(f, reflect.Value).Elem(); /* */ $s = 64; case 64: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - value$1 = _r$9; - /* */ if (!$clone(value$1, reflect.Value).IsValid()) { $s = 65; continue; } - /* */ $s = 66; continue; - /* if (!$clone(value$1, reflect.Value).IsValid()) { */ case 65: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 68; continue; } - /* */ $s = 69; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 68: - _r$10 = $clone(f, reflect.Value).Type().String(); /* */ $s = 71; case 71: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$10); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); - $s = 70; continue; - /* } else { */ case 69: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); - /* } */ case 70: - $s = 67; continue; - /* } else { */ case 66: - $r = p.printValue($clone(value$1, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 73; case 73: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 67: + _r$8 = $clone(f, reflect.Value).Elem(); /* */ $s = 63; case 63: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + value$1 = _r$8; + /* */ if (!$clone(value$1, reflect.Value).IsValid()) { $s = 64; continue; } + /* */ $s = 65; continue; + /* if (!$clone(value$1, reflect.Value).IsValid()) { */ case 64: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 67; continue; } + /* */ $s = 68; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 67: + _r$9 = $clone(f, reflect.Value).Type().String(); /* */ $s = 70; case 70: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$9); /* */ $s = 71; case 71: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); + $s = 69; continue; + /* } else { */ case 68: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); + /* } */ case 69: + $s = 66; continue; + /* } else { */ case 65: + $r = p.printValue($clone(value$1, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 66: $s = 24; continue; /* } else if ((_1 === (17)) || (_1 === (23))) { */ case 20: _3 = verb; - /* */ if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { $s = 75; continue; } - /* */ $s = 76; continue; - /* if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { */ case 75: + /* */ if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { $s = 74; continue; } + /* */ $s = 75; continue; + /* if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { */ case 74: t = $clone(f, reflect.Value).Type(); - _r$11 = t.Elem(); /* */ $s = 79; case 79: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } - _r$12 = _r$11.Kind(); /* */ $s = 80; case 80: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } - /* */ if (_r$12 === 8) { $s = 77; continue; } - /* */ $s = 78; continue; - /* if (_r$12 === 8) { */ case 77: + _r$10 = t.Elem(); /* */ $s = 78; case 78: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _r$11 = _r$10.Kind(); /* */ $s = 79; case 79: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + /* */ if (_r$11 === 8) { $s = 76; continue; } + /* */ $s = 77; continue; + /* if (_r$11 === 8) { */ case 76: bytes = sliceType$2.nil; - /* */ if ($clone(f, reflect.Value).Kind() === 23) { $s = 81; continue; } - /* */ if ($clone(f, reflect.Value).CanAddr()) { $s = 82; continue; } - /* */ $s = 83; continue; - /* if ($clone(f, reflect.Value).Kind() === 23) { */ case 81: - _r$13 = $clone(f, reflect.Value).Bytes(); /* */ $s = 85; case 85: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } - bytes = _r$13; - $s = 84; continue; - /* } else if ($clone(f, reflect.Value).CanAddr()) { */ case 82: - _r$14 = $clone(f, reflect.Value).Slice(0, $clone(f, reflect.Value).Len()); /* */ $s = 86; case 86: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } - _r$15 = $clone(_r$14, reflect.Value).Bytes(); /* */ $s = 87; case 87: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } - bytes = _r$15; - $s = 84; continue; - /* } else { */ case 83: + /* */ if ($clone(f, reflect.Value).Kind() === 23) { $s = 80; continue; } + /* */ if ($clone(f, reflect.Value).CanAddr()) { $s = 81; continue; } + /* */ $s = 82; continue; + /* if ($clone(f, reflect.Value).Kind() === 23) { */ case 80: + _r$12 = $clone(f, reflect.Value).Bytes(); /* */ $s = 84; case 84: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + bytes = _r$12; + $s = 83; continue; + /* } else if ($clone(f, reflect.Value).CanAddr()) { */ case 81: + _r$13 = $clone(f, reflect.Value).Slice(0, $clone(f, reflect.Value).Len()); /* */ $s = 85; case 85: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + _r$14 = $clone(_r$13, reflect.Value).Bytes(); /* */ $s = 86; case 86: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } + bytes = _r$14; + $s = 83; continue; + /* } else { */ case 82: bytes = $makeSlice(sliceType$2, $clone(f, reflect.Value).Len()); _ref$1 = bytes; _i$1 = 0; - /* while (true) { */ case 88: - /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 89; continue; } + /* while (true) { */ case 87: + /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 88; continue; } i$2 = _i$1; - _r$16 = $clone(f, reflect.Value).Index(i$2); /* */ $s = 90; case 90: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } - _r$17 = $clone(_r$16, reflect.Value).Uint(); /* */ $s = 91; case 91: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } - ((i$2 < 0 || i$2 >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + i$2] = ((_r$17.$low << 24 >>> 24))); + _r$15 = $clone(f, reflect.Value).Index(i$2); /* */ $s = 89; case 89: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } + _r$16 = $clone(_r$15, reflect.Value).Uint(); /* */ $s = 90; case 90: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } + ((i$2 < 0 || i$2 >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + i$2] = ((_r$16.$low << 24 >>> 24))); _i$1++; - /* } */ $s = 88; continue; case 89: - /* } */ case 84: + $s = 87; continue; + case 88: + /* } */ case 83: _arg = bytes; _arg$1 = verb; - _r$18 = t.String(); /* */ $s = 92; case 92: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } - _arg$2 = _r$18; - $r = p.fmtBytes(_arg, _arg$1, _arg$2); /* */ $s = 93; case 93: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$17 = t.String(); /* */ $s = 91; case 91: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } + _arg$2 = _r$17; + $r = p.fmtBytes(_arg, _arg$1, _arg$2); /* */ $s = 92; case 92: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; - /* } */ case 78: - /* } */ case 76: - case 74: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 94; continue; } - /* */ $s = 95; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 94: - _r$19 = $clone(f, reflect.Value).Type().String(); /* */ $s = 97; case 97: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$19); /* */ $s = 98; case 98: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 77: + /* } */ case 75: + case 73: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 93; continue; } + /* */ $s = 94; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 93: + _r$18 = $clone(f, reflect.Value).Type().String(); /* */ $s = 96; case 96: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$18); /* */ $s = 97; case 97: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (($clone(f, reflect.Value).Kind() === 23) && $clone(f, reflect.Value).IsNil()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); $s = -1; return; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); i$3 = 0; - /* while (true) { */ case 99: - /* if (!(i$3 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$3 < $clone(f, reflect.Value).Len())) { $s = 100; continue; } + /* while (true) { */ case 98: + /* if (!(i$3 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$3 < $clone(f, reflect.Value).Len())) { $s = 99; continue; } if (i$3 > 0) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } - _r$20 = $clone(f, reflect.Value).Index(i$3); /* */ $s = 101; case 101: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } - $r = p.printValue($clone(_r$20, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 102; case 102: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$19 = $clone(f, reflect.Value).Index(i$3); /* */ $s = 100; case 100: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } + $r = p.printValue($clone(_r$19, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 101; case 101: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$3 = i$3 + (1) >> 0; - /* } */ $s = 99; continue; case 100: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); - $s = 96; continue; - /* } else { */ case 95: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); + $s = 98; continue; + case 99: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(125); + $s = 95; continue; + /* } else { */ case 94: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(91); i$4 = 0; - /* while (true) { */ case 103: - /* if (!(i$4 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$4 < $clone(f, reflect.Value).Len())) { $s = 104; continue; } + /* while (true) { */ case 102: + /* if (!(i$4 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$4 < $clone(f, reflect.Value).Len())) { $s = 103; continue; } if (i$4 > 0) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(32); } - _r$21 = $clone(f, reflect.Value).Index(i$4); /* */ $s = 105; case 105: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } - $r = p.printValue($clone(_r$21, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 106; case 106: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$20 = $clone(f, reflect.Value).Index(i$4); /* */ $s = 104; case 104: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } + $r = p.printValue($clone(_r$20, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 105; case 105: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$4 = i$4 + (1) >> 0; - /* } */ $s = 103; continue; case 104: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); - /* } */ case 96: + $s = 102; continue; + case 103: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(93); + /* } */ case 95: $s = 24; continue; /* } else if (_1 === (22)) { */ case 21: - /* */ if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { $s = 107; continue; } - /* */ $s = 108; continue; - /* if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { */ case 107: - _r$22 = $clone(f, reflect.Value).Elem(); /* */ $s = 110; case 110: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } - a = _r$22; + /* */ if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { $s = 106; continue; } + /* */ $s = 107; continue; + /* if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { */ case 106: + _r$21 = $clone(f, reflect.Value).Elem(); /* */ $s = 109; case 109: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } + a = _r$21; _4 = $clone(a, reflect.Value).Kind(); - /* */ if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { $s = 111; continue; } - /* */ $s = 112; continue; - /* if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { */ case 111: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); - $r = p.printValue($clone(a, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 113; case 113: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { $s = 110; continue; } + /* */ $s = 111; continue; + /* if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { */ case 110: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(38); + $r = p.printValue($clone(a, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 112; case 112: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; - /* } */ case 112: - case 109: - /* } */ case 108: - $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 114; case 114: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 111: + case 108: + /* } */ case 107: + $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 113; case 113: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if ((_1 === (18)) || (_1 === (19)) || (_1 === (26))) { */ case 22: - $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 115; case 115: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 114; case 114: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else { */ case 23: - $r = p.unknownType($clone(f, reflect.Value)); /* */ $s = 116; case 116: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = p.unknownType($clone(f, reflect.Value)); /* */ $s = 115; case 115: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 24: case 7: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printValue }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f.a = a; $f.bytes = bytes; $f.depth = depth; $f.f = f; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.i$4 = i$4; $f.key = key; $f.keys = keys; $f.name = name; $f.p = p; $f.t = t; $f.value = value; $f.value$1 = value$1; $f.verb = verb; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.printValue, $c: true, $r, _1, _2, _3, _4, _arg, _arg$1, _arg$2, _i, _i$1, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, a, bytes, depth, f, i, i$1, i$2, i$3, i$4, key, name, p, sorted, t, value, value$1, verb, x, x$1, $s};return $f; }; pp.prototype.printValue = function(value, verb, depth) { return this.$val.printValue(value, verb, depth); }; intFromArg = function(a, argNum) { - var _1, _r, _tuple, a, argNum, isInt, n, n$1, newArgNum, num, v, x, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tuple = $f._tuple; a = $f.a; argNum = $f.argNum; isInt = $f.isInt; n = $f.n; n$1 = $f.n$1; newArgNum = $f.newArgNum; num = $f.num; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _r, _tuple, a, argNum, isInt, n, n$1, newArgNum, num, v, x, x$1, x$2, $s, $r, $c} = $restore(this, {a, argNum}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: num = 0; isInt = false; newArgNum = 0; @@ -18829,7 +26252,7 @@ $packages["fmt"] = (function() { } /* } */ case 2: $s = -1; return [num, isInt, newArgNum]; - /* */ } return; } if ($f === undefined) { $f = { $blk: intFromArg }; } $f._1 = _1; $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.argNum = argNum; $f.isInt = isInt; $f.n = n; $f.n$1 = n$1; $f.newArgNum = newArgNum; $f.num = num; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: intFromArg, $c: true, $r, _1, _r, _tuple, a, argNum, isInt, n, n$1, newArgNum, num, v, x, x$1, x$2, $s};return $f; }; parseArgNumber = function(format) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, format, i, index, newi, ok, ok$1, wid, width; @@ -18922,22 +26345,22 @@ $packages["fmt"] = (function() { pp.ptr.prototype.badArgNum = function(verb) { var p, verb; p = this; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(BADINDEX)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(BADINDEX)"); }; pp.prototype.badArgNum = function(verb) { return this.$val.badArgNum(verb); }; pp.ptr.prototype.missingArg = function(verb) { var p, verb; p = this; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(MISSING)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(MISSING)"); }; pp.prototype.missingArg = function(verb) { return this.$val.missingArg(verb); }; pp.ptr.prototype.doPrintf = function(format, a) { - var _1, _i, _r, _r$1, _r$2, _ref, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, a, afterIndex, arg, argNum, c, end, format, i, i$1, lasti, p, size, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; a = $f.a; afterIndex = $f.afterIndex; arg = $f.arg; argNum = $f.argNum; c = $f.c; end = $f.end; format = $f.format; i = $f.i; i$1 = $f.i$1; lasti = $f.lasti; p = $f.p; size = $f.size; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_1, _i, _r, _r$1, _r$2, _ref, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, a, afterIndex, arg, argNum, c, end, format, i, i$1, lasti, p, size, verb, $s, $r, $c} = $restore(this, {format, a}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: p = this; end = format.length; argNum = 0; @@ -18953,7 +26376,7 @@ $packages["fmt"] = (function() { i = i + (1) >> 0; } if (i > lasti) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString($substring(format, lasti, i)); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString($substring(format, lasti, i)); } if (i >= end) { /* break; */ $s = 2; continue; @@ -19005,7 +26428,8 @@ $packages["fmt"] = (function() { /* } */ case 12: case 5: i = i + (1) >> 0; - /* } */ $s = 3; continue; case 4: + $s = 3; continue; + case 4: _tuple = p.argNumber(argNum, format, i, a.$length); argNum = _tuple[0]; i = _tuple[1]; @@ -19020,7 +26444,7 @@ $packages["fmt"] = (function() { p.fmt.fmtFlags.widPresent = _tuple$1[1]; argNum = _tuple$1[2]; if (!p.fmt.fmtFlags.widPresent) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(BADWIDTH)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!(BADWIDTH)"); } if (p.fmt.wid < 0) { p.fmt.wid = -p.fmt.wid; @@ -19063,7 +26487,7 @@ $packages["fmt"] = (function() { p.fmt.fmtFlags.precPresent = false; } if (!p.fmt.fmtFlags.precPresent) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(BADPREC)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!(BADPREC)"); } afterIndex = false; $s = 24; continue; @@ -19085,7 +26509,7 @@ $packages["fmt"] = (function() { afterIndex = _tuple$6[2]; } if (i >= end) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(NOVERB)"); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!(NOVERB)"); /* break; */ $s = 2; continue; } _tmp = ((format.charCodeAt(i) >> 0)); @@ -19104,7 +26528,7 @@ $packages["fmt"] = (function() { /* */ if ((verb === 118)) { $s = 30; continue; } /* */ $s = 31; continue; /* if ((verb === 37)) { */ case 27: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(37); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(37); $s = 32; continue; /* } else if (!p.goodArgNum) { */ case 28: p.badArgNum(verb); @@ -19125,12 +26549,13 @@ $packages["fmt"] = (function() { argNum = argNum + (1) >> 0; /* } */ case 32: case 26: - /* } */ $s = 1; continue; case 2: + $s = 1; continue; + case 2: /* */ if (!p.reordered && argNum < a.$length) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!p.reordered && argNum < a.$length) { */ case 35: p.fmt.clearflags(); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(EXTRA "); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!(EXTRA "); _ref = $subslice(a, argNum); _i = 0; /* while (true) { */ case 37: @@ -19138,1320 +26563,963 @@ $packages["fmt"] = (function() { i$1 = _i; arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i$1 > 0) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } /* */ if ($interfaceIsEqual(arg, $ifaceNil)) { $s = 39; continue; } /* */ $s = 40; continue; /* if ($interfaceIsEqual(arg, $ifaceNil)) { */ case 39: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = 41; continue; /* } else { */ case 40: _r$2 = reflect.TypeOf(arg).String(); /* */ $s = 42; case 42: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); + $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$2); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(61); $r = p.printArg(arg, 118); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 41: _i++; - /* } */ $s = 37; continue; case 38: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); + $s = 37; continue; + case 38: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(41); /* } */ case 36: $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintf }; } $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f.a = a; $f.afterIndex = afterIndex; $f.arg = arg; $f.argNum = argNum; $f.c = c; $f.end = end; $f.format = format; $f.i = i; $f.i$1 = i$1; $f.lasti = lasti; $f.p = p; $f.size = size; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: pp.ptr.prototype.doPrintf, $c: true, $r, _1, _i, _r, _r$1, _r$2, _ref, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, a, afterIndex, arg, argNum, c, end, format, i, i$1, lasti, p, size, verb, $s};return $f; }; pp.prototype.doPrintf = function(format, a) { return this.$val.doPrintf(format, a); }; - ss.ptr.prototype.Read = function(buf) { - var _tmp, _tmp$1, buf, err, n, s; - n = 0; - err = $ifaceNil; - s = this; - _tmp = 0; - _tmp$1 = errors.New("ScanState's Read should not be called. Use ReadRune"); - n = _tmp; - err = _tmp$1; - return [n, err]; + fmt.ptr.prototype.clearflags = function() { + var f; + f = this; + fmtFlags.copy(f.fmtFlags, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false)); }; - ss.prototype.Read = function(buf) { return this.$val.Read(buf); }; - ss.ptr.prototype.ReadRune = function() { - var _r, _tuple, err, r, s, size, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = 0; - size = 0; - err = $ifaceNil; - s = this; - if (s.atEOF || s.count >= s.ssave.argLimit) { - err = io.EOF; - $s = -1; return [r, size, err]; + fmt.prototype.clearflags = function() { return this.$val.clearflags(); }; + fmt.ptr.prototype.init = function(buf) { + var buf, f; + f = this; + f.buf = buf; + f.clearflags(); + }; + fmt.prototype.init = function(buf) { return this.$val.init(buf); }; + fmt.ptr.prototype.writePadding = function(n) { + var _i, _ref, buf, f, i, n, newLen, oldLen, padByte, padding; + f = this; + if (n <= 0) { + return; } - _r = s.rs.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - r = _tuple[0]; - size = _tuple[1]; - err = _tuple[2]; - if ($interfaceIsEqual(err, $ifaceNil)) { - s.count = s.count + (1) >> 0; - if (s.ssave.nlIsEnd && (r === 10)) { - s.atEOF = true; - } - } else if ($interfaceIsEqual(err, io.EOF)) { - s.atEOF = true; + buf = f.buf.$get(); + oldLen = buf.$length; + newLen = oldLen + n >> 0; + if (newLen > buf.$capacity) { + buf = $makeSlice(buffer, (($imul(buf.$capacity, 2)) + n >> 0)); + $copySlice(buf, f.buf.$get()); } - $s = -1; return [r, size, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.ReadRune }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.ReadRune = function() { return this.$val.ReadRune(); }; - ss.ptr.prototype.Width = function() { - var _tmp, _tmp$1, _tmp$2, _tmp$3, ok, s, wid; - wid = 0; - ok = false; - s = this; - if (s.ssave.maxWid === 1073741824) { - _tmp = 0; - _tmp$1 = false; - wid = _tmp; - ok = _tmp$1; - return [wid, ok]; + padByte = 32; + if (f.fmtFlags.zero) { + padByte = 48; } - _tmp$2 = s.ssave.maxWid; - _tmp$3 = true; - wid = _tmp$2; - ok = _tmp$3; - return [wid, ok]; - }; - ss.prototype.Width = function() { return this.$val.Width(); }; - ss.ptr.prototype.getRune = function() { - var _r, _tuple, err, r, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = 0; - s = this; - _r = s.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - r = _tuple[0]; - err = _tuple[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - if ($interfaceIsEqual(err, io.EOF)) { - r = -1; - $s = -1; return r; - } - s.error(err); - } - $s = -1; return r; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.getRune }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.getRune = function() { return this.$val.getRune(); }; - ss.ptr.prototype.UnreadRune = function() { - var _r, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - _r = s.rs.UnreadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - s.atEOF = false; - s.count = s.count - (1) >> 0; - $s = -1; return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.UnreadRune }; } $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; - ss.ptr.prototype.error = function(err) { - var err, s, x; - s = this; - $panic((x = new scanError.ptr(err), new x.constructor.elem(x))); - }; - ss.prototype.error = function(err) { return this.$val.error(err); }; - ss.ptr.prototype.errorString = function(err) { - var err, s, x; - s = this; - $panic((x = new scanError.ptr(errors.New(err)), new x.constructor.elem(x))); - }; - ss.prototype.errorString = function(err) { return this.$val.errorString(err); }; - ss.ptr.prototype.Token = function(skipSpace, f) { - var _r, err, f, s, skipSpace, tok, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; f = $f.f; s = $f.s; skipSpace = $f.skipSpace; tok = $f.tok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - err = [err]; - tok = sliceType$2.nil; - err[0] = $ifaceNil; - s = this; - $deferred.push([(function(err) { return function() { - var _tuple, e, ok, se; - e = $recover(); - if (!($interfaceIsEqual(e, $ifaceNil))) { - _tuple = $assertType(e, scanError, true); - se = $clone(_tuple[0], scanError); - ok = _tuple[1]; - if (ok) { - err[0] = se.err; - } else { - $panic(e); - } - } - }; })(err), []]); - if (f === $throwNilPointerError) { - f = notSpace; - } - s.buf = $subslice(s.buf, 0, 0); - _r = s.token(skipSpace, f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - tok = _r; - $s = -1; return [tok, err[0]]; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [tok, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ss.ptr.prototype.Token }; } $f._r = _r; $f.err = err; $f.f = f; $f.s = s; $f.skipSpace = skipSpace; $f.tok = tok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - ss.prototype.Token = function(skipSpace, f) { return this.$val.Token(skipSpace, f); }; - isSpace = function(r) { - var _i, _ref, r, rng, rx; - if (r >= 65536) { - return false; - } - rx = ((r << 16 >>> 16)); - _ref = space; + padding = $subslice(buf, oldLen, newLen); + _ref = padding; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } - rng = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), arrayType$1); - if (rx < rng[0]) { - return false; - } - if (rx <= rng[1]) { - return true; - } + i = _i; + ((i < 0 || i >= padding.$length) ? ($throwRuntimeError("index out of range"), undefined) : padding.$array[padding.$offset + i] = padByte); _i++; } - return false; + f.buf.$set($subslice(buf, 0, newLen)); }; - notSpace = function(r) { - var r; - return !isSpace(r); - }; - ss.ptr.prototype.free = function(old) { - var old, s; - s = this; - if (old.validSave) { - ssave.copy(s.ssave, old); + fmt.prototype.writePadding = function(n) { return this.$val.writePadding(n); }; + fmt.ptr.prototype.pad = function(b) { + var b, f, width; + f = this; + if (!f.fmtFlags.widPresent || (f.wid === 0)) { + f.buf.write(b); return; } - if (s.buf.$capacity > 1024) { + width = f.wid - utf8.RuneCount(b) >> 0; + if (!f.fmtFlags.minus) { + f.writePadding(width); + f.buf.write(b); + } else { + f.buf.write(b); + f.writePadding(width); + } + }; + fmt.prototype.pad = function(b) { return this.$val.pad(b); }; + fmt.ptr.prototype.padString = function(s) { + var f, s, width; + f = this; + if (!f.fmtFlags.widPresent || (f.wid === 0)) { + f.buf.writeString(s); return; } - s.buf = $subslice(s.buf, 0, 0); - s.rs = $ifaceNil; - ssFree.Put(s); + width = f.wid - utf8.RuneCountInString(s) >> 0; + if (!f.fmtFlags.minus) { + f.writePadding(width); + f.buf.writeString(s); + } else { + f.buf.writeString(s); + f.writePadding(width); + } }; - ss.prototype.free = function(old) { return this.$val.free(old); }; - ss.ptr.prototype.SkipSpace = function() { - var _r, _r$1, _r$2, _v, r, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _v = $f._v; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - /* while (true) { */ case 1: - _r = s.getRune(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - r = _r; - if (r === -1) { - $s = -1; return; + fmt.prototype.padString = function(s) { return this.$val.padString(s); }; + fmt.ptr.prototype.fmtBoolean = function(v) { + var f, v; + f = this; + if (v) { + f.padString("true"); + } else { + f.padString("false"); + } + }; + fmt.prototype.fmtBoolean = function(v) { return this.$val.fmtBoolean(v); }; + fmt.ptr.prototype.fmtUnicode = function(u) { + var buf, f, i, oldZero, prec, u, width; + f = this; + buf = $subslice(new sliceType$2(f.intbuf), 0); + prec = 4; + if (f.fmtFlags.precPresent && f.prec > 4) { + prec = f.prec; + width = (((2 + prec >> 0) + 2 >> 0) + 4 >> 0) + 1 >> 0; + if (width > buf.$length) { + buf = $makeSlice(sliceType$2, width); } - if (!(r === 13)) { _v = false; $s = 6; continue s; } - _r$1 = s.peek("\n"); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _v = _r$1; case 6: - /* */ if (_v) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_v) { */ case 4: - /* continue; */ $s = 1; continue; - /* } */ case 5: - /* */ if (r === 10) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (r === 10) { */ case 8: - if (s.ssave.nlIsSpace) { - /* continue; */ $s = 1; continue; - } - s.errorString("unexpected newline"); - $s = -1; return; - /* } */ case 9: - /* */ if (!isSpace(r)) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (!isSpace(r)) { */ case 10: - _r$2 = s.UnreadRune(); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$2; - /* break; */ $s = 2; continue; - /* } */ case 11: - /* } */ $s = 1; continue; case 2: - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.SkipSpace }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._v = _v; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.SkipSpace = function() { return this.$val.SkipSpace(); }; - ss.ptr.prototype.token = function(skipSpace, f) { - var _r, _r$1, _r$2, f, r, s, skipSpace, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; f = $f.f; r = $f.r; s = $f.s; skipSpace = $f.skipSpace; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - /* */ if (skipSpace) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (skipSpace) { */ case 1: - $r = s.SkipSpace(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - /* while (true) { */ case 4: - _r = s.getRune(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - r = _r; - if (r === -1) { - /* break; */ $s = 5; continue; - } - _r$1 = f(r); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (!_r$1) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (!_r$1) { */ case 7: - _r$2 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$2; - /* break; */ $s = 5; continue; - /* } */ case 8: - (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(r); - /* } */ $s = 4; continue; case 5: - $s = -1; return (x = s.buf, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.token }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.f = f; $f.r = r; $f.s = s; $f.skipSpace = skipSpace; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.token = function(skipSpace, f) { return this.$val.token(skipSpace, f); }; - indexRune = function(s, r) { - var _i, _ref, _rune, c, i, r, s; - _ref = s; - _i = 0; + } + i = buf.$length; + if (f.fmtFlags.sharp && (u.$high < 0 || (u.$high === 0 && u.$low <= 1114111)) && strconv.IsPrint(((u.$low >> 0)))) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); + i = i - (utf8.RuneLen(((u.$low >> 0)))) >> 0; + utf8.EncodeRune($subslice(buf, i), ((u.$low >> 0))); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 32); + } while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - i = _i; - c = _rune[0]; - if (c === r) { - return i; - } - _i += _rune[1]; + if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); + prec = prec - (1) >> 0; + u = $shiftRightUint64(u, (4)); } - return -1; + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(u))); + prec = prec - (1) >> 0; + while (true) { + if (!(prec > 0)) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); + prec = prec - (1) >> 0; + } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 43); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 85); + oldZero = f.fmtFlags.zero; + f.fmtFlags.zero = false; + f.pad($subslice(buf, i)); + f.fmtFlags.zero = oldZero; }; - ss.ptr.prototype.peek = function(ok) { - var _r, _r$1, ok, r, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; ok = $f.ok; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - _r = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - r = _r; - /* */ if (!((r === -1))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((r === -1))) { */ case 2: - _r$1 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - /* } */ case 3: - $s = -1; return indexRune(ok, r) >= 0; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.peek }; } $f._r = _r; $f._r$1 = _r$1; $f.ok = ok; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + fmt.prototype.fmtUnicode = function(u) { return this.$val.fmtUnicode(u); }; + fmt.ptr.prototype.fmtInteger = function(u, base, isSigned, verb, digits) { + var _1, _2, base, buf, digits, f, i, isSigned, negative, next, oldZero, oldZero$1, prec, u, verb, width, x, x$1, x$2, x$3, x$4; + f = this; + negative = isSigned && (x = (new $Int64(u.$high, u.$low)), (x.$high < 0 || (x.$high === 0 && x.$low < 0))); + if (negative) { + u = new $Uint64(-u.$high, -u.$low); + } + buf = $subslice(new sliceType$2(f.intbuf), 0); + if (f.fmtFlags.widPresent || f.fmtFlags.precPresent) { + width = (3 + f.wid >> 0) + f.prec >> 0; + if (width > buf.$length) { + buf = $makeSlice(sliceType$2, width); + } + } + prec = 0; + if (f.fmtFlags.precPresent) { + prec = f.prec; + if ((prec === 0) && (u.$high === 0 && u.$low === 0)) { + oldZero = f.fmtFlags.zero; + f.fmtFlags.zero = false; + f.writePadding(f.wid); + f.fmtFlags.zero = oldZero; + return; + } + } else if (f.fmtFlags.zero && f.fmtFlags.widPresent) { + prec = f.wid; + if (negative || f.fmtFlags.plus || f.fmtFlags.space) { + prec = prec - (1) >> 0; + } + } + i = buf.$length; + _1 = base; + if (_1 === (10)) { + while (true) { + if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 10)))) { break; } + i = i - (1) >> 0; + next = $div64(u, new $Uint64(0, 10), false); + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$1 = new $Uint64(0 + u.$high, 48 + u.$low), x$2 = $mul64(next, new $Uint64(0, 10)), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)).$low << 24 >>> 24))); + u = next; + } + } else if (_1 === (16)) { + while (true) { + if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); + u = $shiftRightUint64(u, (4)); + } + } else if (_1 === (8)) { + while (true) { + if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 8)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$3 = new $Uint64(u.$high & 0, (u.$low & 7) >>> 0), new $Uint64(0 + x$3.$high, 48 + x$3.$low)).$low << 24 >>> 24))); + u = $shiftRightUint64(u, (3)); + } + } else if (_1 === (2)) { + while (true) { + if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 2)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$4 = new $Uint64(u.$high & 0, (u.$low & 1) >>> 0), new $Uint64(0 + x$4.$high, 48 + x$4.$low)).$low << 24 >>> 24))); + u = $shiftRightUint64(u, (1)); + } + } else { + $panic(new $String("fmt: unknown base; can't happen")); + } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(u))); + while (true) { + if (!(i > 0 && prec > (buf.$length - i >> 0))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); + } + if (f.fmtFlags.sharp) { + _2 = base; + if (_2 === (2)) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 98); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); + } else if (_2 === (8)) { + if (!((((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i]) === 48))) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); + } + } else if (_2 === (16)) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt(16)); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); + } + } + if (verb === 79) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 111); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); + } + if (negative) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 45); + } else if (f.fmtFlags.plus) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 43); + } else if (f.fmtFlags.space) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 32); + } + oldZero$1 = f.fmtFlags.zero; + f.fmtFlags.zero = false; + f.pad($subslice(buf, i)); + f.fmtFlags.zero = oldZero$1; }; - ss.prototype.peek = function(ok) { return this.$val.peek(ok); }; - ptrType$25.methods = [{prop: "clearflags", name: "clearflags", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "init", name: "init", pkg: "fmt", typ: $funcType([ptrType$1], [], false)}, {prop: "writePadding", name: "writePadding", pkg: "fmt", typ: $funcType([$Int], [], false)}, {prop: "pad", name: "pad", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "padString", name: "padString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtBoolean", name: "fmtBoolean", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "fmtUnicode", name: "fmtUnicode", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Int, $Bool, $String], [], false)}, {prop: "truncate", name: "truncate", pkg: "fmt", typ: $funcType([$String], [$String], false)}, {prop: "fmtS", name: "fmtS", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtSbx", name: "fmtSbx", pkg: "fmt", typ: $funcType([$String, sliceType$2, $String], [], false)}, {prop: "fmtSx", name: "fmtSx", pkg: "fmt", typ: $funcType([$String, $String], [], false)}, {prop: "fmtBx", name: "fmtBx", pkg: "fmt", typ: $funcType([sliceType$2, $String], [], false)}, {prop: "fmtQ", name: "fmtQ", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtC", name: "fmtC", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtQc", name: "fmtQc", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32, $Int], [], false)}]; - ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [], false)}]; - ptrType$2.methods = [{prop: "free", name: "free", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "unknownType", name: "unknownType", pkg: "fmt", typ: $funcType([reflect.Value], [], false)}, {prop: "badVerb", name: "badVerb", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "fmtBool", name: "fmtBool", pkg: "fmt", typ: $funcType([$Bool, $Int32], [], false)}, {prop: "fmt0x64", name: "fmt0x64", pkg: "fmt", typ: $funcType([$Uint64, $Bool], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Bool, $Int32], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32], [], false)}, {prop: "fmtComplex", name: "fmtComplex", pkg: "fmt", typ: $funcType([$Complex128, $Int, $Int32], [], false)}, {prop: "fmtString", name: "fmtString", pkg: "fmt", typ: $funcType([$String, $Int32], [], false)}, {prop: "fmtBytes", name: "fmtBytes", pkg: "fmt", typ: $funcType([sliceType$2, $Int32, $String], [], false)}, {prop: "fmtPointer", name: "fmtPointer", pkg: "fmt", typ: $funcType([reflect.Value, $Int32], [], false)}, {prop: "catchPanic", name: "catchPanic", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "handleMethods", name: "handleMethods", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "printArg", name: "printArg", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "printValue", name: "printValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [], false)}, {prop: "argNumber", name: "argNumber", pkg: "fmt", typ: $funcType([$Int, $String, $Int, $Int], [$Int, $Int, $Bool], false)}, {prop: "badArgNum", name: "badArgNum", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "missingArg", name: "missingArg", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "doPrintf", name: "doPrintf", pkg: "fmt", typ: $funcType([$String, sliceType], [], false)}, {prop: "doPrint", name: "doPrint", pkg: "fmt", typ: $funcType([sliceType], [], false)}, {prop: "doPrintln", name: "doPrintln", pkg: "fmt", typ: $funcType([sliceType], [], false)}]; - ptrType$5.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "getRune", name: "getRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "mustReadRune", name: "mustReadRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "error", name: "error", pkg: "fmt", typ: $funcType([$error], [], false)}, {prop: "errorString", name: "errorString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType$2, $error], false)}, {prop: "free", name: "free", pkg: "fmt", typ: $funcType([ssave], [], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "token", name: "token", pkg: "fmt", typ: $funcType([$Bool, funcType], [sliceType$2], false)}, {prop: "consume", name: "consume", pkg: "fmt", typ: $funcType([$String, $Bool], [$Bool], false)}, {prop: "peek", name: "peek", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "notEOF", name: "notEOF", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "accept", name: "accept", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "okVerb", name: "okVerb", pkg: "fmt", typ: $funcType([$Int32, $String, $String], [$Bool], false)}, {prop: "scanBool", name: "scanBool", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "getBase", name: "getBase", pkg: "fmt", typ: $funcType([$Int32], [$Int, $String], false)}, {prop: "scanNumber", name: "scanNumber", pkg: "fmt", typ: $funcType([$String, $Bool], [$String], false)}, {prop: "scanRune", name: "scanRune", pkg: "fmt", typ: $funcType([$Int], [$Int64], false)}, {prop: "scanBasePrefix", name: "scanBasePrefix", pkg: "fmt", typ: $funcType([], [$Int, $String, $Bool], false)}, {prop: "scanInt", name: "scanInt", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Int64], false)}, {prop: "scanUint", name: "scanUint", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Uint64], false)}, {prop: "floatToken", name: "floatToken", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "complexTokens", name: "complexTokens", pkg: "fmt", typ: $funcType([], [$String, $String], false)}, {prop: "convertFloat", name: "convertFloat", pkg: "fmt", typ: $funcType([$String, $Int], [$Float64], false)}, {prop: "scanComplex", name: "scanComplex", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Complex128], false)}, {prop: "convertString", name: "convertString", pkg: "fmt", typ: $funcType([$Int32], [$String], false)}, {prop: "quotedString", name: "quotedString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "hexByte", name: "hexByte", pkg: "fmt", typ: $funcType([], [$Uint8, $Bool], false)}, {prop: "hexString", name: "hexString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "scanOne", name: "scanOne", pkg: "fmt", typ: $funcType([$Int32, $emptyInterface], [], false)}, {prop: "doScan", name: "doScan", pkg: "fmt", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "advance", name: "advance", pkg: "fmt", typ: $funcType([$String], [$Int], false)}, {prop: "doScanf", name: "doScanf", pkg: "fmt", typ: $funcType([$String, sliceType], [$Int, $error], false)}]; - fmtFlags.init("fmt", [{prop: "widPresent", name: "widPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "precPresent", name: "precPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "minus", name: "minus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plus", name: "plus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharp", name: "sharp", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "space", name: "space", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "zero", name: "zero", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plusV", name: "plusV", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharpV", name: "sharpV", embedded: false, exported: false, typ: $Bool, tag: ""}]); - fmt.init("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "fmtFlags", name: "fmtFlags", embedded: true, exported: false, typ: fmtFlags, tag: ""}, {prop: "wid", name: "wid", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "prec", name: "prec", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "intbuf", name: "intbuf", embedded: false, exported: false, typ: arrayType, tag: ""}]); + fmt.prototype.fmtInteger = function(u, base, isSigned, verb, digits) { return this.$val.fmtInteger(u, base, isSigned, verb, digits); }; + fmt.ptr.prototype.truncateString = function(s) { + var _i, _ref, _rune, f, i, n, s; + f = this; + if (f.fmtFlags.precPresent) { + n = f.prec; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + n = n - (1) >> 0; + if (n < 0) { + return $substring(s, 0, i); + } + _i += _rune[1]; + } + } + return s; + }; + fmt.prototype.truncateString = function(s) { return this.$val.truncateString(s); }; + fmt.ptr.prototype.truncate = function(b) { + var _tuple, b, f, i, n, wid; + f = this; + if (f.fmtFlags.precPresent) { + n = f.prec; + i = 0; + while (true) { + if (!(i < b.$length)) { break; } + n = n - (1) >> 0; + if (n < 0) { + return $subslice(b, 0, i); + } + wid = 1; + if (((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]) >= 128) { + _tuple = utf8.DecodeRune($subslice(b, i)); + wid = _tuple[1]; + } + i = i + (wid) >> 0; + } + } + return b; + }; + fmt.prototype.truncate = function(b) { return this.$val.truncate(b); }; + fmt.ptr.prototype.fmtS = function(s) { + var f, s; + f = this; + s = f.truncateString(s); + f.padString(s); + }; + fmt.prototype.fmtS = function(s) { return this.$val.fmtS(s); }; + fmt.ptr.prototype.fmtBs = function(b) { + var b, f; + f = this; + b = f.truncate(b); + f.pad(b); + }; + fmt.prototype.fmtBs = function(b) { return this.$val.fmtBs(b); }; + fmt.ptr.prototype.fmtSbx = function(s, b, digits) { + var b, buf, c, digits, f, i, length, s, width; + f = this; + length = b.$length; + if (b === sliceType$2.nil) { + length = s.length; + } + if (f.fmtFlags.precPresent && f.prec < length) { + length = f.prec; + } + width = $imul(2, length); + if (width > 0) { + if (f.fmtFlags.space) { + if (f.fmtFlags.sharp) { + width = $imul(width, (2)); + } + width = width + ((length - 1 >> 0)) >> 0; + } else if (f.fmtFlags.sharp) { + width = width + (2) >> 0; + } + } else { + if (f.fmtFlags.widPresent) { + f.writePadding(f.wid); + } + return; + } + if (f.fmtFlags.widPresent && f.wid > width && !f.fmtFlags.minus) { + f.writePadding(f.wid - width >> 0); + } + buf = f.buf.$get(); + if (f.fmtFlags.sharp) { + buf = $append(buf, 48, digits.charCodeAt(16)); + } + c = 0; + i = 0; + while (true) { + if (!(i < length)) { break; } + if (f.fmtFlags.space && i > 0) { + buf = $append(buf, 32); + if (f.fmtFlags.sharp) { + buf = $append(buf, 48, digits.charCodeAt(16)); + } + } + if (!(b === sliceType$2.nil)) { + c = ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]); + } else { + c = s.charCodeAt(i); + } + buf = $append(buf, digits.charCodeAt((c >>> 4 << 24 >>> 24)), digits.charCodeAt(((c & 15) >>> 0))); + i = i + (1) >> 0; + } + f.buf.$set(buf); + if (f.fmtFlags.widPresent && f.wid > width && f.fmtFlags.minus) { + f.writePadding(f.wid - width >> 0); + } + }; + fmt.prototype.fmtSbx = function(s, b, digits) { return this.$val.fmtSbx(s, b, digits); }; + fmt.ptr.prototype.fmtSx = function(s, digits) { + var digits, f, s; + f = this; + f.fmtSbx(s, sliceType$2.nil, digits); + }; + fmt.prototype.fmtSx = function(s, digits) { return this.$val.fmtSx(s, digits); }; + fmt.ptr.prototype.fmtBx = function(b, digits) { + var b, digits, f; + f = this; + f.fmtSbx("", b, digits); + }; + fmt.prototype.fmtBx = function(b, digits) { return this.$val.fmtBx(b, digits); }; + fmt.ptr.prototype.fmtQ = function(s) { + var buf, f, s; + f = this; + s = f.truncateString(s); + if (f.fmtFlags.sharp && strconv.CanBackquote(s)) { + f.padString("`" + s + "`"); + return; + } + buf = $subslice(new sliceType$2(f.intbuf), 0, 0); + if (f.fmtFlags.plus) { + f.pad(strconv.AppendQuoteToASCII(buf, s)); + } else { + f.pad(strconv.AppendQuote(buf, s)); + } + }; + fmt.prototype.fmtQ = function(s) { return this.$val.fmtQ(s); }; + fmt.ptr.prototype.fmtC = function(c) { + var buf, c, f, r, w; + f = this; + r = ((c.$low >> 0)); + if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { + r = 65533; + } + buf = $subslice(new sliceType$2(f.intbuf), 0, 0); + w = utf8.EncodeRune($subslice(buf, 0, 4), r); + f.pad($subslice(buf, 0, w)); + }; + fmt.prototype.fmtC = function(c) { return this.$val.fmtC(c); }; + fmt.ptr.prototype.fmtQc = function(c) { + var buf, c, f, r; + f = this; + r = ((c.$low >> 0)); + if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { + r = 65533; + } + buf = $subslice(new sliceType$2(f.intbuf), 0, 0); + if (f.fmtFlags.plus) { + f.pad(strconv.AppendQuoteRuneToASCII(buf, r)); + } else { + f.pad(strconv.AppendQuoteRune(buf, r)); + } + }; + fmt.prototype.fmtQc = function(c) { return this.$val.fmtQc(c); }; + fmt.ptr.prototype.fmtFloat = function(v, size, verb, prec) { + var _1, _2, digits, f, hasDecimalPoint, i, num, oldZero, prec, sawNonzeroDigit, size, tail, tailBuf, v, verb; + f = this; + if (f.fmtFlags.precPresent) { + prec = f.prec; + } + num = strconv.AppendFloat($subslice(new sliceType$2(f.intbuf), 0, 1), v, ((verb << 24 >>> 24)), prec, size); + if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 45) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 43)) { + num = $subslice(num, 1); + } else { + (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 43); + } + if (f.fmtFlags.space && ((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43) && !f.fmtFlags.plus) { + (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 32); + } + if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 73) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78)) { + oldZero = f.fmtFlags.zero; + f.fmtFlags.zero = false; + if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78) && !f.fmtFlags.space && !f.fmtFlags.plus) { + num = $subslice(num, 1); + } + f.pad(num); + f.fmtFlags.zero = oldZero; + return; + } + if (f.fmtFlags.sharp && !((verb === 98))) { + digits = 0; + _1 = verb; + if ((_1 === (118)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120))) { + digits = prec; + if (digits === -1) { + digits = 6; + } + } + tailBuf = arrayType$3.zero(); + tail = $subslice(new sliceType$2(tailBuf), 0, 0); + hasDecimalPoint = false; + sawNonzeroDigit = false; + i = 1; + while (true) { + if (!(i < num.$length)) { break; } + switch (0) { default: + _2 = ((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]); + if (_2 === (46)) { + hasDecimalPoint = true; + } else if ((_2 === (112)) || (_2 === (80))) { + tail = $appendSlice(tail, $subslice(num, i)); + num = $subslice(num, 0, i); + } else if ((_2 === (101)) || (_2 === (69))) { + if (!((verb === 120)) && !((verb === 88))) { + tail = $appendSlice(tail, $subslice(num, i)); + num = $subslice(num, 0, i); + break; + } + if (!((((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]) === 48))) { + sawNonzeroDigit = true; + } + if (sawNonzeroDigit) { + digits = digits - (1) >> 0; + } + } else { + if (!((((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]) === 48))) { + sawNonzeroDigit = true; + } + if (sawNonzeroDigit) { + digits = digits - (1) >> 0; + } + } + } + i = i + (1) >> 0; + } + if (!hasDecimalPoint) { + if ((num.$length === 2) && ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 48)) { + digits = digits - (1) >> 0; + } + num = $append(num, 46); + } + while (true) { + if (!(digits > 0)) { break; } + num = $append(num, 48); + digits = digits - (1) >> 0; + } + num = $appendSlice(num, tail); + } + if (f.fmtFlags.plus || !(((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43))) { + if (f.fmtFlags.zero && f.fmtFlags.widPresent && f.wid > num.$length) { + f.buf.writeByte((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0])); + f.writePadding(f.wid - num.$length >> 0); + f.buf.write($subslice(num, 1)); + return; + } + f.pad(num); + return; + } + f.pad($subslice(num, 1)); + }; + fmt.prototype.fmtFloat = function(v, size, verb, prec) { return this.$val.fmtFloat(v, size, verb, prec); }; + Errorf = function(format, a) { + var {_r, a, err, format, p, s, $s, $r, $c} = $restore(this, {format, a}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + p = _r; + p.wrapErrs = true; + $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + s = ($bytesToString(p.buf)); + err = $ifaceNil; + if ($interfaceIsEqual(p.wrappedErr, $ifaceNil)) { + err = errors.New(s); + } else { + err = new wrapError.ptr(s, p.wrappedErr); + } + p.free(); + $s = -1; return err; + /* */ } return; } var $f = {$blk: Errorf, $c: true, $r, _r, a, err, format, p, s, $s};return $f; + }; + $pkg.Errorf = Errorf; + wrapError.ptr.prototype.Error = function() { + var e; + e = this; + return e.msg; + }; + wrapError.prototype.Error = function() { return this.$val.Error(); }; + wrapError.ptr.prototype.Unwrap = function() { + var e; + e = this; + return e.err; + }; + wrapError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; + ptrType$4.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "getRune", name: "getRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "mustReadRune", name: "mustReadRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "error", name: "error", pkg: "fmt", typ: $funcType([$error], [], false)}, {prop: "errorString", name: "errorString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType$2, $error], false)}, {prop: "free", name: "free", pkg: "fmt", typ: $funcType([ssave], [], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "token", name: "token", pkg: "fmt", typ: $funcType([$Bool, funcType], [sliceType$2], false)}, {prop: "consume", name: "consume", pkg: "fmt", typ: $funcType([$String, $Bool], [$Bool], false)}, {prop: "peek", name: "peek", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "notEOF", name: "notEOF", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "accept", name: "accept", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "okVerb", name: "okVerb", pkg: "fmt", typ: $funcType([$Int32, $String, $String], [$Bool], false)}, {prop: "scanBool", name: "scanBool", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "getBase", name: "getBase", pkg: "fmt", typ: $funcType([$Int32], [$Int, $String], false)}, {prop: "scanNumber", name: "scanNumber", pkg: "fmt", typ: $funcType([$String, $Bool], [$String], false)}, {prop: "scanRune", name: "scanRune", pkg: "fmt", typ: $funcType([$Int], [$Int64], false)}, {prop: "scanBasePrefix", name: "scanBasePrefix", pkg: "fmt", typ: $funcType([], [$Int, $String, $Bool], false)}, {prop: "scanInt", name: "scanInt", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Int64], false)}, {prop: "scanUint", name: "scanUint", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Uint64], false)}, {prop: "floatToken", name: "floatToken", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "complexTokens", name: "complexTokens", pkg: "fmt", typ: $funcType([], [$String, $String], false)}, {prop: "convertFloat", name: "convertFloat", pkg: "fmt", typ: $funcType([$String, $Int], [$Float64], false)}, {prop: "scanComplex", name: "scanComplex", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Complex128], false)}, {prop: "convertString", name: "convertString", pkg: "fmt", typ: $funcType([$Int32], [$String], false)}, {prop: "quotedString", name: "quotedString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "hexByte", name: "hexByte", pkg: "fmt", typ: $funcType([], [$Uint8, $Bool], false)}, {prop: "hexString", name: "hexString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "scanPercent", name: "scanPercent", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "scanOne", name: "scanOne", pkg: "fmt", typ: $funcType([$Int32, $emptyInterface], [], false)}, {prop: "doScan", name: "doScan", pkg: "fmt", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "advance", name: "advance", pkg: "fmt", typ: $funcType([$String], [$Int], false)}, {prop: "doScanf", name: "doScanf", pkg: "fmt", typ: $funcType([$String, sliceType$1], [$Int, $error], false)}]; + ptrType$1.methods = [{prop: "write", name: "write", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "writeString", name: "writeString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "writeByte", name: "writeByte", pkg: "fmt", typ: $funcType([$Uint8], [], false)}, {prop: "writeRune", name: "writeRune", pkg: "fmt", typ: $funcType([$Int32], [], false)}]; + ptrType$24.methods = [{prop: "free", name: "free", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "unknownType", name: "unknownType", pkg: "fmt", typ: $funcType([reflect.Value], [], false)}, {prop: "badVerb", name: "badVerb", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "fmtBool", name: "fmtBool", pkg: "fmt", typ: $funcType([$Bool, $Int32], [], false)}, {prop: "fmt0x64", name: "fmt0x64", pkg: "fmt", typ: $funcType([$Uint64, $Bool], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Bool, $Int32], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32], [], false)}, {prop: "fmtComplex", name: "fmtComplex", pkg: "fmt", typ: $funcType([$Complex128, $Int, $Int32], [], false)}, {prop: "fmtString", name: "fmtString", pkg: "fmt", typ: $funcType([$String, $Int32], [], false)}, {prop: "fmtBytes", name: "fmtBytes", pkg: "fmt", typ: $funcType([sliceType$2, $Int32, $String], [], false)}, {prop: "fmtPointer", name: "fmtPointer", pkg: "fmt", typ: $funcType([reflect.Value, $Int32], [], false)}, {prop: "catchPanic", name: "catchPanic", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32, $String], [], false)}, {prop: "handleMethods", name: "handleMethods", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "printArg", name: "printArg", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "printValue", name: "printValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [], false)}, {prop: "argNumber", name: "argNumber", pkg: "fmt", typ: $funcType([$Int, $String, $Int, $Int], [$Int, $Int, $Bool], false)}, {prop: "badArgNum", name: "badArgNum", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "missingArg", name: "missingArg", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "doPrintf", name: "doPrintf", pkg: "fmt", typ: $funcType([$String, sliceType$1], [], false)}, {prop: "doPrint", name: "doPrint", pkg: "fmt", typ: $funcType([sliceType$1], [], false)}, {prop: "doPrintln", name: "doPrintln", pkg: "fmt", typ: $funcType([sliceType$1], [], false)}]; + ptrType$26.methods = [{prop: "clearflags", name: "clearflags", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "init", name: "init", pkg: "fmt", typ: $funcType([ptrType$1], [], false)}, {prop: "writePadding", name: "writePadding", pkg: "fmt", typ: $funcType([$Int], [], false)}, {prop: "pad", name: "pad", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "padString", name: "padString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtBoolean", name: "fmtBoolean", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "fmtUnicode", name: "fmtUnicode", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Int, $Bool, $Int32, $String], [], false)}, {prop: "truncateString", name: "truncateString", pkg: "fmt", typ: $funcType([$String], [$String], false)}, {prop: "truncate", name: "truncate", pkg: "fmt", typ: $funcType([sliceType$2], [sliceType$2], false)}, {prop: "fmtS", name: "fmtS", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtBs", name: "fmtBs", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "fmtSbx", name: "fmtSbx", pkg: "fmt", typ: $funcType([$String, sliceType$2, $String], [], false)}, {prop: "fmtSx", name: "fmtSx", pkg: "fmt", typ: $funcType([$String, $String], [], false)}, {prop: "fmtBx", name: "fmtBx", pkg: "fmt", typ: $funcType([sliceType$2, $String], [], false)}, {prop: "fmtQ", name: "fmtQ", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtC", name: "fmtC", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtQc", name: "fmtQc", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32, $Int], [], false)}]; + ptrType$27.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; + scanError.init("fmt", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); + ss.init("fmt", [{prop: "rs", name: "rs", embedded: false, exported: false, typ: io.RuneScanner, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "count", name: "count", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "atEOF", name: "atEOF", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ssave", name: "ssave", embedded: true, exported: false, typ: ssave, tag: ""}]); + ssave.init("fmt", [{prop: "validSave", name: "validSave", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsEnd", name: "nlIsEnd", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsSpace", name: "nlIsSpace", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "argLimit", name: "argLimit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "limit", name: "limit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "maxWid", name: "maxWid", embedded: false, exported: false, typ: $Int, tag: ""}]); State.init([{prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}]); Formatter.init([{prop: "Format", name: "Format", pkg: "", typ: $funcType([State, $Int32], [], false)}]); Stringer.init([{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); GoStringer.init([{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]); buffer.init($Uint8); - pp.init("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: reflect.Value, tag: ""}, {prop: "fmt", name: "fmt", embedded: false, exported: false, typ: fmt, tag: ""}, {prop: "reordered", name: "reordered", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "goodArgNum", name: "goodArgNum", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "panicking", name: "panicking", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "erroring", name: "erroring", embedded: false, exported: false, typ: $Bool, tag: ""}]); - scanError.init("fmt", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); - ss.init("fmt", [{prop: "rs", name: "rs", embedded: false, exported: false, typ: io.RuneScanner, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "count", name: "count", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "atEOF", name: "atEOF", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ssave", name: "ssave", embedded: true, exported: false, typ: ssave, tag: ""}]); - ssave.init("fmt", [{prop: "validSave", name: "validSave", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsEnd", name: "nlIsEnd", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsSpace", name: "nlIsSpace", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "argLimit", name: "argLimit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "limit", name: "limit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "maxWid", name: "maxWid", embedded: false, exported: false, typ: $Int, tag: ""}]); + pp.init("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: reflect.Value, tag: ""}, {prop: "fmt", name: "fmt", embedded: false, exported: false, typ: fmt, tag: ""}, {prop: "reordered", name: "reordered", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "goodArgNum", name: "goodArgNum", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "panicking", name: "panicking", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "erroring", name: "erroring", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wrapErrs", name: "wrapErrs", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wrappedErr", name: "wrappedErr", embedded: false, exported: false, typ: $error, tag: ""}]); + fmtFlags.init("fmt", [{prop: "widPresent", name: "widPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "precPresent", name: "precPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "minus", name: "minus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plus", name: "plus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharp", name: "sharp", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "space", name: "space", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "zero", name: "zero", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plusV", name: "plusV", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharpV", name: "sharpV", embedded: false, exported: false, typ: $Bool, tag: ""}]); + fmt.init("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "fmtFlags", name: "fmtFlags", embedded: true, exported: false, typ: fmtFlags, tag: ""}, {prop: "wid", name: "wid", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "prec", name: "prec", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "intbuf", name: "intbuf", embedded: false, exported: false, typ: arrayType$1, tag: ""}]); + wrapError.init("fmt", [{prop: "msg", name: "msg", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = os.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = reflect.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - ppFree = new sync.Pool.ptr(0, 0, sliceType.nil, (function() { - return new pp.ptr(buffer.nil, $ifaceNil, new reflect.Value.ptr(ptrType.nil, 0, 0), new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType.zero()), false, false, false, false); - })); - space = new sliceType$1([$toNativeArray($kindUint16, [9, 13]), $toNativeArray($kindUint16, [32, 32]), $toNativeArray($kindUint16, [133, 133]), $toNativeArray($kindUint16, [160, 160]), $toNativeArray($kindUint16, [5760, 5760]), $toNativeArray($kindUint16, [8192, 8202]), $toNativeArray($kindUint16, [8232, 8233]), $toNativeArray($kindUint16, [8239, 8239]), $toNativeArray($kindUint16, [8287, 8287]), $toNativeArray($kindUint16, [12288, 12288])]); - ssFree = new sync.Pool.ptr(0, 0, sliceType.nil, (function() { + $r = fmtsort.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = os.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = reflect.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + space = new sliceType([$toNativeArray($kindUint16, [9, 13]), $toNativeArray($kindUint16, [32, 32]), $toNativeArray($kindUint16, [133, 133]), $toNativeArray($kindUint16, [160, 160]), $toNativeArray($kindUint16, [5760, 5760]), $toNativeArray($kindUint16, [8192, 8202]), $toNativeArray($kindUint16, [8232, 8233]), $toNativeArray($kindUint16, [8239, 8239]), $toNativeArray($kindUint16, [8287, 8287]), $toNativeArray($kindUint16, [12288, 12288])]); + ssFree = new sync.Pool.ptr(sliceType$1.nil, (function() { return new ss.ptr($ifaceNil, buffer.nil, 0, false, new ssave.ptr(false, false, false, 0, 0, 0)); })); complexError = errors.New("syntax error scanning complex number"); boolError = errors.New("syntax error scanning boolean"); + ppFree = new sync.Pool.ptr(sliceType$1.nil, (function() { + return new pp.ptr(buffer.nil, $ifaceNil, new reflect.Value.ptr(ptrType.nil, 0, 0), new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType$1.zero()), false, false, false, false, false, $ifaceNil); + })); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); -$packages["context"] = (function() { - var $pkg = {}, $init, errors, fmt, reflect, sync, time, Context, deadlineExceededError, emptyCtx, CancelFunc, canceler, cancelCtx, timerCtx, valueCtx, ptrType, structType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, sliceType, ptrType$5, chanType, chanType$1, mapType, background, todo, closedchan, x, Background, TODO, WithCancel, newCancelCtx, propagateCancel, parentCancelCtx, removeChild, init, WithDeadline, WithTimeout; - errors = $packages["errors"]; - fmt = $packages["fmt"]; - reflect = $packages["reflect"]; - sync = $packages["sync"]; - time = $packages["time"]; - Context = $pkg.Context = $newType(8, $kindInterface, "context.Context", true, "context", true, null); - deadlineExceededError = $pkg.deadlineExceededError = $newType(0, $kindStruct, "context.deadlineExceededError", true, "context", false, function() { - this.$val = this; - if (arguments.length === 0) { - return; - } - }); - emptyCtx = $pkg.emptyCtx = $newType(4, $kindInt, "context.emptyCtx", true, "context", false, null); - CancelFunc = $pkg.CancelFunc = $newType(4, $kindFunc, "context.CancelFunc", true, "context", true, null); - canceler = $pkg.canceler = $newType(8, $kindInterface, "context.canceler", true, "context", false, null); - cancelCtx = $pkg.cancelCtx = $newType(0, $kindStruct, "context.cancelCtx", true, "context", false, function(Context_, mu_, done_, children_, err_) { - this.$val = this; - if (arguments.length === 0) { - this.Context = $ifaceNil; - this.mu = new sync.Mutex.ptr(0, 0); - this.done = $chanNil; - this.children = false; - this.err = $ifaceNil; - return; - } - this.Context = Context_; - this.mu = mu_; - this.done = done_; - this.children = children_; - this.err = err_; - }); - timerCtx = $pkg.timerCtx = $newType(0, $kindStruct, "context.timerCtx", true, "context", false, function(cancelCtx_, timer_, deadline_) { - this.$val = this; - if (arguments.length === 0) { - this.cancelCtx = new cancelCtx.ptr($ifaceNil, new sync.Mutex.ptr(0, 0), $chanNil, false, $ifaceNil); - this.timer = ptrType$5.nil; - this.deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); - return; - } - this.cancelCtx = cancelCtx_; - this.timer = timer_; - this.deadline = deadline_; - }); - valueCtx = $pkg.valueCtx = $newType(0, $kindStruct, "context.valueCtx", true, "context", false, function(Context_, key_, val_) { - this.$val = this; - if (arguments.length === 0) { - this.Context = $ifaceNil; - this.key = $ifaceNil; - this.val = $ifaceNil; - return; - } - this.Context = Context_; - this.key = key_; - this.val = val_; - }); - ptrType = $ptrType(emptyCtx); - structType = $structType("", []); - ptrType$1 = $ptrType(time.Location); - ptrType$2 = $ptrType(cancelCtx); - ptrType$3 = $ptrType(timerCtx); - ptrType$4 = $ptrType(valueCtx); - sliceType = $sliceType($emptyInterface); - ptrType$5 = $ptrType(time.Timer); - chanType = $chanType(structType, false, true); - chanType$1 = $chanType(structType, false, false); - mapType = $mapType(canceler, structType); - deadlineExceededError.ptr.prototype.Error = function() { - return "context deadline exceeded"; - }; - deadlineExceededError.prototype.Error = function() { return this.$val.Error(); }; - deadlineExceededError.ptr.prototype.Timeout = function() { - return true; - }; - deadlineExceededError.prototype.Timeout = function() { return this.$val.Timeout(); }; - deadlineExceededError.ptr.prototype.Temporary = function() { - return true; - }; - deadlineExceededError.prototype.Temporary = function() { return this.$val.Temporary(); }; - $ptrType(emptyCtx).prototype.Deadline = function() { - var deadline, ok; - deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); - ok = false; - return [deadline, ok]; - }; - $ptrType(emptyCtx).prototype.Done = function() { - return $chanNil; - }; - $ptrType(emptyCtx).prototype.Err = function() { - return $ifaceNil; - }; - $ptrType(emptyCtx).prototype.Value = function(key) { - var key; - return $ifaceNil; - }; - $ptrType(emptyCtx).prototype.String = function() { - var _1, e; - e = this; - _1 = e; - if (_1 === (background)) { - return "context.Background"; - } else if (_1 === (todo)) { - return "context.TODO"; - } - return "unknown empty Context"; - }; - Background = function() { - return background; - }; - $pkg.Background = Background; - TODO = function() { - return todo; - }; - $pkg.TODO = TODO; - WithCancel = function(parent) { - var _tmp, _tmp$1, c, cancel, ctx, parent, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; c = $f.c; cancel = $f.cancel; ctx = $f.ctx; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = [c]; - ctx = $ifaceNil; - cancel = $throwNilPointerError; - c[0] = $clone(newCancelCtx(parent), cancelCtx); - $r = propagateCancel(parent, c[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _tmp = c[0]; - _tmp$1 = (function(c) { return function $b() { - var $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; - }; })(c); - ctx = _tmp; - cancel = _tmp$1; - $s = -1; return [ctx, cancel]; - /* */ } return; } if ($f === undefined) { $f = { $blk: WithCancel }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.c = c; $f.cancel = cancel; $f.ctx = ctx; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.WithCancel = WithCancel; - newCancelCtx = function(parent) { - var parent; - return new cancelCtx.ptr(parent, new sync.Mutex.ptr(0, 0), $chanNil, false, $ifaceNil); - }; - propagateCancel = function(parent, child) { - var _key, _r, _tuple, child, ok, p, parent, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r = $f._r; _tuple = $f._tuple; child = $f.child; ok = $f.ok; p = $f.p; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - child = [child]; - parent = [parent]; - _r = parent[0].Done(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (_r === $chanNil) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r === $chanNil) { */ case 1: - $s = -1; return; - /* } */ case 2: - _tuple = parentCancelCtx(parent[0]); - p = _tuple[0]; - ok = _tuple[1]; - /* */ if (ok) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (ok) { */ case 4: - $r = p.mu.Lock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ if (!($interfaceIsEqual(p.err, $ifaceNil))) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (!($interfaceIsEqual(p.err, $ifaceNil))) { */ case 8: - $r = child[0].cancel(false, p.err); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 10; continue; - /* } else { */ case 9: - if (p.children === false) { - p.children = {}; - } - _key = child[0]; (p.children || $throwRuntimeError("assignment to entry in nil map"))[canceler.keyFor(_key)] = { k: _key, v: new structType.ptr() }; - /* } */ case 10: - $r = p.mu.Unlock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 6; continue; - /* } else { */ case 5: - $go((function(child, parent) { return function $b() { - var _arg, _r$1, _r$2, _r$3, _r$4, _selection, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _selection = $f._selection; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$1 = parent[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = child[0].Done(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = $select([[_r$1], [_r$2]]); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _selection = _r$3; - /* */ if (_selection[0] === 0) { $s = 4; continue; } - /* */ if (_selection[0] === 1) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (_selection[0] === 0) { */ case 4: - _r$4 = parent[0].Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _arg = _r$4; - $r = child[0].cancel(false, _arg); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 6; continue; - /* } else if (_selection[0] === 1) { */ case 5: - /* } */ case 6: - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._arg = _arg; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._selection = _selection; $f.$s = $s; $f.$r = $r; return $f; - }; })(child, parent), []); - /* } */ case 6: - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: propagateCancel }; } $f._key = _key; $f._r = _r; $f._tuple = _tuple; $f.child = child; $f.ok = ok; $f.p = p; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; - }; - parentCancelCtx = function(parent) { - var _ref, c, c$1, c$2, c$3, parent; - while (true) { - _ref = parent; - if ($assertType(_ref, ptrType$2, true)[1]) { - c = _ref.$val; - return [c, true]; - } else if ($assertType(_ref, ptrType$3, true)[1]) { - c$1 = _ref.$val; - return [c$1.cancelCtx, true]; - } else if ($assertType(_ref, ptrType$4, true)[1]) { - c$2 = _ref.$val; - parent = c$2.Context; - } else { - c$3 = _ref; - return [ptrType$2.nil, false]; - } - } - }; - removeChild = function(parent, child) { - var _tuple, child, ok, p, parent, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; child = $f.child; ok = $f.ok; p = $f.p; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _tuple = parentCancelCtx(parent); - p = _tuple[0]; - ok = _tuple[1]; - if (!ok) { - $s = -1; return; - } - $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - if (!(p.children === false)) { - delete p.children[canceler.keyFor(child)]; - } - $r = p.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: removeChild }; } $f._tuple = _tuple; $f.child = child; $f.ok = ok; $f.p = p; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; - }; - init = function() { - $close(closedchan); - }; - cancelCtx.ptr.prototype.Done = function() { - var c, d, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; d = $f.d; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - if (c.done === $chanNil) { - c.done = new $Chan(structType, 0); - } - d = c.done; - $r = c.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return d; - /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.Done }; } $f.c = c; $f.d = d; $f.$s = $s; $f.$r = $r; return $f; - }; - cancelCtx.prototype.Done = function() { return this.$val.Done(); }; - cancelCtx.ptr.prototype.Err = function() { - var c, err, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - err = c.err; - $r = c.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.Err }; } $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; - }; - cancelCtx.prototype.Err = function() { return this.$val.Err(); }; - cancelCtx.ptr.prototype.String = function() { - var _r, c, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - _r = fmt.Sprintf("%v.WithCancel", new sliceType([c.Context])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.String }; } $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; - }; - cancelCtx.prototype.String = function() { return this.$val.String(); }; - cancelCtx.ptr.prototype.cancel = function(removeFromParent, err) { - var _entry, _i, _keys, _ref, c, child, err, removeFromParent, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; c = $f.c; child = $f.child; err = $f.err; removeFromParent = $f.removeFromParent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - if ($interfaceIsEqual(err, $ifaceNil)) { - $panic(new $String("context: internal error: missing cancel error")); - } - $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ if (!($interfaceIsEqual(c.err, $ifaceNil))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!($interfaceIsEqual(c.err, $ifaceNil))) { */ case 2: - $r = c.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* } */ case 3: - c.err = err; - if (c.done === $chanNil) { - c.done = closedchan; - } else { - $close(c.done); - } - _ref = c.children; - _i = 0; - _keys = $keys(_ref); - /* while (true) { */ case 5: - /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 6; continue; } - _entry = _ref[_keys[_i]]; - if (_entry === undefined) { - _i++; - /* continue; */ $s = 5; continue; - } - child = _entry.k; - $r = child.cancel(false, err); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _i++; - /* } */ $s = 5; continue; case 6: - c.children = false; - $r = c.mu.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ if (removeFromParent) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (removeFromParent) { */ case 9: - $r = removeChild(c.Context, c); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 10: - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.cancel }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f.c = c; $f.child = child; $f.err = err; $f.removeFromParent = removeFromParent; $f.$s = $s; $f.$r = $r; return $f; - }; - cancelCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; - WithDeadline = function(parent, d) { - var _r, _r$1, _tuple, c, cur, d, dur, ok, parent, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; cur = $f.cur; d = $f.d; dur = $f.dur; ok = $f.ok; parent = $f.parent; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - c = [c]; - _r = parent.Deadline(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - cur = $clone(_tuple[0], time.Time); - ok = _tuple[1]; - /* */ if (ok && $clone(cur, time.Time).Before($clone(d, time.Time))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (ok && $clone(cur, time.Time).Before($clone(d, time.Time))) { */ case 2: - _r$1 = WithCancel(parent); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* } */ case 3: - c[0] = new timerCtx.ptr($clone(newCancelCtx(parent), cancelCtx), ptrType$5.nil, $clone(d, time.Time)); - $r = propagateCancel(parent, c[0]); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - dur = time.Until($clone(d, time.Time)); - /* */ if ((dur.$high < 0 || (dur.$high === 0 && dur.$low <= 0))) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if ((dur.$high < 0 || (dur.$high === 0 && dur.$low <= 0))) { */ case 6: - $r = c[0].cancel(true, $pkg.DeadlineExceeded); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return [c[0], (function(c) { return function $b() { - var $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; - }; })(c)]; - /* } */ case 7: - $r = c[0].cancelCtx.mu.Lock(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(c[0].cancelCtx.mu, "Unlock"), []]); - if ($interfaceIsEqual(c[0].cancelCtx.err, $ifaceNil)) { - c[0].timer = time.AfterFunc(dur, (function(c) { return function $b() { - var $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = c[0].cancel(true, $pkg.DeadlineExceeded); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; - }; })(c)); - } - $s = -1; return [c[0], (function(c) { return function $b() { - var $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; - }; })(c)]; - /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $throwNilPointerError]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: WithDeadline }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.cur = cur; $f.d = d; $f.dur = dur; $f.ok = ok; $f.parent = parent; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - $pkg.WithDeadline = WithDeadline; - timerCtx.ptr.prototype.Deadline = function() { - var _tmp, _tmp$1, c, deadline, ok; - deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); - ok = false; - c = this; - _tmp = $clone(c.deadline, time.Time); - _tmp$1 = true; - time.Time.copy(deadline, _tmp); - ok = _tmp$1; - return [deadline, ok]; - }; - timerCtx.prototype.Deadline = function() { return this.$val.Deadline(); }; - timerCtx.ptr.prototype.String = function() { - var _r, c, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - _r = fmt.Sprintf("%v.WithDeadline(%s [%s])", new sliceType([c.cancelCtx.Context, (x$1 = c.deadline, new x$1.constructor.elem(x$1)), time.Until($clone(c.deadline, time.Time))])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: timerCtx.ptr.prototype.String }; } $f._r = _r; $f.c = c; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; - }; - timerCtx.prototype.String = function() { return this.$val.String(); }; - timerCtx.ptr.prototype.cancel = function(removeFromParent, err) { - var c, err, removeFromParent, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; err = $f.err; removeFromParent = $f.removeFromParent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - $r = c.cancelCtx.cancel(false, err); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ if (removeFromParent) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (removeFromParent) { */ case 2: - $r = removeChild(c.cancelCtx.Context, c); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 3: - $r = c.cancelCtx.mu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - if (!(c.timer === ptrType$5.nil)) { - c.timer.Stop(); - c.timer = ptrType$5.nil; - } - $r = c.cancelCtx.mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = -1; return; - /* */ } return; } if ($f === undefined) { $f = { $blk: timerCtx.ptr.prototype.cancel }; } $f.c = c; $f.err = err; $f.removeFromParent = removeFromParent; $f.$s = $s; $f.$r = $r; return $f; - }; - timerCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; - WithTimeout = function(parent, timeout) { - var _r, parent, timeout, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; parent = $f.parent; timeout = $f.timeout; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = WithDeadline(parent, $clone($clone(time.Now(), time.Time).Add(timeout), time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: WithTimeout }; } $f._r = _r; $f.parent = parent; $f.timeout = timeout; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.WithTimeout = WithTimeout; - valueCtx.ptr.prototype.String = function() { - var _r, c, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - _r = fmt.Sprintf("%v.WithValue(%#v, %#v)", new sliceType([c.Context, c.key, c.val])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: valueCtx.ptr.prototype.String }; } $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; - }; - valueCtx.prototype.String = function() { return this.$val.String(); }; - valueCtx.ptr.prototype.Value = function(key) { - var _r, c, key, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - if ($interfaceIsEqual(c.key, key)) { - $s = -1; return c.val; - } - _r = c.Context.Value(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: valueCtx.ptr.prototype.Value }; } $f._r = _r; $f.c = c; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; - }; - valueCtx.prototype.Value = function(key) { return this.$val.Value(key); }; - deadlineExceededError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; - ptrType.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$2.methods = [{prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; - ptrType$3.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; - ptrType$4.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]; - Context.init([{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]); - deadlineExceededError.init("", []); - CancelFunc.init([], [], false); - canceler.init([{prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]); - cancelCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "children", name: "children", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); - timerCtx.init("context", [{prop: "cancelCtx", name: "cancelCtx", embedded: true, exported: false, typ: cancelCtx, tag: ""}, {prop: "timer", name: "timer", embedded: false, exported: false, typ: ptrType$5, tag: ""}, {prop: "deadline", name: "deadline", embedded: false, exported: false, typ: time.Time, tag: ""}]); - valueCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "val", name: "val", embedded: false, exported: false, typ: $emptyInterface, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = fmt.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = reflect.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.Canceled = errors.New("context canceled"); - $pkg.DeadlineExceeded = (x = new deadlineExceededError.ptr(), new x.constructor.elem(x)); - background = $newDataPointer(0, ptrType); - todo = $newDataPointer(0, ptrType); - closedchan = new $Chan(structType, 0); - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["hash"] = (function() { - var $pkg = {}, $init, io, Hash, sliceType; - io = $packages["io"]; - Hash = $pkg.Hash = $newType(8, $kindInterface, "hash.Hash", true, "hash", true, null); - sliceType = $sliceType($Uint8); - Hash.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["crypto"] = (function() { - var $pkg = {}, $init, hash, io, strconv, funcType, sliceType$1, hashes, RegisterHash; - hash = $packages["hash"]; - io = $packages["io"]; - strconv = $packages["strconv"]; - funcType = $funcType([], [hash.Hash], false); - sliceType$1 = $sliceType(funcType); - RegisterHash = function(h, f) { - var f, h; - if (h >= 20) { - $panic(new $String("crypto: RegisterHash of unknown hash function")); - } - ((h < 0 || h >= hashes.$length) ? ($throwRuntimeError("index out of range"), undefined) : hashes.$array[hashes.$offset + h] = f); - }; - $pkg.RegisterHash = RegisterHash; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = hash.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - hashes = $makeSlice(sliceType$1, 20); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["crypto/md5"] = (function() { - var $pkg = {}, $init, crypto, errors, hash, runtime, digest, sliceType, arrayType, arrayType$1, arrayType$2, arrayType$3, arrayType$4, ptrType, ptrType$1, littleEndian, block, init, appendUint64, appendUint32, consumeUint64, consumeUint32, New, Sum, init$1, blockGeneric; - crypto = $packages["crypto"]; - errors = $packages["errors"]; - hash = $packages["hash"]; - runtime = $packages["runtime"]; - digest = $pkg.digest = $newType(0, $kindStruct, "md5.digest", true, "crypto/md5", false, function(s_, x_, nx_, len_) { - this.$val = this; - if (arguments.length === 0) { - this.s = arrayType.zero(); - this.x = arrayType$1.zero(); - this.nx = 0; - this.len = new $Uint64(0, 0); - return; - } - this.s = s_; - this.x = x_; - this.nx = nx_; - this.len = len_; - }); - sliceType = $sliceType($Uint8); - arrayType = $arrayType($Uint32, 4); - arrayType$1 = $arrayType($Uint8, 64); - arrayType$2 = $arrayType($Uint8, 16); - arrayType$3 = $arrayType($Uint8, 4); - arrayType$4 = $arrayType($Uint32, 16); - ptrType = $ptrType(arrayType$4); - ptrType$1 = $ptrType(digest); - init = function() { - crypto.RegisterHash(2, New); - }; - digest.ptr.prototype.Reset = function() { - var d; - d = this; - d.s[0] = 1732584193; - d.s[1] = 4023233417; - d.s[2] = 2562383102; - d.s[3] = 271733878; - d.nx = 0; - d.len = new $Uint64(0, 0); - }; - digest.prototype.Reset = function() { return this.$val.Reset(); }; - digest.ptr.prototype.MarshalBinary = function() { - var b, d; - d = this; - b = $makeSlice(sliceType, 0, 92); - b = $appendSlice(b, "md5\x01"); - b = appendUint32(b, d.s[0]); - b = appendUint32(b, d.s[1]); - b = appendUint32(b, d.s[2]); - b = appendUint32(b, d.s[3]); - b = $appendSlice(b, $subslice(new sliceType(d.x), 0, d.nx)); - b = $subslice(b, 0, ((b.$length + 64 >> 0) - d.nx >> 0)); - b = appendUint64(b, d.len); - return [b, $ifaceNil]; - }; - digest.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; - digest.ptr.prototype.UnmarshalBinary = function(b) { - var _r, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, d; - d = this; - if (b.$length < 4 || !(($bytesToString($subslice(b, 0, 4))) === "md5\x01")) { - return errors.New("crypto/md5: invalid hash state identifier"); - } - if (!((b.$length === 92))) { - return errors.New("crypto/md5: invalid hash state size"); - } - b = $subslice(b, 4); - _tuple = consumeUint32(b); - b = _tuple[0]; - d.s[0] = _tuple[1]; - _tuple$1 = consumeUint32(b); - b = _tuple$1[0]; - d.s[1] = _tuple$1[1]; - _tuple$2 = consumeUint32(b); - b = _tuple$2[0]; - d.s[2] = _tuple$2[1]; - _tuple$3 = consumeUint32(b); - b = _tuple$3[0]; - d.s[3] = _tuple$3[1]; - b = $subslice(b, $copySlice(new sliceType(d.x), b)); - _tuple$4 = consumeUint64(b); - b = _tuple$4[0]; - d.len = _tuple$4[1]; - d.nx = (_r = ((d.len.$low >> 0)) % 64, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); - return $ifaceNil; - }; - digest.prototype.UnmarshalBinary = function(b) { return this.$val.UnmarshalBinary(b); }; - appendUint64 = function(b, x) { - var a, b, x; - a = $toNativeArray($kindUint8, [(($shiftRightUint64(x, 56).$low << 24 >>> 24)), (($shiftRightUint64(x, 48).$low << 24 >>> 24)), (($shiftRightUint64(x, 40).$low << 24 >>> 24)), (($shiftRightUint64(x, 32).$low << 24 >>> 24)), (($shiftRightUint64(x, 24).$low << 24 >>> 24)), (($shiftRightUint64(x, 16).$low << 24 >>> 24)), (($shiftRightUint64(x, 8).$low << 24 >>> 24)), ((x.$low << 24 >>> 24))]); - return $appendSlice(b, new sliceType(a)); - }; - appendUint32 = function(b, x) { - var a, b, x; - a = $toNativeArray($kindUint8, [(((x >>> 24 >>> 0) << 24 >>> 24)), (((x >>> 16 >>> 0) << 24 >>> 24)), (((x >>> 8 >>> 0) << 24 >>> 24)), ((x << 24 >>> 24))]); - return $appendSlice(b, new sliceType(a)); - }; - consumeUint64 = function(b) { - var b, x, x$1, x$10, x$11, x$12, x$13, x$14, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); - x$14 = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$7 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); - return [$subslice(b, 8), x$14]; - }; - consumeUint32 = function(b) { - var b, x; - $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); - x = ((((((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >>> 0)) | ((((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 0)) << 24 >>> 0)) >>> 0; - return [$subslice(b, 4), x]; - }; - New = function() { - var d; - d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0)); - d.Reset(); - return d; - }; - $pkg.New = New; - digest.ptr.prototype.Size = function() { - var d; - d = this; - return 16; - }; - digest.prototype.Size = function() { return this.$val.Size(); }; - digest.ptr.prototype.BlockSize = function() { - var d; - d = this; - return 64; - }; - digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; - digest.ptr.prototype.Write = function(p) { - var d, err, n, n$1, nn, p, x, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; d = $f.d; err = $f.err; n = $f.n; n$1 = $f.n$1; nn = $f.nn; p = $f.p; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - nn = 0; - err = $ifaceNil; - d = this; - nn = p.$length; - d.len = (x = d.len, x$1 = (new $Uint64(0, nn)), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); - /* */ if (d.nx > 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (d.nx > 0) { */ case 1: - n = $copySlice($subslice(new sliceType(d.x), d.nx), p); - d.nx = d.nx + (n) >> 0; - /* */ if (d.nx === 64) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (d.nx === 64) { */ case 3: - $r = block(d, new sliceType(d.x)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - d.nx = 0; - /* } */ case 4: - p = $subslice(p, n); - /* } */ case 2: - /* */ if (p.$length >= 64) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (p.$length >= 64) { */ case 6: - n$1 = (p.$length & ~63) >> 0; - $r = block(d, $subslice(p, 0, n$1)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - p = $subslice(p, n$1); - /* } */ case 7: - if (p.$length > 0) { - d.nx = $copySlice(new sliceType(d.x), p); - } - $s = -1; return [nn, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Write }; } $f.d = d; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; - }; - digest.prototype.Write = function(p) { return this.$val.Write(p); }; - digest.ptr.prototype.Sum = function(in$1) { - var _r, d, d0, hash$1, in$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; d = $f.d; d0 = $f.d0; hash$1 = $f.hash$1; in$1 = $f.in$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - d = this; - d0 = $clone(d, digest); - _r = d0.checkSum(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - hash$1 = $clone(_r, arrayType$2); - $s = -1; return $appendSlice(in$1, new sliceType(hash$1)); - /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Sum }; } $f._r = _r; $f.d = d; $f.d0 = d0; $f.hash$1 = hash$1; $f.in$1 = in$1; $f.$s = $s; $f.$r = $r; return $f; - }; - digest.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; - digest.ptr.prototype.checkSum = function() { - var _i, _r, _r$1, _r$2, _ref, d, digest$1, i, i$1, len, s, tmp, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; d = $f.d; digest$1 = $f.digest$1; i = $f.i; i$1 = $f.i$1; len = $f.len; s = $f.s; tmp = $f.tmp; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - d = this; - len = d.len; - tmp = arrayType$1.zero(); - tmp[0] = 128; - /* */ if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { */ case 1: - _r = d.Write($subslice(new sliceType(tmp), 0, $flatten64((x$1 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$1.$high, 56 - x$1.$low))))); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - $s = 3; continue; - /* } else { */ case 2: - _r$1 = d.Write($subslice(new sliceType(tmp), 0, $flatten64((x$2 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$2.$high, 120 - x$2.$low))))); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - /* } */ case 3: - len = $shiftLeft64(len, (3)); - i = 0; - while (true) { - if (!(i < 8)) { break; } - ((i < 0 || i >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[i] = (($shiftRightUint64(len, ((8 * i >>> 0))).$low << 24 >>> 24))); - i = i + (1) >>> 0; - } - _r$2 = d.Write($subslice(new sliceType(tmp), 0, 8)); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$2; - if (!((d.nx === 0))) { - $panic(new $String("d.nx != 0")); - } - digest$1 = arrayType$2.zero(); - _ref = d.s; - _i = 0; - while (true) { - if (!(_i < 4)) { break; } - i$1 = _i; - s = ((_i < 0 || _i >= _ref.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref[_i]); - (x$3 = $imul(i$1, 4), ((x$3 < 0 || x$3 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$3] = ((s << 24 >>> 24)))); - (x$4 = ($imul(i$1, 4)) + 1 >> 0, ((x$4 < 0 || x$4 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$4] = (((s >>> 8 >>> 0) << 24 >>> 24)))); - (x$5 = ($imul(i$1, 4)) + 2 >> 0, ((x$5 < 0 || x$5 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$5] = (((s >>> 16 >>> 0) << 24 >>> 24)))); - (x$6 = ($imul(i$1, 4)) + 3 >> 0, ((x$6 < 0 || x$6 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$6] = (((s >>> 24 >>> 0) << 24 >>> 24)))); - _i++; - } - $s = -1; return digest$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.checkSum }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.d = d; $f.digest$1 = digest$1; $f.i = i; $f.i$1 = i$1; $f.len = len; $f.s = s; $f.tmp = tmp; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; - }; - digest.prototype.checkSum = function() { return this.$val.checkSum(); }; - Sum = function(data) { - var _r, _r$1, d, data, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; d = $f.d; data = $f.data; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0)); - d.Reset(); - _r = d.Write(data); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - _r$1 = d.checkSum(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Sum }; } $f._r = _r; $f._r$1 = _r$1; $f.d = d; $f.data = data; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Sum = Sum; - init$1 = function() { - var x, y; - x = 67305985; - y = $toNativeArray($kindUint8, [1, 2, 3, 4]); - littleEndian = $equal(x, y, arrayType$3); - }; - blockGeneric = function(dig, p) { - var X, _tmp, _tmp$1, _tmp$2, _tmp$3, a, aa, b, bb, c, cc, d, dd, dig, i, j, p, x, x$1, x$2, x$3, xbuf; - a = dig.s[0]; - b = dig.s[1]; - c = dig.s[2]; - d = dig.s[3]; - X = ptrType.nil; - xbuf = arrayType$4.zero(); - while (true) { - if (!(p.$length >= 64)) { break; } - _tmp = a; - _tmp$1 = b; - _tmp$2 = c; - _tmp$3 = d; - aa = _tmp; - bb = _tmp$1; - cc = _tmp$2; - dd = _tmp$3; - if (false) { - X = (($sliceToArray(p))); - } else if (littleEndian && ((((($sliceToArray(p))) & 3) >>> 0) === 0)) { - X = (($sliceToArray(p))); - } else { - X = xbuf; - j = 0; - i = 0; - while (true) { - if (!(i < 16)) { break; } - (x$3 = i & 15, X.nilCheck, ((x$3 < 0 || x$3 >= X.length) ? ($throwRuntimeError("index out of range"), undefined) : X[x$3] = ((((((((((j < 0 || j >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + j]) >>> 0)) | ((((x = j + 1 >> 0, ((x < 0 || x >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x])) >>> 0)) << 8 >>> 0)) >>> 0) | ((((x$1 = j + 2 >> 0, ((x$1 < 0 || x$1 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$1])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$2 = j + 3 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$2])) >>> 0)) << 24 >>> 0)) >>> 0))); - j = j + (4) >> 0; - i = i + (1) >> 0; - } - } - a = a + ((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[0]) >>> 0) + 3614090360 >>> 0)) >>> 0; - a = (((a << 7 >>> 0) | (a >>> 25 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[1]) >>> 0) + 3905402710 >>> 0)) >>> 0; - d = (((d << 12 >>> 0) | (d >>> 20 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[2]) >>> 0) + 606105819 >>> 0)) >>> 0; - c = (((c << 17 >>> 0) | (c >>> 15 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[3]) >>> 0) + 3250441966 >>> 0)) >>> 0; - b = (((b << 22 >>> 0) | (b >>> 10 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[4]) >>> 0) + 4118548399 >>> 0)) >>> 0; - a = (((a << 7 >>> 0) | (a >>> 25 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[5]) >>> 0) + 1200080426 >>> 0)) >>> 0; - d = (((d << 12 >>> 0) | (d >>> 20 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[6]) >>> 0) + 2821735955 >>> 0)) >>> 0; - c = (((c << 17 >>> 0) | (c >>> 15 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[7]) >>> 0) + 4249261313 >>> 0)) >>> 0; - b = (((b << 22 >>> 0) | (b >>> 10 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[8]) >>> 0) + 1770035416 >>> 0)) >>> 0; - a = (((a << 7 >>> 0) | (a >>> 25 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[9]) >>> 0) + 2336552879 >>> 0)) >>> 0; - d = (((d << 12 >>> 0) | (d >>> 20 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[10]) >>> 0) + 4294925233 >>> 0)) >>> 0; - c = (((c << 17 >>> 0) | (c >>> 15 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[11]) >>> 0) + 2304563134 >>> 0)) >>> 0; - b = (((b << 22 >>> 0) | (b >>> 10 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[12]) >>> 0) + 1804603682 >>> 0)) >>> 0; - a = (((a << 7 >>> 0) | (a >>> 25 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[13]) >>> 0) + 4254626195 >>> 0)) >>> 0; - d = (((d << 12 >>> 0) | (d >>> 20 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[14]) >>> 0) + 2792965006 >>> 0)) >>> 0; - c = (((c << 17 >>> 0) | (c >>> 15 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[15]) >>> 0) + 1236535329 >>> 0)) >>> 0; - b = (((b << 22 >>> 0) | (b >>> 10 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[1]) >>> 0) + 4129170786 >>> 0)) >>> 0; - a = (((a << 5 >>> 0) | (a >>> 27 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[6]) >>> 0) + 3225465664 >>> 0)) >>> 0; - d = (((d << 9 >>> 0) | (d >>> 23 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[11]) >>> 0) + 643717713 >>> 0)) >>> 0; - c = (((c << 14 >>> 0) | (c >>> 18 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[0]) >>> 0) + 3921069994 >>> 0)) >>> 0; - b = (((b << 20 >>> 0) | (b >>> 12 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[5]) >>> 0) + 3593408605 >>> 0)) >>> 0; - a = (((a << 5 >>> 0) | (a >>> 27 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[10]) >>> 0) + 38016083 >>> 0)) >>> 0; - d = (((d << 9 >>> 0) | (d >>> 23 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[15]) >>> 0) + 3634488961 >>> 0)) >>> 0; - c = (((c << 14 >>> 0) | (c >>> 18 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[4]) >>> 0) + 3889429448 >>> 0)) >>> 0; - b = (((b << 20 >>> 0) | (b >>> 12 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[9]) >>> 0) + 568446438 >>> 0)) >>> 0; - a = (((a << 5 >>> 0) | (a >>> 27 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[14]) >>> 0) + 3275163606 >>> 0)) >>> 0; - d = (((d << 9 >>> 0) | (d >>> 23 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[3]) >>> 0) + 4107603335 >>> 0)) >>> 0; - c = (((c << 14 >>> 0) | (c >>> 18 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[8]) >>> 0) + 1163531501 >>> 0)) >>> 0; - b = (((b << 20 >>> 0) | (b >>> 12 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + (X.nilCheck, X[13]) >>> 0) + 2850285829 >>> 0)) >>> 0; - a = (((a << 5 >>> 0) | (a >>> 27 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + (X.nilCheck, X[2]) >>> 0) + 4243563512 >>> 0)) >>> 0; - d = (((d << 9 >>> 0) | (d >>> 23 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + (X.nilCheck, X[7]) >>> 0) + 1735328473 >>> 0)) >>> 0; - c = (((c << 14 >>> 0) | (c >>> 18 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + (X.nilCheck, X[12]) >>> 0) + 2368359562 >>> 0)) >>> 0; - b = (((b << 20 >>> 0) | (b >>> 12 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((b ^ c) >>> 0) ^ d) >>> 0)) + (X.nilCheck, X[5]) >>> 0) + 4294588738 >>> 0)) >>> 0; - a = (((a << 4 >>> 0) | (a >>> 28 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((a ^ b) >>> 0) ^ c) >>> 0)) + (X.nilCheck, X[8]) >>> 0) + 2272392833 >>> 0)) >>> 0; - d = (((d << 11 >>> 0) | (d >>> 21 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((d ^ a) >>> 0) ^ b) >>> 0)) + (X.nilCheck, X[11]) >>> 0) + 1839030562 >>> 0)) >>> 0; - c = (((c << 16 >>> 0) | (c >>> 16 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((c ^ d) >>> 0) ^ a) >>> 0)) + (X.nilCheck, X[14]) >>> 0) + 4259657740 >>> 0)) >>> 0; - b = (((b << 23 >>> 0) | (b >>> 9 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((b ^ c) >>> 0) ^ d) >>> 0)) + (X.nilCheck, X[1]) >>> 0) + 2763975236 >>> 0)) >>> 0; - a = (((a << 4 >>> 0) | (a >>> 28 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((a ^ b) >>> 0) ^ c) >>> 0)) + (X.nilCheck, X[4]) >>> 0) + 1272893353 >>> 0)) >>> 0; - d = (((d << 11 >>> 0) | (d >>> 21 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((d ^ a) >>> 0) ^ b) >>> 0)) + (X.nilCheck, X[7]) >>> 0) + 4139469664 >>> 0)) >>> 0; - c = (((c << 16 >>> 0) | (c >>> 16 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((c ^ d) >>> 0) ^ a) >>> 0)) + (X.nilCheck, X[10]) >>> 0) + 3200236656 >>> 0)) >>> 0; - b = (((b << 23 >>> 0) | (b >>> 9 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((b ^ c) >>> 0) ^ d) >>> 0)) + (X.nilCheck, X[13]) >>> 0) + 681279174 >>> 0)) >>> 0; - a = (((a << 4 >>> 0) | (a >>> 28 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((a ^ b) >>> 0) ^ c) >>> 0)) + (X.nilCheck, X[0]) >>> 0) + 3936430074 >>> 0)) >>> 0; - d = (((d << 11 >>> 0) | (d >>> 21 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((d ^ a) >>> 0) ^ b) >>> 0)) + (X.nilCheck, X[3]) >>> 0) + 3572445317 >>> 0)) >>> 0; - c = (((c << 16 >>> 0) | (c >>> 16 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((c ^ d) >>> 0) ^ a) >>> 0)) + (X.nilCheck, X[6]) >>> 0) + 76029189 >>> 0)) >>> 0; - b = (((b << 23 >>> 0) | (b >>> 9 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((((b ^ c) >>> 0) ^ d) >>> 0)) + (X.nilCheck, X[9]) >>> 0) + 3654602809 >>> 0)) >>> 0; - a = (((a << 4 >>> 0) | (a >>> 28 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((((a ^ b) >>> 0) ^ c) >>> 0)) + (X.nilCheck, X[12]) >>> 0) + 3873151461 >>> 0)) >>> 0; - d = (((d << 11 >>> 0) | (d >>> 21 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((((d ^ a) >>> 0) ^ b) >>> 0)) + (X.nilCheck, X[15]) >>> 0) + 530742520 >>> 0)) >>> 0; - c = (((c << 16 >>> 0) | (c >>> 16 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((((c ^ d) >>> 0) ^ a) >>> 0)) + (X.nilCheck, X[2]) >>> 0) + 3299628645 >>> 0)) >>> 0; - b = (((b << 23 >>> 0) | (b >>> 9 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[0]) >>> 0) + 4096336452 >>> 0)) >>> 0; - a = (((a << 6 >>> 0) | (a >>> 26 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[7]) >>> 0) + 1126891415 >>> 0)) >>> 0; - d = (((d << 10 >>> 0) | (d >>> 22 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[14]) >>> 0) + 2878612391 >>> 0)) >>> 0; - c = (((c << 15 >>> 0) | (c >>> 17 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[5]) >>> 0) + 4237533241 >>> 0)) >>> 0; - b = (((b << 21 >>> 0) | (b >>> 11 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[12]) >>> 0) + 1700485571 >>> 0)) >>> 0; - a = (((a << 6 >>> 0) | (a >>> 26 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[3]) >>> 0) + 2399980690 >>> 0)) >>> 0; - d = (((d << 10 >>> 0) | (d >>> 22 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[10]) >>> 0) + 4293915773 >>> 0)) >>> 0; - c = (((c << 15 >>> 0) | (c >>> 17 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[1]) >>> 0) + 2240044497 >>> 0)) >>> 0; - b = (((b << 21 >>> 0) | (b >>> 11 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[8]) >>> 0) + 1873313359 >>> 0)) >>> 0; - a = (((a << 6 >>> 0) | (a >>> 26 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[15]) >>> 0) + 4264355552 >>> 0)) >>> 0; - d = (((d << 10 >>> 0) | (d >>> 22 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[6]) >>> 0) + 2734768916 >>> 0)) >>> 0; - c = (((c << 15 >>> 0) | (c >>> 17 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[13]) >>> 0) + 1309151649 >>> 0)) >>> 0; - b = (((b << 21 >>> 0) | (b >>> 11 >>> 0)) >>> 0) + c >>> 0; - a = a + ((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[4]) >>> 0) + 4149444226 >>> 0)) >>> 0; - a = (((a << 6 >>> 0) | (a >>> 26 >>> 0)) >>> 0) + b >>> 0; - d = d + ((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[11]) >>> 0) + 3174756917 >>> 0)) >>> 0; - d = (((d << 10 >>> 0) | (d >>> 22 >>> 0)) >>> 0) + a >>> 0; - c = c + ((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[2]) >>> 0) + 718787259 >>> 0)) >>> 0; - c = (((c << 15 >>> 0) | (c >>> 17 >>> 0)) >>> 0) + d >>> 0; - b = b + ((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + (X.nilCheck, X[9]) >>> 0) + 3951481745 >>> 0)) >>> 0; - b = (((b << 21 >>> 0) | (b >>> 11 >>> 0)) >>> 0) + c >>> 0; - a = a + (aa) >>> 0; - b = b + (bb) >>> 0; - c = c + (cc) >>> 0; - d = d + (dd) >>> 0; - p = $subslice(p, 64); - } - dig.s[0] = a; - dig.s[1] = b; - dig.s[2] = c; - dig.s[3] = d; - }; - ptrType$1.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType], [$error], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "checkSum", name: "checkSum", pkg: "crypto/md5", typ: $funcType([], [arrayType$2], false)}]; - digest.init("crypto/md5", [{prop: "s", name: "s", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "x", name: "x", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "nx", name: "nx", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uint64, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = crypto.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = errors.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = hash.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - littleEndian = false; - block = blockGeneric; - init(); - init$1(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["bytes"] = (function() { - var $pkg = {}, $init, errors, bytealg, io, unicode, utf8, errNegativeRead; +$packages["strings"] = (function() { + var $pkg = {}, $init, errors, js, bytealg, io, sync, unicode, utf8, Builder, sliceType, ptrType$1, sliceType$2, explode, genSplit, Split, Map, ToLower, Index, Count; errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; bytealg = $packages["internal/bytealg"]; io = $packages["io"]; + sync = $packages["sync"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; + Builder = $pkg.Builder = $newType(0, $kindStruct, "strings.Builder", true, "strings", true, function(addr_, buf_) { + this.$val = this; + if (arguments.length === 0) { + this.addr = ptrType$1.nil; + this.buf = sliceType$2.nil; + return; + } + this.addr = addr_; + this.buf = buf_; + }); + sliceType = $sliceType($String); + ptrType$1 = $ptrType(Builder); + sliceType$2 = $sliceType($Uint8); + explode = function(s, n) { + var _tuple, a, ch, i, l, n, s, size, x; + l = utf8.RuneCountInString(s); + if (n < 0 || n > l) { + n = l; + } + a = $makeSlice(sliceType, n); + i = 0; + while (true) { + if (!(i < (n - 1 >> 0))) { break; } + _tuple = utf8.DecodeRuneInString(s); + ch = _tuple[0]; + size = _tuple[1]; + ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, size)); + s = $substring(s, size); + if (ch === 65533) { + ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = "\xEF\xBF\xBD"); + } + i = i + (1) >> 0; + } + if (n > 0) { + (x = n - 1 >> 0, ((x < 0 || x >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + x] = s)); + } + return a; + }; + genSplit = function(s, sep, sepSave, n) { + var a, i, m, n, s, sep, sepSave; + if (n === 0) { + return sliceType.nil; + } + if (sep === "") { + return explode(s, n); + } + if (n < 0) { + n = Count(s, sep) + 1 >> 0; + } + a = $makeSlice(sliceType, n); + n = n - (1) >> 0; + i = 0; + while (true) { + if (!(i < n)) { break; } + m = Index(s, sep); + if (m < 0) { + break; + } + ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, (m + sepSave >> 0))); + s = $substring(s, (m + sep.length >> 0)); + i = i + (1) >> 0; + } + ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = s); + return $subslice(a, 0, (i + 1 >> 0)); + }; + Split = function(s, sep) { + var s, sep; + return genSplit(s, sep, 0, -1); + }; + $pkg.Split = Split; + Map = function(mapping, s) { + var {_i, _i$1, _r, _r$1, _ref, _ref$1, _rune, _rune$1, _tuple, b, c, c$1, i, mapping, r, r$1, s, width, $s, $r, $c} = $restore(this, {mapping, s}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + b = new Builder.ptr(ptrType$1.nil, sliceType$2.nil); + _ref = s; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } + _rune = $decodeRune(_ref, _i); + i = _i; + c = _rune[0]; + _r = mapping(c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + r = _r; + if ((r === c) && !((c === 65533))) { + _i += _rune[1]; + /* continue; */ $s = 1; continue; + } + width = 0; + if (c === 65533) { + _tuple = utf8.DecodeRuneInString($substring(s, i)); + c = _tuple[0]; + width = _tuple[1]; + if (!((width === 1)) && (r === c)) { + _i += _rune[1]; + /* continue; */ $s = 1; continue; + } + } else { + width = utf8.RuneLen(c); + } + b.Grow(s.length + 4 >> 0); + b.WriteString($substring(s, 0, i)); + if (r >= 0) { + b.WriteRune(r); + } + s = $substring(s, (i + width >> 0)); + /* break; */ $s = 2; continue; + case 2: + if (b.Cap() === 0) { + $s = -1; return s; + } + _ref$1 = s; + _i$1 = 0; + /* while (true) { */ case 4: + /* if (!(_i$1 < _ref$1.length)) { break; } */ if(!(_i$1 < _ref$1.length)) { $s = 5; continue; } + _rune$1 = $decodeRune(_ref$1, _i$1); + c$1 = _rune$1[0]; + _r$1 = mapping(c$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + r$1 = _r$1; + if (r$1 >= 0) { + if (r$1 < 128) { + b.WriteByte(((r$1 << 24 >>> 24))); + } else { + b.WriteRune(r$1); + } + } + _i$1 += _rune$1[1]; + $s = 4; continue; + case 5: + $s = -1; return b.String(); + /* */ } return; } var $f = {$blk: Map, $c: true, $r, _i, _i$1, _r, _r$1, _ref, _ref$1, _rune, _rune$1, _tuple, b, c, c$1, i, mapping, r, r$1, s, width, $s};return $f; + }; + $pkg.Map = Map; + ToLower = function(s) { + var {$24r, _r, _tmp, _tmp$1, b, c, c$1, hasUpper, i, i$1, isASCII, s, $s, $r, $c} = $restore(this, {s}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + _tmp = true; + _tmp$1 = false; + isASCII = _tmp; + hasUpper = _tmp$1; + i = 0; + while (true) { + if (!(i < s.length)) { break; } + c = s.charCodeAt(i); + if (c >= 128) { + isASCII = false; + break; + } + hasUpper = hasUpper || (65 <= c && c <= 90); + i = i + (1) >> 0; + } + if (isASCII) { + if (!hasUpper) { + $s = -1; return s; + } + b = new Builder.ptr(ptrType$1.nil, sliceType$2.nil); + b.Grow(s.length); + i$1 = 0; + while (true) { + if (!(i$1 < s.length)) { break; } + c$1 = s.charCodeAt(i$1); + if (65 <= c$1 && c$1 <= 90) { + c$1 = c$1 + (32) << 24 >>> 24; + } + b.WriteByte(c$1); + i$1 = i$1 + (1) >> 0; + } + $s = -1; return b.String(); + } + _r = Map(unicode.ToLower, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 2; case 2: return $24r; + /* */ } return; } var $f = {$blk: ToLower, $c: true, $r, $24r, _r, _tmp, _tmp$1, b, c, c$1, hasUpper, i, i$1, isASCII, s, $s};return $f; + }; + $pkg.ToLower = ToLower; + Index = function(s, sep) { + var s, sep; + return $parseInt(s.indexOf(sep)) >> 0; + }; + $pkg.Index = Index; + Count = function(s, sep) { + var n, pos, s, sep; + n = 0; + if ((sep.length === 0)) { + return utf8.RuneCountInString(s) + 1 >> 0; + } else if (sep.length > s.length) { + return 0; + } else if ((sep.length === s.length)) { + if (sep === s) { + return 1; + } + return 0; + } + while (true) { + pos = Index(s, sep); + if (pos === -1) { + break; + } + n = n + (1) >> 0; + s = $substring(s, (pos + sep.length >> 0)); + } + return n; + }; + $pkg.Count = Count; + Builder.ptr.prototype.String = function() { + var b; + b = this; + return ($bytesToString(b.buf)); + }; + Builder.prototype.String = function() { return this.$val.String(); }; + Builder.ptr.prototype.copyCheck = function() { + var b; + b = this; + if (b.addr === ptrType$1.nil) { + b.addr = b; + } else if (!(b.addr === b)) { + $panic(new $String("strings: illegal use of non-zero Builder copied by value")); + } + }; + Builder.prototype.copyCheck = function() { return this.$val.copyCheck(); }; + Builder.ptr.prototype.Len = function() { + var b; + b = this; + return b.buf.$length; + }; + Builder.prototype.Len = function() { return this.$val.Len(); }; + Builder.ptr.prototype.Cap = function() { + var b; + b = this; + return b.buf.$capacity; + }; + Builder.prototype.Cap = function() { return this.$val.Cap(); }; + Builder.ptr.prototype.Reset = function() { + var b; + b = this; + b.addr = ptrType$1.nil; + b.buf = sliceType$2.nil; + }; + Builder.prototype.Reset = function() { return this.$val.Reset(); }; + Builder.ptr.prototype.grow = function(n) { + var b, buf, n; + b = this; + buf = $makeSlice(sliceType$2, b.buf.$length, (($imul(2, b.buf.$capacity)) + n >> 0)); + $copySlice(buf, b.buf); + b.buf = buf; + }; + Builder.prototype.grow = function(n) { return this.$val.grow(n); }; + Builder.ptr.prototype.Grow = function(n) { + var b, n; + b = this; + b.copyCheck(); + if (n < 0) { + $panic(new $String("strings.Builder.Grow: negative count")); + } + if ((b.buf.$capacity - b.buf.$length >> 0) < n) { + b.grow(n); + } + }; + Builder.prototype.Grow = function(n) { return this.$val.Grow(n); }; + Builder.ptr.prototype.Write = function(p) { + var b, p; + b = this; + b.copyCheck(); + b.buf = $appendSlice(b.buf, p); + return [p.$length, $ifaceNil]; + }; + Builder.prototype.Write = function(p) { return this.$val.Write(p); }; + Builder.ptr.prototype.WriteByte = function(c) { + var b, c; + b = this; + b.copyCheck(); + b.buf = $append(b.buf, c); + return $ifaceNil; + }; + Builder.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; + Builder.ptr.prototype.WriteRune = function(r) { + var b, l, n, r; + b = this; + b.copyCheck(); + if (((r >>> 0)) < 128) { + b.buf = $append(b.buf, ((r << 24 >>> 24))); + return [1, $ifaceNil]; + } + l = b.buf.$length; + if ((b.buf.$capacity - l >> 0) < 4) { + b.grow(4); + } + n = utf8.EncodeRune($subslice(b.buf, l, (l + 4 >> 0)), r); + b.buf = $subslice(b.buf, 0, (l + n >> 0)); + return [n, $ifaceNil]; + }; + Builder.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; + Builder.ptr.prototype.WriteString = function(s) { + var b, s; + b = this; + b.copyCheck(); + b.buf = $appendSlice(b.buf, s); + return [s.length, $ifaceNil]; + }; + Builder.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; + ptrType$1.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "copyCheck", name: "copyCheck", pkg: "strings", typ: $funcType([], [], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "grow", name: "grow", pkg: "strings", typ: $funcType([$Int], [], false)}, {prop: "Grow", name: "Grow", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]; + Builder.init("strings", [{prop: "addr", name: "addr", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = bytealg.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = unicode.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.ErrTooLarge = errors.New("bytes.Buffer: too large"); - errNegativeRead = errors.New("bytes.Buffer: reader returned negative count from Read"); + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = bytealg.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unicode.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["encoding/hex"] = (function() { - var $pkg = {}, $init, bytes, errors, fmt, io, EncodedLen, Encode; - bytes = $packages["bytes"]; + var $pkg = {}, $init, errors, fmt, io, strings, EncodedLen, Encode; errors = $packages["errors"]; fmt = $packages["fmt"]; io = $packages["io"]; + strings = $packages["strings"]; EncodedLen = function(n) { var n; return $imul(n, 2); }; $pkg.EncodedLen = EncodedLen; Encode = function(dst, src) { - var _i, _ref, dst, i, src, v, x, x$1; + var _i, _ref, dst, j, src, v, x; + j = 0; _ref = src; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } - i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); - (x = $imul(i, 2), ((x < 0 || x >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x] = "0123456789abcdef".charCodeAt((v >>> 4 << 24 >>> 24)))); - (x$1 = ($imul(i, 2)) + 1 >> 0, ((x$1 < 0 || x$1 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x$1] = "0123456789abcdef".charCodeAt(((v & 15) >>> 0)))); + ((j < 0 || j >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + j] = "0123456789abcdef".charCodeAt((v >>> 4 << 24 >>> 24))); + (x = j + 1 >> 0, ((x < 0 || x >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x] = "0123456789abcdef".charCodeAt(((v & 15) >>> 0)))); + j = j + (2) >> 0; _i++; } return $imul(src.$length, 2); @@ -20460,10 +27528,10 @@ $packages["encoding/hex"] = (function() { $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = errors.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = fmt.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strings.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrLength = errors.New("encoding/hex: odd length hex string"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; @@ -20489,14 +27557,56 @@ $packages["github.com/johanbrandhorst/protobuf/grpcweb/grpcwebjs"] = (function() $pkg.$init = $init; return $pkg; })(); -$packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/codes"] = (function() { +$packages["google.golang.org/grpc/codes"] = (function() { var $pkg = {}, $init, fmt, strconv, Code, ptrType, sliceType, sliceType$1, strToCode; fmt = $packages["fmt"]; strconv = $packages["strconv"]; - Code = $pkg.Code = $newType(4, $kindUint32, "codes.Code", true, "github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/codes", true, null); + Code = $pkg.Code = $newType(4, $kindUint32, "codes.Code", true, "google.golang.org/grpc/codes", true, null); ptrType = $ptrType(Code); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($Uint8); + $ptrType(Code).prototype.UnmarshalJSON = function(b) { + var {$24r, $24r$1, $24r$2, _entry, _r, _r$1, _r$2, _tuple, _tuple$1, b, c, ci, err, jc, ok, $s, $r, $c} = $restore(this, {b}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + c = this; + if (($bytesToString(b)) === "null") { + $s = -1; return $ifaceNil; + } + /* */ if (c === ptrType.nil) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (c === ptrType.nil) { */ case 1: + _r = fmt.Errorf("nil receiver passed to UnmarshalJSON", sliceType.nil); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $24r = _r; + $s = 4; case 4: return $24r; + /* } */ case 2: + _tuple = strconv.ParseUint(($bytesToString(b)), 10, 32); + ci = _tuple[0]; + err = _tuple[1]; + /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 5: + /* */ if ((ci.$high > 0 || (ci.$high === 0 && ci.$low >= 17))) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if ((ci.$high > 0 || (ci.$high === 0 && ci.$low >= 17))) { */ case 7: + _r$1 = fmt.Errorf("invalid code: %q", new sliceType([ci])); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + $24r$1 = _r$1; + $s = 10; case 10: return $24r$1; + /* } */ case 8: + c.$set(((ci.$low >>> 0))); + $s = -1; return $ifaceNil; + /* } */ case 6: + _tuple$1 = (_entry = $mapIndex(strToCode,$String.keyFor(($bytesToString(b)))), _entry !== undefined ? [_entry.v, true] : [0, false]); + jc = _tuple$1[0]; + ok = _tuple$1[1]; + if (ok) { + c.$set(jc); + $s = -1; return $ifaceNil; + } + _r$2 = fmt.Errorf("invalid code: %q", new sliceType([new $String(($bytesToString(b)))])); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $24r$2 = _r$2; + $s = 12; case 12: return $24r$2; + /* */ } return; } var $f = {$blk: $ptrType(Code).prototype.UnmarshalJSON, $c: true, $r, $24r, $24r$1, $24r$2, _entry, _r, _r$1, _r$2, _tuple, _tuple$1, b, c, ci, err, jc, ok, $s};return $f; + }; Code.prototype.String = function() { var _1, c; c = this.$val; @@ -20540,30 +27650,6 @@ $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/cod } }; $ptrType(Code).prototype.String = function() { return new Code(this.$get()).String(); }; - $ptrType(Code).prototype.UnmarshalJSON = function(b) { - var _entry, _r, _r$1, _tuple, b, c, jc, ok, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; b = $f.b; c = $f.c; jc = $f.jc; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - c = this; - if (($bytesToString(b)) === "null") { - $s = -1; return $ifaceNil; - } - /* */ if (c === ptrType.nil) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (c === ptrType.nil) { */ case 1: - _r = fmt.Errorf("nil receiver passed to UnmarshalJSON", new sliceType([])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* } */ case 2: - _tuple = (_entry = strToCode[$String.keyFor(($bytesToString(b)))], _entry !== undefined ? [_entry.v, true] : [0, false]); - jc = _tuple[0]; - ok = _tuple[1]; - if (ok) { - c.$set(jc); - $s = -1; return $ifaceNil; - } - _r$1 = fmt.Errorf("invalid code: %q", new sliceType([new $String(($bytesToString(b)))])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - $s = -1; return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(Code).prototype.UnmarshalJSON }; } $f._entry = _entry; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.jc = jc; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; - }; Code.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType.methods = [{prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$1], [$error], false)}]; $init = function() { @@ -20577,259 +27663,36 @@ $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/cod $pkg.$init = $init; return $pkg; })(); -$packages["github.com/johanbrandhorst/protobuf/vendor/golang.org/x/net/context"] = (function() { - var $pkg = {}, $init, context, time, todo, background; +$packages["google.golang.org/grpc/metadata"] = (function() { + var $pkg = {}, $init, context, fmt, strings, MD, mdOutgoingKey, rawMD, sliceType, sliceType$1, sliceType$2, sliceType$3, Join, FromOutgoingContext; context = $packages["context"]; - time = $packages["time"]; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = context.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - todo = context.TODO(); - background = context.Background(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["strings"] = (function() { - var $pkg = {}, $init, errors, js, bytealg, io, unicode, utf8, sliceType, sliceType$1, Index, Count, explode, genSplit, Split, Map, ToLower; - errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - bytealg = $packages["internal/bytealg"]; - io = $packages["io"]; - unicode = $packages["unicode"]; - utf8 = $packages["unicode/utf8"]; - sliceType = $sliceType($Uint8); - sliceType$1 = $sliceType($String); - Index = function(s, sep) { - var s, sep; - return $parseInt(s.indexOf(sep)) >> 0; - }; - $pkg.Index = Index; - Count = function(s, sep) { - var n, pos, s, sep; - n = 0; - if ((sep.length === 0)) { - return utf8.RuneCountInString(s) + 1 >> 0; - } else if (sep.length > s.length) { - return 0; - } else if ((sep.length === s.length)) { - if (sep === s) { - return 1; - } - return 0; - } - while (true) { - pos = Index(s, sep); - if (pos === -1) { - break; - } - n = n + (1) >> 0; - s = $substring(s, (pos + sep.length >> 0)); - } - return n; - }; - $pkg.Count = Count; - explode = function(s, n) { - var _tuple, a, ch, i, l, n, s, size, x; - l = utf8.RuneCountInString(s); - if (n < 0 || n > l) { - n = l; - } - a = $makeSlice(sliceType$1, n); - i = 0; - while (true) { - if (!(i < (n - 1 >> 0))) { break; } - _tuple = utf8.DecodeRuneInString(s); - ch = _tuple[0]; - size = _tuple[1]; - ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, size)); - s = $substring(s, size); - if (ch === 65533) { - ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = "\xEF\xBF\xBD"); - } - i = i + (1) >> 0; - } - if (n > 0) { - (x = n - 1 >> 0, ((x < 0 || x >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + x] = s)); - } - return a; - }; - genSplit = function(s, sep, sepSave, n) { - var a, i, m, n, s, sep, sepSave; - if (n === 0) { - return sliceType$1.nil; - } - if (sep === "") { - return explode(s, n); - } - if (n < 0) { - n = Count(s, sep) + 1 >> 0; - } - a = $makeSlice(sliceType$1, n); - n = n - (1) >> 0; - i = 0; - while (true) { - if (!(i < n)) { break; } - m = Index(s, sep); - if (m < 0) { - break; - } - ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, (m + sepSave >> 0))); - s = $substring(s, (m + sep.length >> 0)); - i = i + (1) >> 0; - } - ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = s); - return $subslice(a, 0, (i + 1 >> 0)); - }; - Split = function(s, sep) { - var s, sep; - return genSplit(s, sep, 0, -1); - }; - $pkg.Split = Split; - Map = function(mapping, s) { - var _i, _i$1, _r, _r$1, _ref, _ref$1, _rune, _rune$1, _tuple, b, c, c$1, i, mapping, nb, nbytes, r, r$1, s, w, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _rune = $f._rune; _rune$1 = $f._rune$1; _tuple = $f._tuple; b = $f.b; c = $f.c; c$1 = $f.c$1; i = $f.i; mapping = $f.mapping; nb = $f.nb; nbytes = $f.nbytes; r = $f.r; r$1 = $f.r$1; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - b = sliceType.nil; - nbytes = 0; - _ref = s; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } - _rune = $decodeRune(_ref, _i); - i = _i; - c = _rune[0]; - _r = mapping(c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - r = _r; - if (r === c) { - _i += _rune[1]; - /* continue; */ $s = 1; continue; - } - b = $makeSlice(sliceType, (s.length + 4 >> 0)); - nbytes = $copyString(b, $substring(s, 0, i)); - if (r >= 0) { - if (r < 128) { - ((nbytes < 0 || nbytes >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + nbytes] = ((r << 24 >>> 24))); - nbytes = nbytes + (1) >> 0; - } else { - nbytes = nbytes + (utf8.EncodeRune($subslice(b, nbytes), r)) >> 0; - } - } - if (c === 65533) { - _tuple = utf8.DecodeRuneInString($substring(s, i)); - w = _tuple[1]; - i = i + (w) >> 0; - } else { - i = i + (utf8.RuneLen(c)) >> 0; - } - s = $substring(s, i); - /* break; */ $s = 2; continue; - /* } */ $s = 1; continue; case 2: - if (b === sliceType.nil) { - $s = -1; return s; - } - _ref$1 = s; - _i$1 = 0; - /* while (true) { */ case 4: - /* if (!(_i$1 < _ref$1.length)) { break; } */ if(!(_i$1 < _ref$1.length)) { $s = 5; continue; } - _rune$1 = $decodeRune(_ref$1, _i$1); - c$1 = _rune$1[0]; - _r$1 = mapping(c$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - r$1 = _r$1; - if ((0 <= r$1 && r$1 < 128) && nbytes < b.$length) { - ((nbytes < 0 || nbytes >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + nbytes] = ((r$1 << 24 >>> 24))); - nbytes = nbytes + (1) >> 0; - _i$1 += _rune$1[1]; - /* continue; */ $s = 4; continue; - } - if (r$1 >= 0) { - if ((nbytes + 4 >> 0) >= b.$length) { - nb = $makeSlice(sliceType, ($imul(2, b.$length))); - $copySlice(nb, $subslice(b, 0, nbytes)); - b = nb; - } - nbytes = nbytes + (utf8.EncodeRune($subslice(b, nbytes), r$1)) >> 0; - } - _i$1 += _rune$1[1]; - /* } */ $s = 4; continue; case 5: - $s = -1; return ($bytesToString($subslice(b, 0, nbytes))); - /* */ } return; } if ($f === undefined) { $f = { $blk: Map }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._rune = _rune; $f._rune$1 = _rune$1; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.c$1 = c$1; $f.i = i; $f.mapping = mapping; $f.nb = nb; $f.nbytes = nbytes; $f.r = r; $f.r$1 = r$1; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Map = Map; - ToLower = function(s) { - var _r, _tmp, _tmp$1, b, c, c$1, hasUpper, i, i$1, isASCII, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; b = $f.b; c = $f.c; c$1 = $f.c$1; hasUpper = $f.hasUpper; i = $f.i; i$1 = $f.i$1; isASCII = $f.isASCII; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _tmp = true; - _tmp$1 = false; - isASCII = _tmp; - hasUpper = _tmp$1; - i = 0; - while (true) { - if (!(i < s.length)) { break; } - c = s.charCodeAt(i); - if (c >= 128) { - isASCII = false; - break; - } - hasUpper = hasUpper || (c >= 65 && c <= 90); - i = i + (1) >> 0; - } - if (isASCII) { - if (!hasUpper) { - $s = -1; return s; - } - b = $makeSlice(sliceType, s.length); - i$1 = 0; - while (true) { - if (!(i$1 < s.length)) { break; } - c$1 = s.charCodeAt(i$1); - if (c$1 >= 65 && c$1 <= 90) { - c$1 = c$1 + (32) << 24 >>> 24; - } - ((i$1 < 0 || i$1 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i$1] = c$1); - i$1 = i$1 + (1) >> 0; - } - $s = -1; return ($bytesToString(b)); - } - _r = Map(unicode.ToLower, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $s = -1; return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: ToLower }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.b = b; $f.c = c; $f.c$1 = c$1; $f.hasUpper = hasUpper; $f.i = i; $f.i$1 = i$1; $f.isASCII = isASCII; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.ToLower = ToLower; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = bytealg.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = unicode.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/metadata"] = (function() { - var $pkg = {}, $init, fmt, context, strings, MD, mdOutgoingKey, sliceType, sliceType$2, Join, FromOutgoingContext; fmt = $packages["fmt"]; - context = $packages["github.com/johanbrandhorst/protobuf/vendor/golang.org/x/net/context"]; strings = $packages["strings"]; - MD = $pkg.MD = $newType(4, $kindMap, "metadata.MD", true, "github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/metadata", true, null); - mdOutgoingKey = $pkg.mdOutgoingKey = $newType(0, $kindStruct, "metadata.mdOutgoingKey", true, "github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/metadata", false, function() { + MD = $pkg.MD = $newType(4, $kindMap, "metadata.MD", true, "google.golang.org/grpc/metadata", true, null); + mdOutgoingKey = $pkg.mdOutgoingKey = $newType(0, $kindStruct, "metadata.mdOutgoingKey", true, "google.golang.org/grpc/metadata", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); + rawMD = $pkg.rawMD = $newType(0, $kindStruct, "metadata.rawMD", true, "google.golang.org/grpc/metadata", false, function(md_, added_) { + this.$val = this; + if (arguments.length === 0) { + this.md = false; + this.added = sliceType$3.nil; + return; + } + this.md = md_; + this.added = added_; + }); sliceType = $sliceType($String); + sliceType$1 = $sliceType($emptyInterface); sliceType$2 = $sliceType(MD); + sliceType$3 = $sliceType(sliceType); MD.prototype.Len = function() { var md; md = this.$val; - return $keys(md).length; + return (md ? md.size : 0); }; $ptrType(MD).prototype.Len = function() { return new MD(this.$get()).Len(); }; MD.prototype.Copy = function() { @@ -20838,8 +27701,46 @@ $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/met return Join(new sliceType$2([md])); }; $ptrType(MD).prototype.Copy = function() { return new MD(this.$get()).Copy(); }; + MD.prototype.Get = function(k) { + var {_entry, _r, k, md, $s, $r, $c} = $restore(this, {k}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + md = this.$val; + _r = strings.ToLower(k); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + k = _r; + $s = -1; return (_entry = $mapIndex(md,$String.keyFor(k)), _entry !== undefined ? _entry.v : sliceType.nil); + /* */ } return; } var $f = {$blk: MD.prototype.Get, $c: true, $r, _entry, _r, k, md, $s};return $f; + }; + $ptrType(MD).prototype.Get = function(k) { return new MD(this.$get()).Get(k); }; + MD.prototype.Set = function(k, vals) { + var {_key, _r, k, md, vals, $s, $r, $c} = $restore(this, {k, vals}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + md = this.$val; + if (vals.$length === 0) { + $s = -1; return; + } + _r = strings.ToLower(k); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + k = _r; + _key = k; (md || $throwRuntimeError("assignment to entry in nil map")).set($String.keyFor(_key), { k: _key, v: vals }); + $s = -1; return; + /* */ } return; } var $f = {$blk: MD.prototype.Set, $c: true, $r, _key, _r, k, md, vals, $s};return $f; + }; + $ptrType(MD).prototype.Set = function(k, vals) { return new MD(this.$get()).Set(k, vals); }; + MD.prototype.Append = function(k, vals) { + var {_entry, _key, _r, k, md, vals, $s, $r, $c} = $restore(this, {k, vals}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: + md = this.$val; + if (vals.$length === 0) { + $s = -1; return; + } + _r = strings.ToLower(k); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + k = _r; + _key = k; (md || $throwRuntimeError("assignment to entry in nil map")).set($String.keyFor(_key), { k: _key, v: $appendSlice((_entry = $mapIndex(md,$String.keyFor(k)), _entry !== undefined ? _entry.v : sliceType.nil), vals) }); + $s = -1; return; + /* */ } return; } var $f = {$blk: MD.prototype.Append, $c: true, $r, _entry, _key, _r, k, md, vals, $s};return $f; + }; + $ptrType(MD).prototype.Append = function(k, vals) { return new MD(this.$get()).Append(k, vals); }; Join = function(mds) { - var _entry, _entry$1, _i, _i$1, _key, _keys, _ref, _ref$1, k, md, mds, out, v; + var _entry, _entry$1, _i, _i$1, _key, _key$1, _keys, _ref, _ref$1, _size, k, md, mds, out, v; out = $makeMap($String.keyFor, []); _ref = mds; _i = 0; @@ -20848,17 +27749,19 @@ $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/met md = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _ref$1 = md; _i$1 = 0; - _keys = $keys(_ref$1); + _keys = _ref$1 ? _ref$1.keys() : undefined; + _size = _ref$1 ? _ref$1.size : 0; while (true) { - if (!(_i$1 < _keys.length)) { break; } - _entry = _ref$1[_keys[_i$1]]; + if (!(_i$1 < _size)) { break; } + _key = _keys.next().value; + _entry = _ref$1.get(_key); if (_entry === undefined) { _i$1++; continue; } k = _entry.k; v = _entry.v; - _key = k; (out || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $appendSlice((_entry$1 = out[$String.keyFor(k)], _entry$1 !== undefined ? _entry$1.v : sliceType.nil), v) }; + _key$1 = k; (out || $throwRuntimeError("assignment to entry in nil map")).set($String.keyFor(_key$1), { k: _key$1, v: $appendSlice((_entry$1 = $mapIndex(out,$String.keyFor(k)), _entry$1 !== undefined ? _entry$1.v : sliceType.nil), v) }); _i$1++; } _i++; @@ -20867,26 +27770,52 @@ $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/met }; $pkg.Join = Join; FromOutgoingContext = function(ctx) { - var _r, _tuple, ctx, md, ok, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ctx = $f.ctx; md = $f.md; ok = $f.ok; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - md = false; - ok = false; + var {_entry, _i, _key, _r, _r$1, _r$2, _r$3, _ref, _tuple, added, ctx, i, key, ok, out, raw, x, x$1, $s, $r, $c} = $restore(this, {ctx}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: _r = ctx.Value((x = new mdOutgoingKey.ptr(), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = $assertType(_r, MD, true); - md = _tuple[0]; + _tuple = $assertType(_r, rawMD, true); + raw = $clone(_tuple[0], rawMD); ok = _tuple[1]; - $s = -1; return [md, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: FromOutgoingContext }; } $f._r = _r; $f._tuple = _tuple; $f.ctx = ctx; $f.md = md; $f.ok = ok; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + if (!ok) { + $s = -1; return [false, false]; + } + out = new MD(raw.md).Copy(); + _ref = raw.added; + _i = 0; + /* while (true) { */ case 2: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } + added = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); + /* */ if ((_r$1 = added.$length % 2, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 1) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if ((_r$1 = added.$length % 2, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 1) { */ case 4: + _r$2 = fmt.Sprintf("metadata: FromOutgoingContext got an odd number of input pairs for metadata: %d", new sliceType$1([new $Int(added.$length)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $panic(new $String(_r$2)); + /* } */ case 5: + i = 0; + /* while (true) { */ case 7: + /* if (!(i < added.$length)) { break; } */ if(!(i < added.$length)) { $s = 8; continue; } + _r$3 = strings.ToLower(((i < 0 || i >= added.$length) ? ($throwRuntimeError("index out of range"), undefined) : added.$array[added.$offset + i])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + key = _r$3; + _key = key; (out || $throwRuntimeError("assignment to entry in nil map")).set($String.keyFor(_key), { k: _key, v: $append((_entry = $mapIndex(out,$String.keyFor(key)), _entry !== undefined ? _entry.v : sliceType.nil), (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= added.$length) ? ($throwRuntimeError("index out of range"), undefined) : added.$array[added.$offset + x$1]))) }); + i = i + (2) >> 0; + $s = 7; continue; + case 8: + _i++; + $s = 2; continue; + case 3: + $s = -1; return [out, ok]; + /* */ } return; } var $f = {$blk: FromOutgoingContext, $c: true, $r, _entry, _i, _key, _r, _r$1, _r$2, _r$3, _ref, _tuple, added, ctx, i, key, ok, out, raw, x, x$1, $s};return $f; }; $pkg.FromOutgoingContext = FromOutgoingContext; - MD.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Copy", name: "Copy", pkg: "", typ: $funcType([], [MD], false)}]; + MD.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Copy", name: "Copy", pkg: "", typ: $funcType([], [MD], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [sliceType], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, sliceType], [], true)}, {prop: "Append", name: "Append", pkg: "", typ: $funcType([$String, sliceType], [], true)}]; MD.init($String, sliceType); mdOutgoingKey.init("", []); + rawMD.init("google.golang.org/grpc/metadata", [{prop: "md", name: "md", embedded: false, exported: false, typ: MD, tag: ""}, {prop: "added", name: "added", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = fmt.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = context.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = context.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = fmt.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; @@ -20896,8 +27825,8 @@ $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/met $packages["github.com/johanbrandhorst/protobuf/grpcweb/status"] = (function() { var $pkg = {}, $init, grpcwebjs, codes, metadata, Status, ptrType, FromError; grpcwebjs = $packages["github.com/johanbrandhorst/protobuf/grpcweb/grpcwebjs"]; - codes = $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/codes"]; - metadata = $packages["github.com/johanbrandhorst/protobuf/vendor/google.golang.org/grpc/metadata"]; + codes = $packages["google.golang.org/grpc/codes"]; + metadata = $packages["google.golang.org/grpc/metadata"]; Status = $pkg.Status = $newType(0, $kindStruct, "status.Status", true, "github.com/johanbrandhorst/protobuf/grpcweb/status", true, function(Code_, Message_, Trailers_) { this.$val = this; if (arguments.length === 0) { @@ -20918,8 +27847,8 @@ $packages["github.com/johanbrandhorst/protobuf/grpcweb/status"] = (function() { }; Status.prototype.Error = function() { return this.$val.Error(); }; FromError = function(err) { - var _r, _tuple, err, ok, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + var {_r, _tuple, err, ok, s, $s, $r, $c} = $restore(this, {err}); + /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return ptrType.nil; } @@ -20933,7 +27862,7 @@ $packages["github.com/johanbrandhorst/protobuf/grpcweb/status"] = (function() { s = new Status.ptr(2, _r, false); /* } */ case 2: $s = -1; return s; - /* */ } return; } if ($f === undefined) { $f = { $blk: FromError }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + /* */ } return; } var $f = {$blk: FromError, $c: true, $r, _r, _tuple, err, ok, s, $s};return $f; }; $pkg.FromError = FromError; Status.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; @@ -20953,8 +27882,27 @@ $packages["github.com/johanbrandhorst/protobuf/grpcweb/status"] = (function() { !function(e,t){for(var r in t)e[r]=t[r]}(this,function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(module,exports,__webpack_require__){(function(global){var $jscomp={scope:{},getGlobal:function(e){return"undefined"!=typeof window&&window===e?e:void 0!==global?global:e}};$jscomp.global=$jscomp.getGlobal(this),$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol),$jscomp.initSymbol=function(){}},$jscomp.symbolCounter_=0,$jscomp.Symbol=function(e){return"jscomp_symbol_"+e+$jscomp.symbolCounter_++},$jscomp.initSymbolIterator=function(){$jscomp.initSymbol(),$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),$jscomp.initSymbolIterator=function(){}},$jscomp.makeIterator=function(e){$jscomp.initSymbolIterator(),$jscomp.initSymbol(),$jscomp.initSymbolIterator();var t=e[Symbol.iterator];if(t)return t.call(e);var r=0;return{next:function(){return rt;)--r in this?this[--e]=this[r]:delete this[e];return this},$jscomp.array.copyWithin$install=function(){$jscomp.array.installHelper_("copyWithin",$jscomp.array.copyWithin)},$jscomp.array.fill=function(e,t,r){var o=this.length||0;for(0>t&&(t=Math.max(0,o+t)),(null==r||r>o)&&(r=o),0>(r=Number(r))&&(r=Math.max(0,o+r)),t=Number(t||0);t>>0))return 32;var t=0;return 0==(4294901760&e)&&(e<<=16,t+=16),0==(4278190080&e)&&(e<<=8,t+=8),0==(4026531840&e)&&(e<<=4,t+=4),0==(3221225472&e)&&(e<<=2,t+=2),0==(2147483648&e)&&t++,t},$jscomp.math.imul=function(e,t){var r=65535&(e=Number(e)),o=65535&(t=Number(t));return r*o+((e>>>16&65535)*o+r*(t>>>16&65535)<<16>>>0)|0},$jscomp.math.sign=function(e){return 0===(e=Number(e))||isNaN(e)?e:0(e=Number(e))&&-.25(e=Number(e))&&-.25e?-t:t},$jscomp.math.acosh=function(e){return e=Number(e),Math.log(e+Math.sqrt(e*e-1))},$jscomp.math.asinh=function(e){if(0===(e=Number(e)))return e;var t=Math.log(Math.abs(e)+Math.sqrt(e*e+1));return 0>e?-t:t},$jscomp.math.atanh=function(e){return e=Number(e),($jscomp.math.log1p(e)-$jscomp.math.log1p(-e))/2},$jscomp.math.hypot=function(e,t,r){e=Number(e),t=Number(t);var o,n,s,i=Math.max(Math.abs(e),Math.abs(t));for(o=2;oi){for(s=(e/=i)*e+(t/=i)*t,o=2;oe?-t:t},$jscomp.math.cbrt=function(e){if(0===e)return e;e=Number(e);var t=Math.pow(Math.abs(e),1/3);return 0>e?-t:t},$jscomp.number=$jscomp.number||{},$jscomp.number.isFinite=function(e){return"number"==typeof e&&(!isNaN(e)&&1/0!==e&&-1/0!==e)},$jscomp.number.isInteger=function(e){return!!$jscomp.number.isFinite(e)&&e===Math.floor(e)},$jscomp.number.isNaN=function(e){return"number"==typeof e&&isNaN(e)},$jscomp.number.isSafeInteger=function(e){return $jscomp.number.isInteger(e)&&Math.abs(e)<=$jscomp.number.MAX_SAFE_INTEGER},$jscomp.number.EPSILON=Math.pow(2,-52),$jscomp.number.MAX_SAFE_INTEGER=9007199254740991,$jscomp.number.MIN_SAFE_INTEGER=-9007199254740991,$jscomp.object=$jscomp.object||{},$jscomp.object.assign=function(e,t){for(var r=1;ro||1114111=o?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode(o>>>10&1023|55296),t+=String.fromCharCode(1023&o|56320))}return t},$jscomp.string.repeat=function(e){var t=$jscomp.checkStringArgs(this,null,"repeat");if(0>e||1342177279>>=1)&&(t+=t);return r},$jscomp.string.repeat$install=function(){String.prototype.repeat||(String.prototype.repeat=$jscomp.string.repeat)},$jscomp.string.codePointAt=function(e){var t=$jscomp.checkStringArgs(this,null,"codePointAt"),r=t.length;if(0<=(e=Number(e)||0)&&eo||56319(e=t.charCodeAt(e+1))||57343=n},$jscomp.string.startsWith$install=function(){String.prototype.startsWith||(String.prototype.startsWith=$jscomp.string.startsWith)},$jscomp.string.endsWith=function(e,t){var r=$jscomp.checkStringArgs(this,e,"endsWith");e+="",void 0===t&&(t=r.length);for(var o=Math.max(0,Math.min(0|t,r.length)),n=e.length;0=n},$jscomp.string.endsWith$install=function(){String.prototype.endsWith||(String.prototype.endsWith=$jscomp.string.endsWith)};var COMPILED=!0,goog=goog||{};goog.global=this,goog.isDef=function(e){return void 0!==e},goog.exportPath_=function(e,t,r){e=e.split("."),r=r||goog.global,e[0]in r||!r.execScript||r.execScript("var "+e[0]);for(var o;e.length&&(o=e.shift());)!e.length&&goog.isDef(t)?r[o]=t:r=r[o]?r[o]:r[o]={}},goog.define=function(e,t){var r=t;COMPILED||(goog.global.CLOSURE_UNCOMPILED_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES,e)?r=goog.global.CLOSURE_UNCOMPILED_DEFINES[e]:goog.global.CLOSURE_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES,e)&&(r=goog.global.CLOSURE_DEFINES[e])),goog.exportPath_(e,r)},goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(!COMPILED&&goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){if(!COMPILED){delete goog.implicitNamespaces_[e];for(var r=e;(r=r.substring(0,r.lastIndexOf(".")))&&!goog.getObjectByName(r);)goog.implicitNamespaces_[r]=!0}goog.exportPath_(e,t)},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");if(goog.moduleLoaderState_.moduleName=e,!COMPILED){if(goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');delete goog.implicitNamespaces_[e]}},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){if(!COMPILED)return goog.isProvided_(e)?e in goog.loadedModules_?goog.loadedModules_[e]:goog.getObjectByName(e):null},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return null!=goog.moduleLoaderState_},goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},COMPILED||(goog.isProvided_=function(e){return e in goog.loadedModules_||!goog.implicitNamespaces_[e]&&goog.isDefAndNotNull(goog.getObjectByName(e))},goog.implicitNamespaces_={"goog.module":!0}),goog.getObjectByName=function(e,t){for(var r,o=e.split("."),n=t||goog.global;r=o.shift();){if(!goog.isDefAndNotNull(n[r]))return null;n=n[r]}return n},goog.globalize=function(e,t){var r,o=t||goog.global;for(r in e)o[r]=e[r]},goog.addDependency=function(e,t,r,o){if(goog.DEPENDENCIES_ENABLED){var n;e=e.replace(/\\/g,"/");for(var s=goog.dependencies_,i=0;n=t[i];i++)s.nameToPath[n]=e,s.pathIsModule[e]=!!o;for(o=0;t=r[o];o++)e in s.requires||(s.requires[e]={}),s.requires[e][t]=!0}},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){if(!COMPILED){if(goog.ENABLE_DEBUG_LOADER&&goog.IS_OLD_IE_&&goog.maybeProcessDeferredDep_(e),goog.isProvided_(e))return goog.isInModuleLoader_()?goog.module.getInternal_(e):null;if(goog.ENABLE_DEBUG_LOADER){var t=goog.getPathFromDeps_(e);if(t)return goog.writeScripts_(t),null}throw e="goog.require could not find: "+e,goog.logToConsole_(e),Error(e)}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER,goog.DEPENDENCIES_ENABLED&&(goog.dependencies_={pathIsModule:{},nameToPath:{},requires:{},visited:{},written:{},deferred:{}},goog.inHtmlDocument_=function(){var e=goog.global.document;return null!=e&&"write"in e},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var e=goog.global.document.getElementsByTagName("SCRIPT"),t=e.length-1;0<=t;--t){var r=e[t].src,o=-1==(o=r.lastIndexOf("?"))?r.length:o;if("base.js"==r.substr(o-7,7)){goog.basePath=r.substr(0,o-7);break}}},goog.importScript_=function(e,t){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_)(e,t)&&(goog.dependencies_.written[e]=!0)},goog.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.importModule_=function(e){goog.importScript_("",'goog.retrieveAndExecModule_("'+e+'");')&&(goog.dependencies_.written[e]=!0)},goog.queuedModules_=[],goog.wrapModule_=function(e,t){return goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(t+"\n//# sourceURL="+e+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+t+"\n;return exports});\n//# sourceURL="+e+"\n"},goog.loadQueuedModules_=function(){var e=goog.queuedModules_.length;if(0<\/script>')},goog.appendScriptSrcNode_=function(e){var t=goog.global.document,r=t.createElement("script");r.type="text/javascript",r.src=e,r.defer=!1,r.async=!1,t.head.appendChild(r)},goog.writeScriptTag_=function(e,t){if(goog.inHtmlDocument_()){var r=goog.global.document;if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&"complete"==r.readyState){if(/\bdeps.js$/.test(e))return!1;throw Error('Cannot write "'+e+'" after document load')}var o=goog.IS_OLD_IE_;return void 0===t?o?(o=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ",r.write('