blob: 6fd84e4a7113ab635afabe7456f27b40b8c26dec [file] [log] [blame]
(function() {
const __exports = {};
let wasm;
let cachegetUint8Memory = null;
function getUint8Memory() {
if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) {
cachegetUint8Memory = new Uint8Array(wasm.memory.buffer);
}
return cachegetUint8Memory;
}
let WASM_VECTOR_LEN = 0;
function passArray8ToWasm(arg) {
const ptr = wasm.__wbindgen_malloc(arg.length * 1);
getUint8Memory().set(arg, ptr / 1);
WASM_VECTOR_LEN = arg.length;
return ptr;
}
const heap = new Array(32);
heap.fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
let cachedTextEncoder = new TextEncoder('utf-8');
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
? function (arg, view) {
return cachedTextEncoder.encodeInto(arg, view);
}
: function (arg, view) {
const buf = cachedTextEncoder.encode(arg);
view.set(buf);
return {
read: arg.length,
written: buf.length
};
});
function passStringToWasm(arg) {
let len = arg.length;
let ptr = wasm.__wbindgen_malloc(len);
const mem = getUint8Memory();
let offset = 0;
for (; offset < len; offset++) {
const code = arg.charCodeAt(offset);
if (code > 0x7F) break;
mem[ptr + offset] = code;
}
if (offset !== len) {
if (offset !== 0) {
arg = arg.slice(offset);
}
ptr = wasm.__wbindgen_realloc(ptr, len, len = offset + arg.length * 3);
const view = getUint8Memory().subarray(ptr + offset, ptr + len);
const ret = encodeString(arg, view);
offset += ret.written;
}
WASM_VECTOR_LEN = offset;
return ptr;
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
function getStringFromWasm(ptr, len) {
return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));
}
/**
*/
class Resolver {
static __wrap(ptr) {
const obj = Object.create(Resolver.prototype);
obj.ptr = ptr;
return obj;
}
free() {
const ptr = this.ptr;
this.ptr = 0;
wasm.__wbg_resolver_free(ptr);
}
/**
* @param {Uint8Array} src
* @returns {Resolver}
*/
constructor(src) {
const ret = wasm.resolver_from_slice(passArray8ToWasm(src), WASM_VECTOR_LEN);
return Resolver.__wrap(ret);
}
/**
* @returns {any}
*/
listFiles() {
const ret = wasm.resolver_listFiles(this.ptr);
return takeObject(ret);
}
/**
* @returns {any}
*/
listMappings() {
const ret = wasm.resolver_listMappings(this.ptr);
return takeObject(ret);
}
/**
* @param {number} addr
* @returns {any}
*/
resolve(addr) {
const ret = wasm.resolver_resolve(this.ptr, addr);
return takeObject(ret);
}
/**
* @param {string} file
* @param {number} line
* @param {number} column
* @returns {any}
*/
resolveReverse(file, line, column) {
const ret = wasm.resolver_resolveReverse(this.ptr, passStringToWasm(file), WASM_VECTOR_LEN, line, column);
return takeObject(ret);
}
}
__exports.Resolver = Resolver;
function init(module) {
let result;
const imports = {};
imports.wbg = {};
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
};
imports.wbg.__wbg_new_8e4c496df8c98a76 = function(arg0, arg1, arg2, arg3, arg4) {
const ret = new SDK.SourceMapEntry(arg0 >>> 0, arg1 >>> 0, getObject(arg2), arg3 >>> 0, arg4 >>> 0);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm(arg0, arg1);
return addHeapObject(ret);
};
imports.wbg.__wbg_new_951e889c56bc7e3c = function() {
const ret = new Array();
return addHeapObject(ret);
};
imports.wbg.__wbg_push_36cde80dfc256d1d = function(arg0, arg1) {
const ret = getObject(arg0).push(getObject(arg1));
return ret;
};
imports.wbg.__wbg_new_4d5ae649984849e5 = function(arg0, arg1) {
const ret = new Error(getStringFromWasm(arg0, arg1));
return addHeapObject(ret);
};
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
throw new Error(getStringFromWasm(arg0, arg1));
};
imports.wbg.__wbindgen_rethrow = function(arg0) {
throw takeObject(arg0);
};
if ((typeof URL === 'function' && module instanceof URL) || typeof module === 'string' || (typeof Request === 'function' && module instanceof Request)) {
const response = fetch(module);
if (typeof WebAssembly.instantiateStreaming === 'function') {
result = WebAssembly.instantiateStreaming(response, imports)
.catch(e => {
return response
.then(r => {
if (r.headers.get('Content-Type') != 'application/wasm') {
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
return r.arrayBuffer();
} else {
throw e;
}
})
.then(bytes => WebAssembly.instantiate(bytes, imports));
});
} else {
result = response
.then(r => r.arrayBuffer())
.then(bytes => WebAssembly.instantiate(bytes, imports));
}
} else {
result = WebAssembly.instantiate(module, imports)
.then(result => {
if (result instanceof WebAssembly.Instance) {
return { instance: result, module };
} else {
return result;
}
});
}
return result.then(({instance, module}) => {
wasm = instance.exports;
init.__wbindgen_wasm_module = module;
return wasm;
});
}
self.wasm_bindgen = Object.assign(init, __exports);
})();