mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-28 06:55:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
128
webGl/my-threejs-test/node_modules/@parcel/source-map/README.md
generated
vendored
Normal file
128
webGl/my-threejs-test/node_modules/@parcel/source-map/README.md
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
# Parcel's source-map library
|
||||
|
||||
A source map library purpose-build for the Parcel bundler with a focus on fast combining and manipulating of source-maps.
|
||||
|
||||
To learn more about how sourcemaps are formatted and how they work, you can have a look at the [SourceMap Specification](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k).
|
||||
|
||||
## How to use this library?
|
||||
|
||||
If you want to use this library in your project or are looking to write a Parcel plugin with sourcemap support this should explain how you could get started.
|
||||
|
||||
For more information we have added doctypes to each function of the SourceMap class so you can have an in depth look at what everything does.
|
||||
|
||||
### Creating a SourceMap instance
|
||||
|
||||
You can create a sourcemap from another sourcemap or by creating it one mapping at a time.
|
||||
|
||||
#### Creating from existing sourcemap
|
||||
|
||||
To create a sourcemap from an existing sourcemap you have to ensure it is a JS Object first by asking for the object version from whichever transpiler you're running or by parsing the serialised map using `JSON.parse` or any other JSON parser.
|
||||
|
||||
After this you can call the function `addVLQMap(map, lineOffset, columnOffset)` this function takes in the parameters `map`, `lineOffset` and `columnOffset`. The map argument corresponds to the sourcemap object. The line and column offset are optional parameters used for offsetting the generated line and column. (this can be used when post-processing or wrapping the code linked to the sourcemap, in Parcel this is used when combining maps).
|
||||
|
||||
Example:
|
||||
|
||||
```JS
|
||||
import SourceMap from '@parcel/source-map';
|
||||
|
||||
const RAW_SOURCEMAP = {
|
||||
version: 3,
|
||||
file: "helloworld.js",
|
||||
sources: ["helloworld.coffee"],
|
||||
names: [],
|
||||
mappings: "AAAA;AAAA,EAAA,OAAO,CAAC,GAAR,CAAY,aAAZ,CAAA,CAAA;AAAA",
|
||||
};
|
||||
|
||||
let sourcemap = new SourceMap();
|
||||
sourcemap.addVLQMap(RAW_SOURCEMAP);
|
||||
|
||||
// This function removes the underlying references in the native code
|
||||
sourcemap.delete();
|
||||
```
|
||||
|
||||
#### Creating a sourcemap one mapping at a time
|
||||
|
||||
If you want to use this library to create a sourcemap from scratch you can, for this you can call the `addIndexedMapping(mapping, lineOffset, columnOffset)` function.
|
||||
|
||||
Example:
|
||||
|
||||
```JS
|
||||
import SourceMap from '@parcel/source-map';
|
||||
|
||||
let sourcemap = new SourceMap();
|
||||
|
||||
// Add a single mapping
|
||||
sourcemap.addIndexedMapping({
|
||||
generated: {
|
||||
// line index starts at 1
|
||||
line: 1,
|
||||
// column index starts at 0
|
||||
column: 4
|
||||
},
|
||||
original: {
|
||||
// line index starts at 1
|
||||
line: 1,
|
||||
// column index starts at 0
|
||||
column: 4
|
||||
},
|
||||
source: 'index.js',
|
||||
// Name is optional
|
||||
name: 'A'
|
||||
});
|
||||
|
||||
// This function removes the underlying references in the native code
|
||||
sourcemap.delete();
|
||||
```
|
||||
|
||||
### Caching
|
||||
|
||||
For caching sourcemaps we have a `toBuffer()` function which returns a buffer that can be saved on disk for later use and combining sourcemaps very quickly.
|
||||
|
||||
You can add a cached map to a SourceMap instance using the `addBuffer(buffer, lineOffset)` function, where you can also offset the generated line and column.
|
||||
|
||||
## Inspiration and purpose
|
||||
|
||||
### Why did we write this library
|
||||
|
||||
Parcel is a performance conscious bundler, and therefore we like to optimise Parcel's performance as much as possible.
|
||||
|
||||
Our original source-map implementation used mozilla's source-map and a bunch of javascript and had issues with memory usage and serialization times (we were keeping all mappings in memory using JS objects and write/read it using JSON for caching).
|
||||
|
||||
This implementation has been written from scratch in Rust minimizing the memory usage, by utilizing indexes for sources and names and optimizing serialization times by using Buffers instead of JSON for caching.
|
||||
|
||||
### Previous works and inspiration
|
||||
|
||||
Without these libraries this library wouldn't be as good as it is today. We've inspired and optimized our code using ideas and patterns used inside these libraries as well as used it to figure out how sourcemaps should be handled properly.
|
||||
|
||||
- [source-map by Mozilla](https://github.com/mozilla/source-map)
|
||||
- [source-map-mappings by Nick Fitzgerald](https://github.com/fitzgen/source-map-mappings)
|
||||
- [sourcemap-codec by Rich Harris](https://github.com/Rich-Harris/sourcemap-codec)
|
||||
|
||||
## Contributing to this library
|
||||
|
||||
All contributions to this library are welcome as is with any part of Parcel's vast collection of libraries and tools.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
To be able to build and work on this project you need to have the following tools installed:
|
||||
|
||||
- [`node.js`](https://nodejs.org/en/)
|
||||
- [`Rust`](https://rustup.rs/)
|
||||
|
||||
### Building the project
|
||||
|
||||
For development purposes you might want to build or rebuild the project, for this you need to build the N-API module and JS Code.
|
||||
|
||||
To do this run the following commands: (for more information about this you can have a look in `./package.json` and `./Makefile`)
|
||||
|
||||
```shell
|
||||
yarn transpile && yarn build:node
|
||||
```
|
||||
|
||||
### Tagging a release
|
||||
|
||||
Before you're able to tag a release ensure to have cargo-release installed `cargo install cargo-release`, we use it to tag the cargo files with a release tag.
|
||||
|
||||
```shell
|
||||
yarn tag-release <version>
|
||||
```
|
483
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/SourceMap.js
generated
vendored
Normal file
483
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/SourceMap.js
generated
vendored
Normal file
@@ -0,0 +1,483 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
var _package = require("../package.json");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
class SourceMap {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
/**
|
||||
* Construct a SourceMap instance
|
||||
*
|
||||
* @param projectRoot root directory of the project, this is to ensure all source paths are relative to this path
|
||||
*/
|
||||
constructor(projectRoot = '/', buffer) {
|
||||
_defineProperty(this, "sourceMapInstance", void 0);
|
||||
|
||||
_defineProperty(this, "projectRoot", void 0);
|
||||
} // Use this to invalidate saved buffers, we don't check versioning at all in Rust
|
||||
|
||||
|
||||
get libraryVersion() {
|
||||
return _package.version;
|
||||
}
|
||||
/**
|
||||
* Generates an empty map from the provided fileName and sourceContent
|
||||
*
|
||||
* @param sourceName path of the source file
|
||||
* @param sourceContent content of the source file
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
|
||||
|
||||
static generateEmptyMap({
|
||||
projectRoot,
|
||||
sourceName,
|
||||
sourceContent,
|
||||
lineOffset = 0
|
||||
}) {
|
||||
throw new Error('SourceMap.generateEmptyMap() must be implemented when extending SourceMap');
|
||||
}
|
||||
/**
|
||||
* Generates an empty map from the provided fileName and sourceContent
|
||||
*
|
||||
* @param sourceName path of the source file
|
||||
* @param sourceContent content of the source file
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
|
||||
|
||||
addEmptyMap(sourceName, sourceContent, lineOffset = 0) {
|
||||
this.sourceMapInstance.addEmptyMap(sourceName, sourceContent, lineOffset);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Appends raw VLQ mappings to the sourcemaps
|
||||
*/
|
||||
|
||||
|
||||
addVLQMap(map, lineOffset = 0, columnOffset = 0) {
|
||||
throw new Error('SourceMap.addVLQMap() must be implemented when extending SourceMap');
|
||||
}
|
||||
/**
|
||||
* Appends another sourcemap instance to this sourcemap
|
||||
*
|
||||
* @param buffer the sourcemap buffer that should get appended to this sourcemap
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
|
||||
|
||||
addSourceMap(sourcemap, lineOffset = 0) {
|
||||
throw new Error('Not implemented by child class');
|
||||
}
|
||||
/**
|
||||
* Appends a buffer to this sourcemap
|
||||
* Note: The buffer should be generated by this library
|
||||
* @param buffer the sourcemap buffer that should get appended to this sourcemap
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
|
||||
|
||||
addBuffer(buffer, lineOffset = 0) {
|
||||
throw new Error('Not implemented by child class');
|
||||
}
|
||||
/**
|
||||
* Appends a Mapping object to this sourcemap
|
||||
* Note: line numbers start at 1 due to mozilla's source-map library
|
||||
*
|
||||
* @param mapping the mapping that should be appended to this sourcemap
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
* @param columnOffset an offset that gets added to the sourceColumn index of each mapping
|
||||
*/
|
||||
|
||||
|
||||
addIndexedMapping(mapping, lineOffset = 0, columnOffset = 0) {
|
||||
// Not sure if it'll be worth it to add this back to C++, wrapping it in an array probably doesn't do that much harm in JS?
|
||||
// Also we barely use this function anyway...
|
||||
this.addIndexedMappings([mapping], lineOffset, columnOffset);
|
||||
}
|
||||
|
||||
_indexedMappingsToInt32Array(mappings, lineOffset = 0, columnOffset = 0) {
|
||||
// Encode all mappings into a single typed array and make one call
|
||||
// to C++ instead of one for each mapping to improve performance.
|
||||
let mappingBuffer = new Int32Array(mappings.length * 6);
|
||||
let sources = new Map();
|
||||
let names = new Map();
|
||||
let i = 0;
|
||||
|
||||
for (let mapping of mappings) {
|
||||
let hasValidOriginal = mapping.original && typeof mapping.original.line === 'number' && !isNaN(mapping.original.line) && typeof mapping.original.column === 'number' && !isNaN(mapping.original.column);
|
||||
mappingBuffer[i++] = mapping.generated.line + lineOffset - 1;
|
||||
mappingBuffer[i++] = mapping.generated.column + columnOffset; // $FlowFixMe
|
||||
|
||||
mappingBuffer[i++] = hasValidOriginal ? mapping.original.line - 1 : -1; // $FlowFixMe
|
||||
|
||||
mappingBuffer[i++] = hasValidOriginal ? mapping.original.column : -1;
|
||||
let sourceIndex = mapping.source ? sources.get(mapping.source) : -1;
|
||||
|
||||
if (sourceIndex == null) {
|
||||
// $FlowFixMe
|
||||
sourceIndex = this.addSource(mapping.source); // $FlowFixMe
|
||||
|
||||
sources.set(mapping.source, sourceIndex);
|
||||
}
|
||||
|
||||
mappingBuffer[i++] = sourceIndex;
|
||||
let nameIndex = mapping.name ? names.get(mapping.name) : -1;
|
||||
|
||||
if (nameIndex == null) {
|
||||
// $FlowFixMe
|
||||
nameIndex = this.addName(mapping.name); // $FlowFixMe
|
||||
|
||||
names.set(mapping.name, nameIndex);
|
||||
}
|
||||
|
||||
mappingBuffer[i++] = nameIndex;
|
||||
}
|
||||
|
||||
return mappingBuffer;
|
||||
}
|
||||
/**
|
||||
* Appends an array of Mapping objects to this sourcemap
|
||||
* This is useful when improving performance if a library provides the non-serialised mappings
|
||||
*
|
||||
* Note: This is only faster if they generate the serialised map lazily
|
||||
* Note: line numbers start at 1 due to mozilla's source-map library
|
||||
*
|
||||
* @param mappings an array of mapping objects
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
* @param columnOffset an offset that gets added to the sourceColumn index of each mapping
|
||||
*/
|
||||
|
||||
|
||||
addIndexedMappings(mappings, lineOffset = 0, columnOffset = 0) {
|
||||
let mappingBuffer = this._indexedMappingsToInt32Array(mappings, lineOffset, columnOffset);
|
||||
|
||||
this.sourceMapInstance.addIndexedMappings(mappingBuffer);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Appends a name to the sourcemap
|
||||
*
|
||||
* @param name the name that should be appended to the names array
|
||||
* @returns the index of the added name in the names array
|
||||
*/
|
||||
|
||||
|
||||
addName(name) {
|
||||
return this.sourceMapInstance.addName(name);
|
||||
}
|
||||
/**
|
||||
* Appends an array of names to the sourcemap's names array
|
||||
*
|
||||
* @param names an array of names to add to the sourcemap
|
||||
* @returns an array of indexes of the names in the sourcemap's names array, has the same order as the provided names array
|
||||
*/
|
||||
|
||||
|
||||
addNames(names) {
|
||||
return names.map(n => this.addName(n));
|
||||
}
|
||||
/**
|
||||
* Appends a source to the sourcemap's sources array
|
||||
*
|
||||
* @param source a filepath that should be appended to the sources array
|
||||
* @returns the index of the added source filepath in the sources array
|
||||
*/
|
||||
|
||||
|
||||
addSource(source) {
|
||||
return this.sourceMapInstance.addSource(source);
|
||||
}
|
||||
/**
|
||||
* Appends an array of sources to the sourcemap's sources array
|
||||
*
|
||||
* @param sources an array of filepaths which should sbe appended to the sources array
|
||||
* @returns an array of indexes of the sources that have been added to the sourcemap, returned in the same order as provided in the argument
|
||||
*/
|
||||
|
||||
|
||||
addSources(sources) {
|
||||
return sources.map(s => this.addSource(s));
|
||||
}
|
||||
/**
|
||||
* Get the index in the sources array for a certain source file filepath
|
||||
*
|
||||
* @param source the filepath of the source file
|
||||
*/
|
||||
|
||||
|
||||
getSourceIndex(source) {
|
||||
return this.sourceMapInstance.getSourceIndex(source);
|
||||
}
|
||||
/**
|
||||
* Get the source file filepath for a certain index of the sources array
|
||||
*
|
||||
* @param index the index of the source in the sources array
|
||||
*/
|
||||
|
||||
|
||||
getSource(index) {
|
||||
return this.sourceMapInstance.getSource(index);
|
||||
}
|
||||
/**
|
||||
* Get a list of all sources
|
||||
*/
|
||||
|
||||
|
||||
getSources() {
|
||||
return this.sourceMapInstance.getSources();
|
||||
}
|
||||
/**
|
||||
* Set the sourceContent for a certain file
|
||||
* this is optional and is only recommended for files that we cannot read in at the end when we serialise the sourcemap
|
||||
*
|
||||
* @param sourceName the path of the sourceFile
|
||||
* @param sourceContent the content of the sourceFile
|
||||
*/
|
||||
|
||||
|
||||
setSourceContent(sourceName, sourceContent) {
|
||||
return this.sourceMapInstance.setSourceContentBySource(sourceName, sourceContent);
|
||||
}
|
||||
/**
|
||||
* Get the content of a source file if it is inlined as part of the source-map
|
||||
*
|
||||
* @param sourceName filename
|
||||
*/
|
||||
|
||||
|
||||
getSourceContent(sourceName) {
|
||||
return this.sourceMapInstance.getSourceContentBySource(sourceName);
|
||||
}
|
||||
/**
|
||||
* Get a list of all sources
|
||||
*/
|
||||
|
||||
|
||||
getSourcesContent() {
|
||||
return this.sourceMapInstance.getSourcesContent();
|
||||
}
|
||||
/**
|
||||
* Get a map of the source and it's corresponding source content
|
||||
*/
|
||||
|
||||
|
||||
getSourcesContentMap() {
|
||||
let sources = this.getSources();
|
||||
let sourcesContent = this.getSourcesContent();
|
||||
let results = {};
|
||||
|
||||
for (let i = 0; i < sources.length; i++) {
|
||||
results[sources[i]] = sourcesContent[i] || null;
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
/**
|
||||
* Get the index in the names array for a certain name
|
||||
*
|
||||
* @param name the name you want to find the index of
|
||||
*/
|
||||
|
||||
|
||||
getNameIndex(name) {
|
||||
return this.sourceMapInstance.getNameIndex(name);
|
||||
}
|
||||
/**
|
||||
* Get the name for a certain index of the names array
|
||||
*
|
||||
* @param index the index of the name in the names array
|
||||
*/
|
||||
|
||||
|
||||
getName(index) {
|
||||
return this.sourceMapInstance.getName(index);
|
||||
}
|
||||
/**
|
||||
* Get a list of all names
|
||||
*/
|
||||
|
||||
|
||||
getNames() {
|
||||
return this.sourceMapInstance.getNames();
|
||||
}
|
||||
/**
|
||||
* Get a list of all mappings
|
||||
*/
|
||||
|
||||
|
||||
getMappings() {
|
||||
return this.sourceMapInstance.getMappings();
|
||||
}
|
||||
/**
|
||||
* Convert a Mapping object that uses indexes for name and source to the actual value of name and source
|
||||
*
|
||||
* Note: This is only used internally, should not be used externally and will probably eventually get
|
||||
* handled directly in C++ for improved performance
|
||||
*
|
||||
* @param index the Mapping that should get converted to a string-based Mapping
|
||||
*/
|
||||
|
||||
|
||||
indexedMappingToStringMapping(mapping) {
|
||||
if (!mapping) return mapping;
|
||||
|
||||
if (mapping.source != null && mapping.source > -1) {
|
||||
// $FlowFixMe
|
||||
mapping.source = this.getSource(mapping.source);
|
||||
}
|
||||
|
||||
if (mapping.name != null && mapping.name > -1) {
|
||||
// $FlowFixMe
|
||||
mapping.name = this.getName(mapping.name);
|
||||
} // $FlowFixMe
|
||||
|
||||
|
||||
return mapping;
|
||||
}
|
||||
/**
|
||||
* Remaps original positions from this map to the ones in the provided map
|
||||
*
|
||||
* This works by finding the closest generated mapping in the provided map
|
||||
* to original mappings of this map and remapping those to be the original
|
||||
* mapping of the provided map.
|
||||
*
|
||||
* @param buffer exported SourceMap as a buffer
|
||||
*/
|
||||
|
||||
|
||||
extends(buffer) {
|
||||
throw new Error('Should be implemented by extending');
|
||||
}
|
||||
/**
|
||||
* Returns an object with mappings, sources and names
|
||||
* This should only be used for tests, debugging and visualising sourcemaps
|
||||
*
|
||||
* Note: This is a fairly slow operation
|
||||
*/
|
||||
|
||||
|
||||
getMap() {
|
||||
return {
|
||||
mappings: this.getMappings(),
|
||||
sources: this.getSources(),
|
||||
sourcesContent: this.getSourcesContent(),
|
||||
names: this.getNames()
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Searches through the sourcemap and returns a mapping that is close to the provided generated line and column
|
||||
*
|
||||
* @param line the line in the generated code (starts at 1)
|
||||
* @param column the column in the generated code (starts at 0)
|
||||
*/
|
||||
|
||||
|
||||
findClosestMapping(line, column) {
|
||||
let mapping = this.sourceMapInstance.findClosestMapping(line - 1, column);
|
||||
|
||||
if (mapping) {
|
||||
let v = this.indexedMappingToStringMapping(mapping);
|
||||
return v;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Offset mapping lines from a certain position
|
||||
*
|
||||
* @param line the line in the generated code (starts at 1)
|
||||
* @param lineOffset the amount of lines to offset mappings by
|
||||
*/
|
||||
|
||||
|
||||
offsetLines(line, lineOffset) {
|
||||
if (line < 1 || line + lineOffset < 1) {
|
||||
throw new Error('Line has to be positive');
|
||||
}
|
||||
|
||||
if (lineOffset === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sourceMapInstance.offsetLines(line - 1, lineOffset);
|
||||
}
|
||||
/**
|
||||
* Offset mapping columns from a certain position
|
||||
*
|
||||
* @param line the line in the generated code (starts at 1)
|
||||
* @param column the column in the generated code (starts at 0)
|
||||
* @param columnOffset the amount of columns to offset mappings by
|
||||
*/
|
||||
|
||||
|
||||
offsetColumns(line, column, columnOffset) {
|
||||
if (line < 1 || column < 0 || column + columnOffset < 0) {
|
||||
throw new Error('Line and Column has to be positive');
|
||||
}
|
||||
|
||||
if (columnOffset === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sourceMapInstance.offsetColumns(line - 1, column, columnOffset);
|
||||
}
|
||||
/**
|
||||
* Returns a buffer that represents this sourcemap, used for caching
|
||||
*/
|
||||
|
||||
|
||||
toBuffer() {
|
||||
return this.sourceMapInstance.toBuffer();
|
||||
}
|
||||
/**
|
||||
* Returns a serialised map using VLQ Mappings
|
||||
*/
|
||||
|
||||
|
||||
toVLQ() {
|
||||
return this.sourceMapInstance.toVLQ();
|
||||
}
|
||||
/**
|
||||
* A function that has to be called at the end of the SourceMap's lifecycle to ensure all memory and native bindings get de-allocated
|
||||
*/
|
||||
|
||||
|
||||
delete() {
|
||||
throw new Error('SourceMap.delete() must be implemented when extending SourceMap');
|
||||
}
|
||||
/**
|
||||
* Returns a serialised map
|
||||
*
|
||||
* @param options options used for formatting the serialised map
|
||||
*/
|
||||
|
||||
|
||||
async stringify(options) {
|
||||
return (0, _utils.partialVlqMapToSourceMap)(this.toVLQ(), { ...options,
|
||||
rootDir: this.projectRoot || options.rootDir
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = SourceMap;
|
444
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/SourceMap.js.flow
generated
vendored
Normal file
444
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/SourceMap.js.flow
generated
vendored
Normal file
@@ -0,0 +1,444 @@
|
||||
// @flow
|
||||
import type { ParsedMap, VLQMap, SourceMapStringifyOptions, IndexedMapping, GenerateEmptyMapOptions } from './types';
|
||||
|
||||
import path from 'path';
|
||||
import { generateInlineMap, partialVlqMapToSourceMap } from './utils';
|
||||
import { version } from '../package.json';
|
||||
|
||||
export default class SourceMap {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
sourceMapInstance: any;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
projectRoot: string;
|
||||
|
||||
/**
|
||||
* Construct a SourceMap instance
|
||||
*
|
||||
* @param projectRoot root directory of the project, this is to ensure all source paths are relative to this path
|
||||
*/
|
||||
constructor(projectRoot: string = '/', buffer?: Buffer) {}
|
||||
|
||||
// Use this to invalidate saved buffers, we don't check versioning at all in Rust
|
||||
get libraryVersion(): string {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an empty map from the provided fileName and sourceContent
|
||||
*
|
||||
* @param sourceName path of the source file
|
||||
* @param sourceContent content of the source file
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
static generateEmptyMap({
|
||||
projectRoot,
|
||||
sourceName,
|
||||
sourceContent,
|
||||
lineOffset = 0,
|
||||
}: GenerateEmptyMapOptions): SourceMap {
|
||||
throw new Error('SourceMap.generateEmptyMap() must be implemented when extending SourceMap');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an empty map from the provided fileName and sourceContent
|
||||
*
|
||||
* @param sourceName path of the source file
|
||||
* @param sourceContent content of the source file
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
addEmptyMap(sourceName: string, sourceContent: string, lineOffset: number = 0): SourceMap {
|
||||
this.sourceMapInstance.addEmptyMap(sourceName, sourceContent, lineOffset);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends raw VLQ mappings to the sourcemaps
|
||||
*/
|
||||
addVLQMap(map: VLQMap, lineOffset: number = 0, columnOffset: number = 0): SourceMap {
|
||||
throw new Error('SourceMap.addVLQMap() must be implemented when extending SourceMap');
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends another sourcemap instance to this sourcemap
|
||||
*
|
||||
* @param buffer the sourcemap buffer that should get appended to this sourcemap
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
addSourceMap(sourcemap: SourceMap, lineOffset: number = 0): SourceMap {
|
||||
throw new Error('Not implemented by child class');
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a buffer to this sourcemap
|
||||
* Note: The buffer should be generated by this library
|
||||
* @param buffer the sourcemap buffer that should get appended to this sourcemap
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
*/
|
||||
addBuffer(buffer: Buffer, lineOffset: number = 0): SourceMap {
|
||||
throw new Error('Not implemented by child class');
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a Mapping object to this sourcemap
|
||||
* Note: line numbers start at 1 due to mozilla's source-map library
|
||||
*
|
||||
* @param mapping the mapping that should be appended to this sourcemap
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
* @param columnOffset an offset that gets added to the sourceColumn index of each mapping
|
||||
*/
|
||||
addIndexedMapping(mapping: IndexedMapping<string>, lineOffset?: number = 0, columnOffset?: number = 0): void {
|
||||
// Not sure if it'll be worth it to add this back to C++, wrapping it in an array probably doesn't do that much harm in JS?
|
||||
// Also we barely use this function anyway...
|
||||
this.addIndexedMappings([mapping], lineOffset, columnOffset);
|
||||
}
|
||||
|
||||
_indexedMappingsToInt32Array(
|
||||
mappings: Array<IndexedMapping<string>>,
|
||||
lineOffset?: number = 0,
|
||||
columnOffset?: number = 0
|
||||
): Int32Array {
|
||||
// Encode all mappings into a single typed array and make one call
|
||||
// to C++ instead of one for each mapping to improve performance.
|
||||
let mappingBuffer = new Int32Array(mappings.length * 6);
|
||||
let sources: Map<string, number> = new Map();
|
||||
let names: Map<string, number> = new Map();
|
||||
let i = 0;
|
||||
for (let mapping of mappings) {
|
||||
let hasValidOriginal =
|
||||
mapping.original &&
|
||||
typeof mapping.original.line === 'number' &&
|
||||
!isNaN(mapping.original.line) &&
|
||||
typeof mapping.original.column === 'number' &&
|
||||
!isNaN(mapping.original.column);
|
||||
|
||||
mappingBuffer[i++] = mapping.generated.line + lineOffset - 1;
|
||||
mappingBuffer[i++] = mapping.generated.column + columnOffset;
|
||||
// $FlowFixMe
|
||||
mappingBuffer[i++] = hasValidOriginal ? mapping.original.line - 1 : -1;
|
||||
// $FlowFixMe
|
||||
mappingBuffer[i++] = hasValidOriginal ? mapping.original.column : -1;
|
||||
|
||||
let sourceIndex = mapping.source ? sources.get(mapping.source) : -1;
|
||||
if (sourceIndex == null) {
|
||||
// $FlowFixMe
|
||||
sourceIndex = this.addSource(mapping.source);
|
||||
// $FlowFixMe
|
||||
sources.set(mapping.source, sourceIndex);
|
||||
}
|
||||
mappingBuffer[i++] = sourceIndex;
|
||||
|
||||
let nameIndex = mapping.name ? names.get(mapping.name) : -1;
|
||||
if (nameIndex == null) {
|
||||
// $FlowFixMe
|
||||
nameIndex = this.addName(mapping.name);
|
||||
// $FlowFixMe
|
||||
names.set(mapping.name, nameIndex);
|
||||
}
|
||||
mappingBuffer[i++] = nameIndex;
|
||||
}
|
||||
|
||||
return mappingBuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an array of Mapping objects to this sourcemap
|
||||
* This is useful when improving performance if a library provides the non-serialised mappings
|
||||
*
|
||||
* Note: This is only faster if they generate the serialised map lazily
|
||||
* Note: line numbers start at 1 due to mozilla's source-map library
|
||||
*
|
||||
* @param mappings an array of mapping objects
|
||||
* @param lineOffset an offset that gets added to the sourceLine index of each mapping
|
||||
* @param columnOffset an offset that gets added to the sourceColumn index of each mapping
|
||||
*/
|
||||
addIndexedMappings(
|
||||
mappings: Array<IndexedMapping<string>>,
|
||||
lineOffset?: number = 0,
|
||||
columnOffset?: number = 0
|
||||
): SourceMap {
|
||||
let mappingBuffer = this._indexedMappingsToInt32Array(mappings, lineOffset, columnOffset);
|
||||
this.sourceMapInstance.addIndexedMappings(mappingBuffer);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a name to the sourcemap
|
||||
*
|
||||
* @param name the name that should be appended to the names array
|
||||
* @returns the index of the added name in the names array
|
||||
*/
|
||||
addName(name: string): number {
|
||||
return this.sourceMapInstance.addName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an array of names to the sourcemap's names array
|
||||
*
|
||||
* @param names an array of names to add to the sourcemap
|
||||
* @returns an array of indexes of the names in the sourcemap's names array, has the same order as the provided names array
|
||||
*/
|
||||
addNames(names: Array<string>): Array<number> {
|
||||
return names.map((n) => this.addName(n));
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a source to the sourcemap's sources array
|
||||
*
|
||||
* @param source a filepath that should be appended to the sources array
|
||||
* @returns the index of the added source filepath in the sources array
|
||||
*/
|
||||
addSource(source: string): number {
|
||||
return this.sourceMapInstance.addSource(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an array of sources to the sourcemap's sources array
|
||||
*
|
||||
* @param sources an array of filepaths which should sbe appended to the sources array
|
||||
* @returns an array of indexes of the sources that have been added to the sourcemap, returned in the same order as provided in the argument
|
||||
*/
|
||||
addSources(sources: Array<string>): Array<number> {
|
||||
return sources.map((s) => this.addSource(s));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the index in the sources array for a certain source file filepath
|
||||
*
|
||||
* @param source the filepath of the source file
|
||||
*/
|
||||
getSourceIndex(source: string): number {
|
||||
return this.sourceMapInstance.getSourceIndex(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the source file filepath for a certain index of the sources array
|
||||
*
|
||||
* @param index the index of the source in the sources array
|
||||
*/
|
||||
getSource(index: number): string {
|
||||
return this.sourceMapInstance.getSource(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all sources
|
||||
*/
|
||||
getSources(): Array<string> {
|
||||
return this.sourceMapInstance.getSources();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sourceContent for a certain file
|
||||
* this is optional and is only recommended for files that we cannot read in at the end when we serialise the sourcemap
|
||||
*
|
||||
* @param sourceName the path of the sourceFile
|
||||
* @param sourceContent the content of the sourceFile
|
||||
*/
|
||||
setSourceContent(sourceName: string, sourceContent: string): void {
|
||||
return this.sourceMapInstance.setSourceContentBySource(sourceName, sourceContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the content of a source file if it is inlined as part of the source-map
|
||||
*
|
||||
* @param sourceName filename
|
||||
*/
|
||||
getSourceContent(sourceName: string): string | null {
|
||||
return this.sourceMapInstance.getSourceContentBySource(sourceName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all sources
|
||||
*/
|
||||
getSourcesContent(): Array<string | null> {
|
||||
return this.sourceMapInstance.getSourcesContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a map of the source and it's corresponding source content
|
||||
*/
|
||||
getSourcesContentMap(): { [key: string]: string | null } {
|
||||
let sources = this.getSources();
|
||||
let sourcesContent = this.getSourcesContent();
|
||||
let results = {};
|
||||
for (let i = 0; i < sources.length; i++) {
|
||||
results[sources[i]] = sourcesContent[i] || null;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the index in the names array for a certain name
|
||||
*
|
||||
* @param name the name you want to find the index of
|
||||
*/
|
||||
getNameIndex(name: string): number {
|
||||
return this.sourceMapInstance.getNameIndex(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name for a certain index of the names array
|
||||
*
|
||||
* @param index the index of the name in the names array
|
||||
*/
|
||||
getName(index: number): string {
|
||||
return this.sourceMapInstance.getName(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all names
|
||||
*/
|
||||
getNames(): Array<string> {
|
||||
return this.sourceMapInstance.getNames();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all mappings
|
||||
*/
|
||||
getMappings(): Array<IndexedMapping<number>> {
|
||||
return this.sourceMapInstance.getMappings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a Mapping object that uses indexes for name and source to the actual value of name and source
|
||||
*
|
||||
* Note: This is only used internally, should not be used externally and will probably eventually get
|
||||
* handled directly in C++ for improved performance
|
||||
*
|
||||
* @param index the Mapping that should get converted to a string-based Mapping
|
||||
*/
|
||||
indexedMappingToStringMapping(mapping: ?IndexedMapping<number>): ?IndexedMapping<string> {
|
||||
if (!mapping) return mapping;
|
||||
|
||||
if (mapping.source != null && mapping.source > -1) {
|
||||
// $FlowFixMe
|
||||
mapping.source = this.getSource(mapping.source);
|
||||
}
|
||||
|
||||
if (mapping.name != null && mapping.name > -1) {
|
||||
// $FlowFixMe
|
||||
mapping.name = this.getName(mapping.name);
|
||||
}
|
||||
|
||||
// $FlowFixMe
|
||||
return mapping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remaps original positions from this map to the ones in the provided map
|
||||
*
|
||||
* This works by finding the closest generated mapping in the provided map
|
||||
* to original mappings of this map and remapping those to be the original
|
||||
* mapping of the provided map.
|
||||
*
|
||||
* @param buffer exported SourceMap as a buffer
|
||||
*/
|
||||
extends(buffer: Buffer | SourceMap): SourceMap {
|
||||
throw new Error('Should be implemented by extending');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object with mappings, sources and names
|
||||
* This should only be used for tests, debugging and visualising sourcemaps
|
||||
*
|
||||
* Note: This is a fairly slow operation
|
||||
*/
|
||||
getMap(): ParsedMap {
|
||||
return {
|
||||
mappings: this.getMappings(),
|
||||
sources: this.getSources(),
|
||||
sourcesContent: this.getSourcesContent(),
|
||||
names: this.getNames(),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches through the sourcemap and returns a mapping that is close to the provided generated line and column
|
||||
*
|
||||
* @param line the line in the generated code (starts at 1)
|
||||
* @param column the column in the generated code (starts at 0)
|
||||
*/
|
||||
findClosestMapping(line: number, column: number): ?IndexedMapping<string> {
|
||||
let mapping = this.sourceMapInstance.findClosestMapping(line - 1, column);
|
||||
if (mapping) {
|
||||
let v = this.indexedMappingToStringMapping(mapping);
|
||||
return v;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset mapping lines from a certain position
|
||||
*
|
||||
* @param line the line in the generated code (starts at 1)
|
||||
* @param lineOffset the amount of lines to offset mappings by
|
||||
*/
|
||||
offsetLines(line: number, lineOffset: number): ?IndexedMapping<string> {
|
||||
if (line < 1 || line + lineOffset < 1) {
|
||||
throw new Error('Line has to be positive');
|
||||
}
|
||||
|
||||
if (lineOffset === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sourceMapInstance.offsetLines(line - 1, lineOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset mapping columns from a certain position
|
||||
*
|
||||
* @param line the line in the generated code (starts at 1)
|
||||
* @param column the column in the generated code (starts at 0)
|
||||
* @param columnOffset the amount of columns to offset mappings by
|
||||
*/
|
||||
offsetColumns(line: number, column: number, columnOffset: number): ?IndexedMapping<string> {
|
||||
if (line < 1 || column < 0 || column + columnOffset < 0) {
|
||||
throw new Error('Line and Column has to be positive');
|
||||
}
|
||||
|
||||
if (columnOffset === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sourceMapInstance.offsetColumns(line - 1, column, columnOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a buffer that represents this sourcemap, used for caching
|
||||
*/
|
||||
toBuffer(): Buffer {
|
||||
return this.sourceMapInstance.toBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a serialised map using VLQ Mappings
|
||||
*/
|
||||
toVLQ(): VLQMap {
|
||||
return this.sourceMapInstance.toVLQ();
|
||||
}
|
||||
|
||||
/**
|
||||
* A function that has to be called at the end of the SourceMap's lifecycle to ensure all memory and native bindings get de-allocated
|
||||
*/
|
||||
delete() {
|
||||
throw new Error('SourceMap.delete() must be implemented when extending SourceMap');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a serialised map
|
||||
*
|
||||
* @param options options used for formatting the serialised map
|
||||
*/
|
||||
async stringify(options: SourceMapStringifyOptions): Promise<string | VLQMap> {
|
||||
return partialVlqMapToSourceMap(this.toVLQ(), {
|
||||
...options,
|
||||
rootDir: this.projectRoot || options.rootDir,
|
||||
});
|
||||
}
|
||||
}
|
87
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/node.js
generated
vendored
Normal file
87
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/node.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.init = exports.default = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _SourceMap = _interopRequireDefault(require("./SourceMap"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const bindings = require('../parcel_sourcemap_node/index');
|
||||
|
||||
class NodeSourceMap extends _SourceMap.default {
|
||||
constructor(projectRoot = '/', buffer) {
|
||||
super(projectRoot);
|
||||
this.projectRoot = projectRoot;
|
||||
this.sourceMapInstance = new bindings.SourceMap(projectRoot, buffer);
|
||||
}
|
||||
|
||||
addVLQMap(map, lineOffset = 0, columnOffset = 0) {
|
||||
let {
|
||||
sourcesContent,
|
||||
sources = [],
|
||||
mappings,
|
||||
names = []
|
||||
} = map;
|
||||
|
||||
if (!sourcesContent) {
|
||||
sourcesContent = sources.map(() => '');
|
||||
} else {
|
||||
sourcesContent = sourcesContent.map(content => content ? content : '');
|
||||
}
|
||||
|
||||
this.sourceMapInstance.addVLQMap(mappings, JSON.stringify(sources), JSON.stringify(sourcesContent.map(content => content ? content : '')), JSON.stringify(names), lineOffset, columnOffset);
|
||||
return this;
|
||||
}
|
||||
|
||||
addSourceMap(sourcemap, lineOffset = 0) {
|
||||
if (!(sourcemap.sourceMapInstance instanceof bindings.SourceMap)) {
|
||||
throw new Error('The sourcemap provided to addSourceMap is not a valid sourcemap instance');
|
||||
}
|
||||
|
||||
this.sourceMapInstance.addSourceMap(sourcemap.sourceMapInstance, lineOffset);
|
||||
return this;
|
||||
}
|
||||
|
||||
addBuffer(buffer, lineOffset = 0) {
|
||||
let previousMap = new NodeSourceMap(this.projectRoot, buffer);
|
||||
return this.addSourceMap(previousMap, lineOffset);
|
||||
}
|
||||
|
||||
extends(input) {
|
||||
// $FlowFixMe
|
||||
let inputSourceMap = Buffer.isBuffer(input) ? new NodeSourceMap(this.projectRoot, input) : input;
|
||||
this.sourceMapInstance.extends(inputSourceMap.sourceMapInstance);
|
||||
return this;
|
||||
}
|
||||
|
||||
getNames() {
|
||||
return JSON.parse(this.sourceMapInstance.getNames());
|
||||
}
|
||||
|
||||
getSources() {
|
||||
return JSON.parse(this.sourceMapInstance.getSources());
|
||||
}
|
||||
|
||||
delete() {}
|
||||
|
||||
static generateEmptyMap({
|
||||
projectRoot,
|
||||
sourceName,
|
||||
sourceContent,
|
||||
lineOffset = 0
|
||||
}) {
|
||||
let map = new NodeSourceMap(projectRoot);
|
||||
map.addEmptyMap(sourceName, sourceContent, lineOffset);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = NodeSourceMap;
|
||||
const init = Promise.resolve();
|
||||
exports.init = init;
|
76
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/node.js.flow
generated
vendored
Normal file
76
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/node.js.flow
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
// @flow
|
||||
import type { ParsedMap, VLQMap, SourceMapStringifyOptions, IndexedMapping, GenerateEmptyMapOptions } from './types';
|
||||
import path from 'path';
|
||||
import SourceMap from './SourceMap';
|
||||
|
||||
const bindings = require('../parcel_sourcemap_node/index');
|
||||
|
||||
export default class NodeSourceMap extends SourceMap {
|
||||
constructor(projectRoot: string = '/', buffer?: Buffer) {
|
||||
super(projectRoot);
|
||||
this.projectRoot = projectRoot;
|
||||
this.sourceMapInstance = new bindings.SourceMap(projectRoot, buffer);
|
||||
}
|
||||
|
||||
addVLQMap(map: VLQMap, lineOffset: number = 0, columnOffset: number = 0): SourceMap {
|
||||
let { sourcesContent, sources = [], mappings, names = [] } = map;
|
||||
if (!sourcesContent) {
|
||||
sourcesContent = sources.map(() => '');
|
||||
} else {
|
||||
sourcesContent = sourcesContent.map((content) => (content ? content : ''));
|
||||
}
|
||||
this.sourceMapInstance.addVLQMap(
|
||||
mappings,
|
||||
JSON.stringify(sources),
|
||||
JSON.stringify(sourcesContent.map((content) => (content ? content : ''))),
|
||||
JSON.stringify(names),
|
||||
lineOffset,
|
||||
columnOffset
|
||||
);
|
||||
return this;
|
||||
}
|
||||
|
||||
addSourceMap(sourcemap: SourceMap, lineOffset: number = 0): SourceMap {
|
||||
if (!(sourcemap.sourceMapInstance instanceof bindings.SourceMap)) {
|
||||
throw new Error('The sourcemap provided to addSourceMap is not a valid sourcemap instance');
|
||||
}
|
||||
|
||||
this.sourceMapInstance.addSourceMap(sourcemap.sourceMapInstance, lineOffset);
|
||||
return this;
|
||||
}
|
||||
|
||||
addBuffer(buffer: Buffer, lineOffset: number = 0): SourceMap {
|
||||
let previousMap = new NodeSourceMap(this.projectRoot, buffer);
|
||||
return this.addSourceMap(previousMap, lineOffset);
|
||||
}
|
||||
|
||||
extends(input: Buffer | SourceMap): SourceMap {
|
||||
// $FlowFixMe
|
||||
let inputSourceMap: SourceMap = Buffer.isBuffer(input) ? new NodeSourceMap(this.projectRoot, input) : input;
|
||||
this.sourceMapInstance.extends(inputSourceMap.sourceMapInstance);
|
||||
return this;
|
||||
}
|
||||
|
||||
getNames(): Array<string> {
|
||||
return JSON.parse(this.sourceMapInstance.getNames());
|
||||
}
|
||||
|
||||
getSources(): Array<string> {
|
||||
return JSON.parse(this.sourceMapInstance.getSources());
|
||||
}
|
||||
|
||||
delete() {}
|
||||
|
||||
static generateEmptyMap({
|
||||
projectRoot,
|
||||
sourceName,
|
||||
sourceContent,
|
||||
lineOffset = 0,
|
||||
}: GenerateEmptyMapOptions): NodeSourceMap {
|
||||
let map = new NodeSourceMap(projectRoot);
|
||||
map.addEmptyMap(sourceName, sourceContent, lineOffset);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
export const init: Promise<void> = Promise.resolve();
|
1
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/types.js
generated
vendored
Normal file
1
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";
|
52
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/types.js.flow
generated
vendored
Normal file
52
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/types.js.flow
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
// @flow
|
||||
export type MappingPosition = {|
|
||||
line: number,
|
||||
column: number,
|
||||
|};
|
||||
|
||||
export type IndexedMapping<T> = {
|
||||
generated: MappingPosition,
|
||||
original?: MappingPosition,
|
||||
source?: T,
|
||||
name?: T,
|
||||
...
|
||||
};
|
||||
|
||||
export type ParsedMap = {|
|
||||
sources: Array<string>,
|
||||
names: Array<string>,
|
||||
mappings: Array<IndexedMapping<number>>,
|
||||
sourcesContent: Array<string | null>,
|
||||
|};
|
||||
|
||||
export type VLQMap = {
|
||||
+sources: $ReadOnlyArray<string>,
|
||||
+sourcesContent?: $ReadOnlyArray<string | null>,
|
||||
+names: $ReadOnlyArray<string>,
|
||||
+mappings: string,
|
||||
+version?: number,
|
||||
+file?: string,
|
||||
+sourceRoot?: string,
|
||||
...
|
||||
};
|
||||
|
||||
export type SourceMapStringifyOptions = {
|
||||
file?: string,
|
||||
sourceRoot?: string,
|
||||
inlineSources?: boolean,
|
||||
fs?: { readFile(path: string, encoding: string): Promise<string>, ... },
|
||||
format?: 'inline' | 'string' | 'object',
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
rootDir?: string,
|
||||
...
|
||||
};
|
||||
|
||||
export type GenerateEmptyMapOptions = {
|
||||
projectRoot: string,
|
||||
sourceName: string,
|
||||
sourceContent: string,
|
||||
lineOffset?: number,
|
||||
...
|
||||
};
|
71
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/utils.js
generated
vendored
Normal file
71
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/utils.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.generateInlineMap = generateInlineMap;
|
||||
exports.partialVlqMapToSourceMap = partialVlqMapToSourceMap;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function generateInlineMap(map) {
|
||||
return `data:application/json;charset=utf-8;base64,${Buffer.from(map).toString('base64')}`;
|
||||
}
|
||||
|
||||
async function partialVlqMapToSourceMap(map, opts) {
|
||||
let {
|
||||
fs,
|
||||
file,
|
||||
sourceRoot,
|
||||
inlineSources,
|
||||
rootDir,
|
||||
format = 'string'
|
||||
} = opts;
|
||||
let resultMap = { ...map,
|
||||
sourcesContent: map.sourcesContent ? map.sourcesContent.map(content => {
|
||||
if (content) {
|
||||
return content;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}) : [],
|
||||
version: 3,
|
||||
file,
|
||||
sourceRoot
|
||||
};
|
||||
|
||||
if (resultMap.sourcesContent.length < resultMap.sources.length) {
|
||||
for (let i = 0; i <= resultMap.sources.length - resultMap.sourcesContent.length; i++) {
|
||||
resultMap.sourcesContent.push(null);
|
||||
}
|
||||
}
|
||||
|
||||
if (fs) {
|
||||
resultMap.sourcesContent = await Promise.all(resultMap.sourcesContent.map(async (content, index) => {
|
||||
let sourceName = map.sources[index]; // If sourceName starts with `..` it is outside rootDir, in this case we likely cannot access this file from the browser or packaged node_module
|
||||
// Because of this we have to include the sourceContent to ensure you can always see the sourcecontent for each mapping.
|
||||
|
||||
if (!content && (inlineSources || sourceName.startsWith('..'))) {
|
||||
try {
|
||||
return await fs.readFile(_path.default.resolve(rootDir || '/', sourceName), 'utf-8');
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return content;
|
||||
}));
|
||||
}
|
||||
|
||||
if (format === 'inline' || format === 'string') {
|
||||
let stringifiedMap = JSON.stringify(resultMap);
|
||||
|
||||
if (format === 'inline') {
|
||||
return generateInlineMap(stringifiedMap);
|
||||
}
|
||||
|
||||
return stringifiedMap;
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
60
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/utils.js.flow
generated
vendored
Normal file
60
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/utils.js.flow
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
// @flow
|
||||
import type { VLQMap, SourceMapStringifyOptions } from './types';
|
||||
import path from 'path';
|
||||
|
||||
export function generateInlineMap(map: string): string {
|
||||
return `data:application/json;charset=utf-8;base64,${Buffer.from(map).toString('base64')}`;
|
||||
}
|
||||
|
||||
export async function partialVlqMapToSourceMap(map: VLQMap, opts: SourceMapStringifyOptions): Promise<VLQMap | string> {
|
||||
let { fs, file, sourceRoot, inlineSources, rootDir, format = 'string' } = opts;
|
||||
|
||||
let resultMap = {
|
||||
...map,
|
||||
sourcesContent: map.sourcesContent
|
||||
? map.sourcesContent.map((content) => {
|
||||
if (content) {
|
||||
return content;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
: [],
|
||||
version: 3,
|
||||
file,
|
||||
sourceRoot,
|
||||
};
|
||||
|
||||
if (resultMap.sourcesContent.length < resultMap.sources.length) {
|
||||
for (let i = 0; i <= resultMap.sources.length - resultMap.sourcesContent.length; i++) {
|
||||
resultMap.sourcesContent.push(null);
|
||||
}
|
||||
}
|
||||
|
||||
if (fs) {
|
||||
resultMap.sourcesContent = await Promise.all(
|
||||
resultMap.sourcesContent.map(async (content, index): Promise<string | null> => {
|
||||
let sourceName = map.sources[index];
|
||||
// If sourceName starts with `..` it is outside rootDir, in this case we likely cannot access this file from the browser or packaged node_module
|
||||
// Because of this we have to include the sourceContent to ensure you can always see the sourcecontent for each mapping.
|
||||
if (!content && (inlineSources || sourceName.startsWith('..'))) {
|
||||
try {
|
||||
return await fs.readFile(path.resolve(rootDir || '/', sourceName), 'utf-8');
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return content;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (format === 'inline' || format === 'string') {
|
||||
let stringifiedMap = JSON.stringify(resultMap);
|
||||
if (format === 'inline') {
|
||||
return generateInlineMap(stringifiedMap);
|
||||
}
|
||||
return stringifiedMap;
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
23
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings-web.js
generated
vendored
Normal file
23
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings-web.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "SourceMap", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parcel_sourcemap_wasm.SourceMap;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "init", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parcel_sourcemap_wasm.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _parcel_sourcemap_wasm = _interopRequireWildcard(require("../parcel_sourcemap_wasm/dist-web/parcel_sourcemap_wasm.js"));
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
1
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings-web.js.flow
generated
vendored
Normal file
1
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings-web.js.flow
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { SourceMap, default as init } from '../parcel_sourcemap_wasm/dist-web/parcel_sourcemap_wasm.js';
|
13
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings.js
generated
vendored
Normal file
13
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "SourceMap", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parcel_sourcemap_wasm.SourceMap;
|
||||
}
|
||||
});
|
||||
|
||||
var _parcel_sourcemap_wasm = require("../parcel_sourcemap_wasm/dist-node/parcel_sourcemap_wasm.js");
|
1
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings.js.flow
generated
vendored
Normal file
1
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm-bindings.js.flow
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { SourceMap } from '../parcel_sourcemap_wasm/dist-node/parcel_sourcemap_wasm.js';
|
86
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm.js
generated
vendored
Normal file
86
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.init = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _SourceMap = _interopRequireDefault(require("./SourceMap"));
|
||||
|
||||
var bindings = _interopRequireWildcard(require("./wasm-bindings"));
|
||||
|
||||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
||||
|
||||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const init = typeof bindings.init === 'function' ? bindings.init() : Promise.resolve();
|
||||
exports.init = init;
|
||||
|
||||
class WasmSourceMap extends _SourceMap.default {
|
||||
constructor(projectRoot = '/', buffer) {
|
||||
super(projectRoot, buffer);
|
||||
this.sourceMapInstance = new bindings.SourceMap(projectRoot, buffer);
|
||||
this.projectRoot = this.sourceMapInstance.getProjectRoot();
|
||||
}
|
||||
|
||||
addVLQMap(map, lineOffset = 0, columnOffset = 0) {
|
||||
let {
|
||||
sourcesContent,
|
||||
sources = [],
|
||||
mappings,
|
||||
names = []
|
||||
} = map;
|
||||
|
||||
if (!sourcesContent) {
|
||||
sourcesContent = sources.map(() => '');
|
||||
} else {
|
||||
sourcesContent = sourcesContent.map(content => content ? content : '');
|
||||
}
|
||||
|
||||
this.sourceMapInstance.addVLQMap(mappings, sources, sourcesContent.map(content => content ? content : ''), names, lineOffset, columnOffset);
|
||||
return this;
|
||||
}
|
||||
|
||||
addSourceMap(sourcemap, lineOffset = 0) {
|
||||
if (!(sourcemap.sourceMapInstance instanceof bindings.SourceMap)) {
|
||||
throw new Error('The sourcemap provided to addSourceMap is not a valid sourcemap instance');
|
||||
}
|
||||
|
||||
this.sourceMapInstance.addSourceMap(sourcemap.sourceMapInstance, lineOffset);
|
||||
return this;
|
||||
}
|
||||
|
||||
addBuffer(buffer, lineOffset = 0) {
|
||||
let previousMap = new WasmSourceMap(this.projectRoot, buffer);
|
||||
return this.addSourceMap(previousMap, lineOffset);
|
||||
}
|
||||
|
||||
extends(input) {
|
||||
// $FlowFixMe
|
||||
let inputSourceMap = input instanceof Uint8Array ? new WasmSourceMap(this.projectRoot, input) : input;
|
||||
this.sourceMapInstance.extends(inputSourceMap.sourceMapInstance);
|
||||
return this;
|
||||
}
|
||||
|
||||
delete() {
|
||||
this.sourceMapInstance.free();
|
||||
}
|
||||
|
||||
static generateEmptyMap({
|
||||
projectRoot,
|
||||
sourceName,
|
||||
sourceContent,
|
||||
lineOffset = 0
|
||||
}) {
|
||||
let map = new WasmSourceMap(projectRoot);
|
||||
map.addEmptyMap(sourceName, sourceContent, lineOffset);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = WasmSourceMap;
|
70
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm.js.flow
generated
vendored
Normal file
70
webGl/my-threejs-test/node_modules/@parcel/source-map/dist/wasm.js.flow
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
// @flow
|
||||
import type { ParsedMap, VLQMap, SourceMapStringifyOptions, IndexedMapping, GenerateEmptyMapOptions } from './types';
|
||||
import path from 'path';
|
||||
import SourceMap from './SourceMap';
|
||||
|
||||
import * as bindings from './wasm-bindings';
|
||||
|
||||
export const init: Promise<void> = typeof bindings.init === 'function' ? bindings.init() : Promise.resolve();
|
||||
|
||||
export default class WasmSourceMap extends SourceMap {
|
||||
constructor(projectRoot: string = '/', buffer?: Buffer) {
|
||||
super(projectRoot, buffer);
|
||||
this.sourceMapInstance = new bindings.SourceMap(projectRoot, buffer);
|
||||
this.projectRoot = this.sourceMapInstance.getProjectRoot();
|
||||
}
|
||||
|
||||
addVLQMap(map: VLQMap, lineOffset: number = 0, columnOffset: number = 0): SourceMap {
|
||||
let { sourcesContent, sources = [], mappings, names = [] } = map;
|
||||
if (!sourcesContent) {
|
||||
sourcesContent = sources.map(() => '');
|
||||
} else {
|
||||
sourcesContent = sourcesContent.map((content) => (content ? content : ''));
|
||||
}
|
||||
this.sourceMapInstance.addVLQMap(
|
||||
mappings,
|
||||
sources,
|
||||
sourcesContent.map((content) => (content ? content : '')),
|
||||
names,
|
||||
lineOffset,
|
||||
columnOffset
|
||||
);
|
||||
return this;
|
||||
}
|
||||
|
||||
addSourceMap(sourcemap: SourceMap, lineOffset: number = 0): SourceMap {
|
||||
if (!(sourcemap.sourceMapInstance instanceof bindings.SourceMap)) {
|
||||
throw new Error('The sourcemap provided to addSourceMap is not a valid sourcemap instance');
|
||||
}
|
||||
|
||||
this.sourceMapInstance.addSourceMap(sourcemap.sourceMapInstance, lineOffset);
|
||||
return this;
|
||||
}
|
||||
|
||||
addBuffer(buffer: Buffer, lineOffset: number = 0): SourceMap {
|
||||
let previousMap = new WasmSourceMap(this.projectRoot, buffer);
|
||||
return this.addSourceMap(previousMap, lineOffset);
|
||||
}
|
||||
|
||||
extends(input: Buffer | SourceMap): SourceMap {
|
||||
// $FlowFixMe
|
||||
let inputSourceMap: SourceMap = input instanceof Uint8Array ? new WasmSourceMap(this.projectRoot, input) : input;
|
||||
this.sourceMapInstance.extends(inputSourceMap.sourceMapInstance);
|
||||
return this;
|
||||
}
|
||||
|
||||
delete() {
|
||||
this.sourceMapInstance.free();
|
||||
}
|
||||
|
||||
static generateEmptyMap({
|
||||
projectRoot,
|
||||
sourceName,
|
||||
sourceContent,
|
||||
lineOffset = 0,
|
||||
}: GenerateEmptyMapOptions): WasmSourceMap {
|
||||
let map = new WasmSourceMap(projectRoot);
|
||||
map.addEmptyMap(sourceName, sourceContent, lineOffset);
|
||||
return map;
|
||||
}
|
||||
}
|
101
webGl/my-threejs-test/node_modules/@parcel/source-map/index.d.ts
generated
vendored
Normal file
101
webGl/my-threejs-test/node_modules/@parcel/source-map/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* A position for a source mapping. 1-indexed.
|
||||
*/
|
||||
export type MappingPosition = {
|
||||
line: number;
|
||||
column: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* An indexed source mapping block
|
||||
*/
|
||||
export type IndexedMapping<T> = {
|
||||
generated: MappingPosition;
|
||||
original?: MappingPosition;
|
||||
source?: T;
|
||||
name?: T;
|
||||
};
|
||||
|
||||
/**
|
||||
* A source map in VLQ format
|
||||
*/
|
||||
export type VLQMap = Readonly<{
|
||||
sources: ReadonlyArray<string>;
|
||||
sourcesContent?: ReadonlyArray<string | null>;
|
||||
names: ReadonlyArray<string>;
|
||||
mappings: string;
|
||||
version?: number;
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* A parsed source map
|
||||
*/
|
||||
export type ParsedMap = {
|
||||
sources: string[];
|
||||
names: string[];
|
||||
mappings: Array<IndexedMapping<number>>;
|
||||
sourcesContent: Array<string | null>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for stringifying a source map
|
||||
*/
|
||||
export type SourceMapStringifyOptions = {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
rootDir?: string;
|
||||
inlineSources?: boolean;
|
||||
fs?: {
|
||||
readFile(path: string, encoding: string): Promise<string>;
|
||||
};
|
||||
format?: 'inline' | 'string' | 'object';
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for creating an empty source map
|
||||
*/
|
||||
export type GenerateEmptyMapOptions = {
|
||||
projectRoot: string;
|
||||
sourceName: string;
|
||||
sourceContent: string;
|
||||
lineOffset?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* A source map to assist in debugging during development
|
||||
*/
|
||||
export default class SourceMap {
|
||||
constructor(projectRoot?: string, buffer?: Buffer);
|
||||
static generateEmptyMap(opts: GenerateEmptyMapOptions): SourceMap;
|
||||
addEmptyMap(sourceName: string, sourceContent: string, lineOffset?: number): SourceMap;
|
||||
addVLQMap(map: VLQMap, lineOffset?: number, columnOffset?: number): SourceMap;
|
||||
addBuffer(buffer: Buffer, lineOffset?: number): SourceMap;
|
||||
addIndexedMapping(mapping: IndexedMapping<string>, lineOffset?: number, columnOffset?: number): void;
|
||||
addIndexedMappings(mappings: Array<IndexedMapping<string>>, lineOffset?: number, columnOffset?: number): void;
|
||||
addName(name: string): number;
|
||||
addNames(names: string[]): number[];
|
||||
addSource(source: string): number;
|
||||
addSources(sources: string[]): number[];
|
||||
getSourceIndex(source: string): number;
|
||||
getSource(index: number): string;
|
||||
setSourceContent(sourceName: string, sourceContent: string): void;
|
||||
getSourceContent(sourceName: string): string;
|
||||
getNameIndex(name: string): number;
|
||||
getName(index: number): string;
|
||||
extends(buffer: Buffer): SourceMap;
|
||||
getMap(): ParsedMap;
|
||||
findClosestMapping(line: number, column: number): IndexedMapping<string> | undefined;
|
||||
offsetLines(line: number, lineOffset: number): IndexedMapping<string> | undefined;
|
||||
offsetColumns(line: number, column: number, columnOffset: number): IndexedMapping<string> | undefined;
|
||||
toBuffer(): Buffer;
|
||||
toVLQ(): VLQMap;
|
||||
delete(): void;
|
||||
stringify(options: SourceMapStringifyOptions): Promise<string | VLQMap>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only used by the wasm version, await this to ensure the wasm binary is loaded
|
||||
*/
|
||||
export const init: Promise<void>
|
89
webGl/my-threejs-test/node_modules/@parcel/source-map/package.json
generated
vendored
Normal file
89
webGl/my-threejs-test/node_modules/@parcel/source-map/package.json
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "@parcel/source-map",
|
||||
"version": "2.1.1",
|
||||
"main": "./dist/node.js",
|
||||
"types": "index.d.ts",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/parcel-bundler/source-map.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha ./test/*.test.js",
|
||||
"test:node": "cross-env BACKEND=node yarn test",
|
||||
"test:wasm": "cross-env BACKEND=wasm yarn test",
|
||||
"benchmark": "node ./bench/run",
|
||||
"benchmark:node": "cross-env BACKEND=node yarn benchmark",
|
||||
"benchmark:wasm": "cross-env BACKEND=wasm yarn benchmark",
|
||||
"transpile": "babel ./src/*.js --out-dir ./dist && flow-copy-source -v src dist",
|
||||
"build:clean": "cd ./parcel_sourcemap_node && rm -rf artifacts && mkdir artifacts",
|
||||
"build:node": "yarn build:clean && node parcel_sourcemap_node/build.js",
|
||||
"build:node-release": "yarn build:clean && node parcel_sourcemap_node/build.js --release",
|
||||
"build:wasm-node": "wasm-pack build parcel_sourcemap_wasm --target nodejs --no-typescript --dev --out-dir dist-node",
|
||||
"build:wasm-node-release": "wasm-pack build parcel_sourcemap_wasm --target nodejs --no-typescript --release --out-dir dist-node",
|
||||
"build:wasm-web": "wasm-pack build parcel_sourcemap_wasm --no-typescript --target web --dev --out-dir dist-web",
|
||||
"build:wasm-web-release": "wasm-pack build parcel_sourcemap_wasm --no-typescript --target web --release --out-dir dist-web",
|
||||
"rebuild": "shx rm -rf build && yarn build:node",
|
||||
"rebuild-all": "yarn transpile && yarn rebuild",
|
||||
"prepublish": "npm run transpile",
|
||||
"typecheck": "flow",
|
||||
"format": "prettier --write \"./**/*.{js,md,mdx}\"",
|
||||
"clean": "shx rm -rf dist build",
|
||||
"tag-release": "node ./tag-release"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,json,md}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"index.d.ts",
|
||||
"package.json",
|
||||
"parcel_sourcemap_node/**/*",
|
||||
"parcel_sourcemap_wasm/dist-node/**/*",
|
||||
"parcel_sourcemap_wasm/dist-web/**/*",
|
||||
"README.md",
|
||||
"!.gitignore"
|
||||
],
|
||||
"binary": {
|
||||
"napi_versions": [
|
||||
4
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.18.3 || >=14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.14.3",
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/preset-env": "^7.14.2",
|
||||
"@babel/preset-flow": "^7.13.13",
|
||||
"@babel/register": "^7.13.16",
|
||||
"@napi-rs/cli": "^1.0.4",
|
||||
"cross-env": "^7.0.3",
|
||||
"flow-bin": "^0.151.0",
|
||||
"flow-copy-source": "^2.0.9",
|
||||
"fs-extra": "^10.0.0",
|
||||
"globby": "^11.0.3",
|
||||
"husky": "6.0.0",
|
||||
"lint-staged": "^11.0.0",
|
||||
"mocha": "^8.4.0",
|
||||
"prettier": "^2.3.0",
|
||||
"shx": "^0.3.3",
|
||||
"source-map": "^0.7.3",
|
||||
"tiny-benchy": "^2.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"detect-libc": "^1.0.3"
|
||||
},
|
||||
"browser": {
|
||||
"./dist/node.js": "./dist/wasm.js",
|
||||
"./dist/wasm-bindings.js": "./dist/wasm-bindings-web.js"
|
||||
}
|
||||
}
|
22
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/Cargo.toml
generated
vendored
Normal file
22
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/Cargo.toml
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
[package]
|
||||
authors = ["Jasper De Moor <jasperdemoor@gmail.com>"]
|
||||
edition = "2018"
|
||||
name = "parcel_sourcemap_node"
|
||||
version = "2.1.1"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
napi = {version = "1.7.3", features = ["napi4", "serde-json"]}
|
||||
napi-derive = "1.1.0"
|
||||
parcel_sourcemap = {path = "../parcel_sourcemap"}
|
||||
serde = "1"
|
||||
serde_json = "1"
|
||||
rkyv = "0.7.38"
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
jemallocator = {version = "0.3.2", features = ["disable_initial_exec_tls"]}
|
||||
|
||||
[build-dependencies]
|
||||
napi-build = "1.0.2"
|
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.darwin-arm64.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.darwin-arm64.node
generated
vendored
Normal file
Binary file not shown.
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.darwin-x64.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.darwin-x64.node
generated
vendored
Normal file
Binary file not shown.
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-arm-gnueabihf.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-arm-gnueabihf.node
generated
vendored
Normal file
Binary file not shown.
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-arm64-gnu.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-arm64-gnu.node
generated
vendored
Normal file
Binary file not shown.
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-arm64-musl.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-arm64-musl.node
generated
vendored
Normal file
Binary file not shown.
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-x64-gnu.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-x64-gnu.node
generated
vendored
Normal file
Binary file not shown.
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-x64-musl.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.linux-x64-musl.node
generated
vendored
Normal file
Binary file not shown.
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.win32-x64-msvc.node
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/artifacts/index.win32-x64-msvc.node
generated
vendored
Normal file
Binary file not shown.
46
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/build.js
generated
vendored
Normal file
46
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/build.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
const { spawn, execSync } = require('child_process');
|
||||
|
||||
let release = process.argv.includes('--release');
|
||||
build().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
async function build() {
|
||||
if (process.platform === 'darwin') {
|
||||
setupMacBuild();
|
||||
}
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
let args = ['build', '--platform', '-c', '../package.json', './artifacts'];
|
||||
if (release) {
|
||||
args.push('--release');
|
||||
}
|
||||
|
||||
if (process.env.RUST_TARGET) {
|
||||
args.push('--target', process.env.RUST_TARGET);
|
||||
}
|
||||
|
||||
let yarn = spawn('napi', args, {
|
||||
stdio: 'inherit',
|
||||
cwd: __dirname,
|
||||
shell: true,
|
||||
});
|
||||
|
||||
yarn.on('error', reject);
|
||||
yarn.on('close', resolve);
|
||||
});
|
||||
}
|
||||
|
||||
// This forces Clang/LLVM to be used as a C compiler instead of GCC.
|
||||
// This is necessary for cross-compilation for Apple Silicon in GitHub Actions.
|
||||
function setupMacBuild() {
|
||||
process.env.CC = execSync('xcrun -f clang', { encoding: 'utf8' }).trim();
|
||||
process.env.CXX = execSync('xcrun -f clang++', { encoding: 'utf8' }).trim();
|
||||
|
||||
let sysRoot = execSync('xcrun --sdk macosx --show-sdk-path', {
|
||||
encoding: 'utf8',
|
||||
}).trim();
|
||||
process.env.CFLAGS = `-isysroot ${sysRoot} -isystem ${sysRoot}`;
|
||||
process.env.MACOSX_DEPLOYMENT_TARGET = '10.9';
|
||||
}
|
5
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/build.rs
generated
vendored
Normal file
5
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/build.rs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
extern crate napi_build;
|
||||
|
||||
fn main() {
|
||||
napi_build::setup();
|
||||
}
|
15
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/index.js
generated
vendored
Normal file
15
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/index.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
let parts = [process.platform, process.arch];
|
||||
if (process.platform === 'linux') {
|
||||
const { MUSL, family } = require('detect-libc');
|
||||
if (family === MUSL) {
|
||||
parts.push('musl');
|
||||
} else if (process.arch === 'arm') {
|
||||
parts.push('gnueabihf');
|
||||
} else {
|
||||
parts.push('gnu');
|
||||
}
|
||||
} else if (process.platform === 'win32') {
|
||||
parts.push('msvc');
|
||||
}
|
||||
|
||||
module.exports = require(`./artifacts/index.${parts.join('-')}.node`);
|
550
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/src/lib.rs
generated
vendored
Normal file
550
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_node/src/lib.rs
generated
vendored
Normal file
@@ -0,0 +1,550 @@
|
||||
extern crate napi;
|
||||
#[macro_use]
|
||||
extern crate napi_derive;
|
||||
extern crate parcel_sourcemap;
|
||||
extern crate rkyv;
|
||||
|
||||
use napi::{
|
||||
CallContext, Either, Env, JsBuffer, JsNull, JsNumber, JsObject, JsString, JsTypedArray,
|
||||
JsUndefined, Property, Result,
|
||||
};
|
||||
use parcel_sourcemap::{Mapping, OriginalLocation, SourceMap, SourceMapError};
|
||||
use rkyv::AlignedVec;
|
||||
use serde_json::{from_str, to_string};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[global_allocator]
|
||||
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||
|
||||
#[js_function(1)]
|
||||
fn add_source(ctx: CallContext) -> Result<JsNumber> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let source = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let source_index = source_map_instance.add_source(source.as_str()?);
|
||||
|
||||
ctx.env.create_uint32(source_index)
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn get_source(ctx: CallContext) -> Result<JsString> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let source_index = ctx.get::<JsNumber>(0)?.get_uint32()?;
|
||||
match source_map_instance.get_source(source_index) {
|
||||
Ok(source) => ctx.env.create_string(source),
|
||||
Err(_err) => ctx.env.create_string(""),
|
||||
}
|
||||
}
|
||||
|
||||
fn _get_sources(ctx: &CallContext) -> Result<JsObject> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let mut napi_sources_array = ctx
|
||||
.env
|
||||
.create_array_with_length(source_map_instance.get_sources().len())?;
|
||||
for (source_index, source) in source_map_instance.get_sources().iter().enumerate() {
|
||||
napi_sources_array
|
||||
.set_element(source_index as u32, ctx.env.create_string(source.as_str())?)?;
|
||||
}
|
||||
|
||||
// Return array
|
||||
Ok(napi_sources_array)
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn get_sources(ctx: CallContext) -> Result<JsString> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
let sources_str = to_string(&source_map_instance.get_sources())?;
|
||||
return ctx.env.create_string(sources_str.as_str());
|
||||
}
|
||||
|
||||
fn _get_sources_content(ctx: &CallContext) -> Result<JsObject> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let mut napi_sources_content_array = ctx
|
||||
.env
|
||||
.create_array_with_length(source_map_instance.get_sources_content().len())?;
|
||||
for (source_index, source_content) in
|
||||
source_map_instance.get_sources_content().iter().enumerate()
|
||||
{
|
||||
napi_sources_content_array.set_element(
|
||||
source_index as u32,
|
||||
ctx.env.create_string(source_content.as_str())?,
|
||||
)?;
|
||||
}
|
||||
|
||||
// Return array
|
||||
Ok(napi_sources_content_array)
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn get_sources_content(ctx: CallContext) -> Result<JsObject> {
|
||||
_get_sources_content(&ctx)
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn get_source_index(ctx: CallContext) -> Result<JsNumber> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let source = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let source_index = source_map_instance
|
||||
.get_source_index(source.as_str()?)
|
||||
.map_err(to_napi_error)?;
|
||||
match source_index {
|
||||
Some(i) => ctx.env.create_uint32(i),
|
||||
None => ctx.env.create_int32(-1),
|
||||
}
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
fn set_source_content_by_source(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let source = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let source_index: usize = source_map_instance.add_source(source.as_str()?) as usize;
|
||||
let source_content = ctx.get::<JsString>(1)?.into_utf8()?;
|
||||
source_map_instance
|
||||
.set_source_content(source_index, source_content.as_str()?)
|
||||
.map_err(to_napi_error)?;
|
||||
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn get_source_content_by_source(ctx: CallContext) -> Result<JsString> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let source = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let source_index = source_map_instance
|
||||
.get_source_index(source.as_str()?)
|
||||
.map_err(to_napi_error)?;
|
||||
match source_index {
|
||||
Some(i) => {
|
||||
let source_content = source_map_instance
|
||||
.get_source_content(i)
|
||||
.map_err(to_napi_error)?;
|
||||
ctx.env.create_string(source_content)
|
||||
}
|
||||
None => ctx.env.create_string(""),
|
||||
}
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn add_name(ctx: CallContext) -> Result<JsNumber> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let name = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let name_index = source_map_instance.add_name(name.as_str()?);
|
||||
ctx.env.create_uint32(name_index)
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn get_name(ctx: CallContext) -> Result<JsString> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let name_index = ctx.get::<JsNumber>(0)?.get_uint32()?;
|
||||
match source_map_instance.get_name(name_index) {
|
||||
Ok(name) => ctx.env.create_string(name),
|
||||
Err(_err) => ctx.env.create_string(""),
|
||||
}
|
||||
}
|
||||
|
||||
fn _get_names(ctx: &CallContext) -> Result<JsObject> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let mut napi_names_array = ctx
|
||||
.env
|
||||
.create_array_with_length(source_map_instance.get_names().len())?;
|
||||
for (name_index, name) in source_map_instance.get_names().iter().enumerate() {
|
||||
napi_names_array.set_element(name_index as u32, ctx.env.create_string(name.as_str())?)?;
|
||||
}
|
||||
|
||||
// Return array
|
||||
Ok(napi_names_array)
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn get_names(ctx: CallContext) -> Result<JsString> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
let names_str = to_string(&source_map_instance.get_names())?;
|
||||
return ctx.env.create_string(names_str.as_str());
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn get_name_index(ctx: CallContext) -> Result<JsNumber> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let name = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let name_index = source_map_instance.get_name_index(name.as_str()?);
|
||||
|
||||
match name_index {
|
||||
Some(i) => ctx.env.create_uint32(i),
|
||||
None => ctx.env.create_int32(-1),
|
||||
}
|
||||
}
|
||||
|
||||
fn mapping_to_js_object(ctx: &CallContext, mapping: &Mapping) -> Result<JsObject> {
|
||||
let mut mapping_obj = ctx.env.create_object()?;
|
||||
|
||||
let mut generated_position_obj = ctx.env.create_object()?;
|
||||
generated_position_obj
|
||||
.set_named_property("line", ctx.env.create_uint32((mapping.generated_line) + 1)?)?;
|
||||
generated_position_obj
|
||||
.set_named_property("column", ctx.env.create_uint32(mapping.generated_column)?)?;
|
||||
mapping_obj.set_named_property("generated", generated_position_obj)?;
|
||||
|
||||
let original_position = mapping.original;
|
||||
if let Some(original_position) = original_position {
|
||||
let mut original_position_obj = ctx.env.create_object()?;
|
||||
original_position_obj.set_named_property(
|
||||
"line",
|
||||
ctx.env.create_uint32(original_position.original_line + 1)?,
|
||||
)?;
|
||||
original_position_obj.set_named_property(
|
||||
"column",
|
||||
ctx.env.create_uint32(original_position.original_column)?,
|
||||
)?;
|
||||
mapping_obj.set_named_property("original", original_position_obj)?;
|
||||
|
||||
mapping_obj
|
||||
.set_named_property("source", ctx.env.create_uint32(original_position.source)?)?;
|
||||
|
||||
if let Some(name) = original_position.name {
|
||||
mapping_obj.set_named_property("name", ctx.env.create_uint32(name)?)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(mapping_obj)
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn get_mappings(ctx: CallContext) -> Result<JsObject> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let mut mappings_arr = ctx.env.create_array()?;
|
||||
for (index, mapping) in source_map_instance.get_mappings().iter().enumerate() {
|
||||
mappings_arr.set_element(index as u32, mapping_to_js_object(&ctx, mapping)?)?;
|
||||
}
|
||||
Ok(mappings_arr)
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn to_buffer(ctx: CallContext) -> Result<JsBuffer> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let mut buffer_data = AlignedVec::new();
|
||||
source_map_instance
|
||||
.to_buffer(&mut buffer_data)
|
||||
.map_err(to_napi_error)?;
|
||||
Ok(ctx
|
||||
.env
|
||||
.create_buffer_with_data(buffer_data.into_vec())?
|
||||
.into_raw())
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
fn add_sourcemap(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let sourcemap_object = ctx.get::<JsObject>(0)?;
|
||||
let previous_map_instance = ctx.env.unwrap::<SourceMap>(&sourcemap_object)?;
|
||||
let line_offset = ctx.get::<JsNumber>(1)?.get_int64()?;
|
||||
|
||||
source_map_instance
|
||||
.add_sourcemap(previous_map_instance, line_offset)
|
||||
.map_err(to_napi_error)?;
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function(6)]
|
||||
fn add_vlq_map(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let vlq_mappings = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
|
||||
let js_sources_arr_input = ctx.get::<JsString>(1)?.into_utf8()?;
|
||||
let sources: Vec<String> = from_str(js_sources_arr_input.as_str()?)?;
|
||||
|
||||
let js_sources_content_arr_input = ctx.get::<JsString>(2)?.into_utf8()?;
|
||||
let sources_content: Vec<String> = from_str(js_sources_content_arr_input.as_str()?)?;
|
||||
|
||||
let js_names_arr_input = ctx.get::<JsString>(3)?.into_utf8()?;
|
||||
let names: Vec<String> = from_str(js_names_arr_input.as_str()?)?;
|
||||
|
||||
let line_offset = ctx.get::<JsNumber>(4)?.get_int64()?;
|
||||
let column_offset = ctx.get::<JsNumber>(5)?.get_int64()?;
|
||||
|
||||
source_map_instance
|
||||
.add_vlq_map(
|
||||
vlq_mappings.as_slice(),
|
||||
sources.iter().map(|s| s.as_str()).collect(),
|
||||
sources_content.iter().map(|s| s.as_str()).collect(),
|
||||
names.iter().map(|s| s.as_str()).collect(),
|
||||
line_offset,
|
||||
column_offset,
|
||||
)
|
||||
.map_err(to_napi_error)?;
|
||||
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn to_vlq(ctx: CallContext) -> Result<JsObject> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let mut vlq_output: Vec<u8> = vec![];
|
||||
source_map_instance
|
||||
.write_vlq(&mut vlq_output)
|
||||
.map_err(to_napi_error)?;
|
||||
let vlq_string = ctx.env.create_string_latin1(vlq_output.as_slice())?;
|
||||
let mut result_obj: JsObject = ctx.env.create_object()?;
|
||||
result_obj.set_named_property("mappings", vlq_string)?;
|
||||
result_obj.set_named_property("sources", _get_sources(&ctx)?)?;
|
||||
result_obj.set_named_property("sourcesContent", _get_sources_content(&ctx)?)?;
|
||||
result_obj.set_named_property("names", _get_names(&ctx)?)?;
|
||||
|
||||
Ok(result_obj)
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn add_indexed_mappings(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let mappings = ctx.get::<JsTypedArray>(0)?;
|
||||
let mappings_value = mappings.into_value()?;
|
||||
let mappings_arr: &[i32] = mappings_value.as_ref();
|
||||
let mappings_count = mappings_arr.len();
|
||||
|
||||
let mut generated_line: u32 = 0; // 0
|
||||
let mut generated_column: u32 = 0; // 1
|
||||
let mut original_line: i32 = 0; // 2
|
||||
let mut original_column: i32 = 0; // 3
|
||||
let mut original_source: i32 = 0; // 4
|
||||
for (i, value) in mappings_arr.iter().enumerate().take(mappings_count) {
|
||||
let value = *value;
|
||||
match i % 6 {
|
||||
0 => {
|
||||
generated_line = value as u32;
|
||||
}
|
||||
1 => {
|
||||
generated_column = value as u32;
|
||||
}
|
||||
2 => {
|
||||
original_line = value;
|
||||
}
|
||||
3 => {
|
||||
original_column = value;
|
||||
}
|
||||
4 => {
|
||||
original_source = value;
|
||||
}
|
||||
5 => {
|
||||
source_map_instance.add_mapping(
|
||||
generated_line,
|
||||
generated_column,
|
||||
if original_line > -1 && original_column > -1 && original_source > -1 {
|
||||
Some(OriginalLocation {
|
||||
original_line: original_line as u32,
|
||||
original_column: original_column as u32,
|
||||
source: original_source as u32,
|
||||
name: if value > -1 { Some(value as u32) } else { None },
|
||||
})
|
||||
} else {
|
||||
None
|
||||
},
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
fn offset_lines(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let generated_line = ctx.get::<JsNumber>(0)?.get_uint32()?;
|
||||
let generated_line_offset = ctx.get::<JsNumber>(1)?.get_int64()?;
|
||||
source_map_instance
|
||||
.offset_lines(generated_line, generated_line_offset)
|
||||
.map_err(to_napi_error)?;
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function(3)]
|
||||
fn offset_columns(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let generated_line = ctx.get::<JsNumber>(0)?.get_uint32()?;
|
||||
let generated_column = ctx.get::<JsNumber>(1)?.get_uint32()?;
|
||||
let generated_column_offset = ctx.get::<JsNumber>(2)?.get_int64()?;
|
||||
|
||||
source_map_instance
|
||||
.offset_columns(generated_line, generated_column, generated_column_offset)
|
||||
.map_err(to_napi_error)?;
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function(3)]
|
||||
fn add_empty_map(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let source = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let source_content = ctx.get::<JsString>(1)?.into_utf8()?;
|
||||
let line_offset = ctx.get::<JsNumber>(2)?.get_int64()?;
|
||||
source_map_instance
|
||||
.add_empty_map(source.as_str()?, source_content.as_str()?, line_offset)
|
||||
.map_err(to_napi_error)?;
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function(1)]
|
||||
fn extends(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let sourcemap_object = ctx.get::<JsObject>(0)?;
|
||||
let previous_map_instance = ctx.env.unwrap::<SourceMap>(&sourcemap_object)?;
|
||||
source_map_instance
|
||||
.extends(previous_map_instance)
|
||||
.map_err(to_napi_error)?;
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
fn find_closest_mapping(ctx: CallContext) -> Result<Either<JsObject, JsNull>> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
let generated_line = ctx.get::<JsNumber>(0)?.get_uint32()?;
|
||||
let generated_column = ctx.get::<JsNumber>(1)?.get_uint32()?;
|
||||
match source_map_instance.find_closest_mapping(generated_line, generated_column) {
|
||||
Some(mapping) => mapping_to_js_object(&ctx, &mapping).map(Either::A),
|
||||
None => ctx.env.get_null().map(Either::B),
|
||||
}
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn get_project_root(ctx: CallContext) -> Result<JsString> {
|
||||
let this: JsObject = ctx.this_unchecked();
|
||||
let source_map_instance: &mut SourceMap = ctx.env.unwrap(&this)?;
|
||||
|
||||
return ctx
|
||||
.env
|
||||
.create_string(source_map_instance.project_root.as_str());
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
fn constructor(ctx: CallContext) -> Result<JsUndefined> {
|
||||
let mut this: JsObject = ctx.this_unchecked();
|
||||
let project_root = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let second_argument = ctx.get::<Either<JsBuffer, JsUndefined>>(1)?;
|
||||
match second_argument {
|
||||
Either::A(js_buffer) => {
|
||||
let buffer = js_buffer.into_value()?;
|
||||
let sourcemap = SourceMap::from_buffer(project_root.as_str()?, &buffer[..])
|
||||
.map_err(to_napi_error)?;
|
||||
ctx.env.wrap(&mut this, sourcemap)?;
|
||||
}
|
||||
Either::B(_) => {
|
||||
ctx.env
|
||||
.wrap(&mut this, SourceMap::new(project_root.as_str()?))?;
|
||||
}
|
||||
}
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn to_napi_error(err: SourceMapError) -> napi::Error {
|
||||
napi::Error::new(napi::Status::GenericFailure, err.to_string())
|
||||
}
|
||||
|
||||
#[module_exports]
|
||||
fn init(mut exports: JsObject, env: Env) -> Result<()> {
|
||||
let add_source_method = Property::new(&env, "addSource")?.with_method(add_source);
|
||||
let get_source_method = Property::new(&env, "getSource")?.with_method(get_source);
|
||||
let get_sources_method = Property::new(&env, "getSources")?.with_method(get_sources);
|
||||
let get_source_index_method =
|
||||
Property::new(&env, "getSourceIndex")?.with_method(get_source_index);
|
||||
let set_source_content_by_source_method =
|
||||
Property::new(&env, "setSourceContentBySource")?.with_method(set_source_content_by_source);
|
||||
let get_source_content_by_source_method =
|
||||
Property::new(&env, "getSourceContentBySource")?.with_method(get_source_content_by_source);
|
||||
let get_sources_content_method =
|
||||
Property::new(&env, "getSourcesContent")?.with_method(get_sources_content);
|
||||
let add_name_method = Property::new(&env, "addName")?.with_method(add_name);
|
||||
let get_name_method = Property::new(&env, "getName")?.with_method(get_name);
|
||||
let get_names_method = Property::new(&env, "getNames")?.with_method(get_names);
|
||||
let get_name_index_method = Property::new(&env, "getNameIndex")?.with_method(get_name_index);
|
||||
let get_mappings_method = Property::new(&env, "getMappings")?.with_method(get_mappings);
|
||||
let to_buffer_method = Property::new(&env, "toBuffer")?.with_method(to_buffer);
|
||||
let add_sourcemap_method = Property::new(&env, "addSourceMap")?.with_method(add_sourcemap);
|
||||
let add_indexed_mappings_method =
|
||||
Property::new(&env, "addIndexedMappings")?.with_method(add_indexed_mappings);
|
||||
let add_vlq_map_method = Property::new(&env, "addVLQMap")?.with_method(add_vlq_map);
|
||||
let to_vlq_method = Property::new(&env, "toVLQ")?.with_method(to_vlq);
|
||||
let offset_lines_method = Property::new(&env, "offsetLines")?.with_method(offset_lines);
|
||||
let offset_columns_method = Property::new(&env, "offsetColumns")?.with_method(offset_columns);
|
||||
let add_empty_map_method = Property::new(&env, "addEmptyMap")?.with_method(add_empty_map);
|
||||
let extends_method = Property::new(&env, "extends")?.with_method(extends);
|
||||
let get_project_root_method =
|
||||
Property::new(&env, "getProjectRoot")?.with_method(get_project_root);
|
||||
let find_closest_mapping_method =
|
||||
Property::new(&env, "findClosestMapping")?.with_method(find_closest_mapping);
|
||||
let sourcemap_class = env.define_class(
|
||||
"SourceMap",
|
||||
constructor,
|
||||
&[
|
||||
add_source_method,
|
||||
get_source_method,
|
||||
get_sources_method,
|
||||
get_source_index_method,
|
||||
set_source_content_by_source_method,
|
||||
get_source_content_by_source_method,
|
||||
get_sources_content_method,
|
||||
add_name_method,
|
||||
get_name_method,
|
||||
get_names_method,
|
||||
get_name_index_method,
|
||||
get_mappings_method,
|
||||
add_sourcemap_method,
|
||||
add_indexed_mappings_method,
|
||||
add_vlq_map_method,
|
||||
to_buffer_method,
|
||||
to_vlq_method,
|
||||
offset_lines_method,
|
||||
offset_columns_method,
|
||||
add_empty_map_method,
|
||||
extends_method,
|
||||
find_closest_mapping_method,
|
||||
get_project_root_method,
|
||||
],
|
||||
)?;
|
||||
exports.set_named_property("SourceMap", sourcemap_class)?;
|
||||
Ok(())
|
||||
}
|
12
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-node/package.json
generated
vendored
Normal file
12
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-node/package.json
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "parcel_sourcemap_wasm",
|
||||
"collaborators": [
|
||||
"Jasper De Moor <jasperdemoor@gmail.com>"
|
||||
],
|
||||
"version": "2.1.1",
|
||||
"files": [
|
||||
"parcel_sourcemap_wasm_bg.wasm",
|
||||
"parcel_sourcemap_wasm.js"
|
||||
],
|
||||
"main": "parcel_sourcemap_wasm.js"
|
||||
}
|
660
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-node/parcel_sourcemap_wasm.js
generated
vendored
Normal file
660
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-node/parcel_sourcemap_wasm.js
generated
vendored
Normal file
@@ -0,0 +1,660 @@
|
||||
let imports = {};
|
||||
imports['__wbindgen_placeholder__'] = module.exports;
|
||||
let wasm;
|
||||
const { TextEncoder, TextDecoder } = require(`util`);
|
||||
|
||||
const heap = new Array(32).fill(undefined);
|
||||
|
||||
heap.push(undefined, null, true, false);
|
||||
|
||||
function getObject(idx) { return heap[idx]; }
|
||||
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
|
||||
let cachegetUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8Memory0;
|
||||
}
|
||||
|
||||
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 passStringToWasm0(arg, malloc, realloc) {
|
||||
|
||||
if (realloc === undefined) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr = malloc(buf.length);
|
||||
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len);
|
||||
|
||||
const mem = getUint8Memory0();
|
||||
|
||||
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 = realloc(ptr, len, len = offset + arg.length * 3);
|
||||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
|
||||
offset += ret.written;
|
||||
}
|
||||
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
let cachegetInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetInt32Memory0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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 });
|
||||
|
||||
cachedTextDecoder.decode();
|
||||
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
|
||||
let cachegetUint32Memory0 = null;
|
||||
function getUint32Memory0() {
|
||||
if (cachegetUint32Memory0 === null || cachegetUint32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint32Memory0;
|
||||
}
|
||||
|
||||
function passArray32ToWasm0(arg, malloc) {
|
||||
const ptr = malloc(arg.length * 4);
|
||||
getUint32Memory0().set(arg, ptr / 4);
|
||||
WASM_VECTOR_LEN = arg.length;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
function _assertClass(instance, klass) {
|
||||
if (!(instance instanceof klass)) {
|
||||
throw new Error(`expected instance of ${klass.name}`);
|
||||
}
|
||||
return instance.ptr;
|
||||
}
|
||||
/**
|
||||
*/
|
||||
class SourceMap {
|
||||
|
||||
static __wrap(ptr) {
|
||||
const obj = Object.create(SourceMap.prototype);
|
||||
obj.ptr = ptr;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
__destroy_into_raw() {
|
||||
const ptr = this.ptr;
|
||||
this.ptr = 0;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
free() {
|
||||
const ptr = this.__destroy_into_raw();
|
||||
wasm.__wbg_sourcemap_free(ptr);
|
||||
}
|
||||
/**
|
||||
* @param {string} project_root
|
||||
* @param {any} buffer
|
||||
*/
|
||||
constructor(project_root, buffer) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(project_root, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_new(retptr, ptr0, len0, addHeapObject(buffer));
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return SourceMap.__wrap(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
getProjectRoot() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getProjectRoot(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} vlq_mappings
|
||||
* @param {any} sources
|
||||
* @param {any} sources_content
|
||||
* @param {any} names
|
||||
* @param {number} line_offset
|
||||
* @param {number} column_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
addVLQMap(vlq_mappings, sources, sources_content, names, line_offset, column_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(vlq_mappings, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_addVLQMap(retptr, this.ptr, ptr0, len0, addHeapObject(sources), addHeapObject(sources_content), addHeapObject(names), line_offset, column_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
toVLQ() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_toVLQ(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getMappings() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getMappings(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getSources() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getSources(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getSourcesContent() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getSourcesContent(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getNames() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getNames(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {number}
|
||||
*/
|
||||
addName(name) {
|
||||
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.sourcemap_addName(this.ptr, ptr0, len0);
|
||||
return ret >>> 0;
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @returns {number}
|
||||
*/
|
||||
addSource(source) {
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.sourcemap_addSource(this.ptr, ptr0, len0);
|
||||
return ret >>> 0;
|
||||
}
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {string}
|
||||
*/
|
||||
getName(index) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getName(retptr, this.ptr, index);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {string}
|
||||
*/
|
||||
getSource(index) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getSource(retptr, this.ptr, index);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {number}
|
||||
*/
|
||||
getNameIndex(name) {
|
||||
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.sourcemap_getNameIndex(this.ptr, ptr0, len0);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @returns {any}
|
||||
*/
|
||||
getSourceIndex(source) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_getSourceIndex(retptr, this.ptr, ptr0, len0);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {Int32Array} mappings_arr
|
||||
*/
|
||||
addIndexedMappings(mappings_arr) {
|
||||
const ptr0 = passArray32ToWasm0(mappings_arr, wasm.__wbindgen_malloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_addIndexedMappings(this.ptr, ptr0, len0);
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
toBuffer() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_toBuffer(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {SourceMap} previous_map_instance
|
||||
* @param {number} line_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
addSourceMap(previous_map_instance, line_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
_assertClass(previous_map_instance, SourceMap);
|
||||
wasm.sourcemap_addSourceMap(retptr, this.ptr, previous_map_instance.ptr, line_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @param {string} source_content
|
||||
* @returns {any}
|
||||
*/
|
||||
setSourceContentBySource(source, source_content) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ptr1 = passStringToWasm0(source_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_setSourceContentBySource(retptr, this.ptr, ptr0, len0, ptr1, len1);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @returns {any}
|
||||
*/
|
||||
getSourceContentBySource(source) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_getSourceContentBySource(retptr, this.ptr, ptr0, len0);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @param {string} source_content
|
||||
* @param {number} line_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
addEmptyMap(source, source_content, line_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ptr1 = passStringToWasm0(source_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_addEmptyMap(retptr, this.ptr, ptr0, len0, ptr1, len1, line_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {SourceMap} previous_map_instance
|
||||
* @returns {any}
|
||||
*/
|
||||
extends(previous_map_instance) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
_assertClass(previous_map_instance, SourceMap);
|
||||
wasm.sourcemap_extends(retptr, this.ptr, previous_map_instance.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {number} generated_line
|
||||
* @param {number} generated_column
|
||||
* @returns {any}
|
||||
*/
|
||||
findClosestMapping(generated_line, generated_column) {
|
||||
const ret = wasm.sourcemap_findClosestMapping(this.ptr, generated_line, generated_column);
|
||||
return takeObject(ret);
|
||||
}
|
||||
/**
|
||||
* @param {number} generated_line
|
||||
* @param {number} generated_line_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
offsetLines(generated_line, generated_line_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_offsetLines(retptr, this.ptr, generated_line, generated_line_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {number} generated_line
|
||||
* @param {number} generated_column
|
||||
* @param {number} generated_column_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
offsetColumns(generated_line, generated_column, generated_column_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_offsetColumns(retptr, this.ptr, generated_line, generated_column, generated_column_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports.SourceMap = SourceMap;
|
||||
|
||||
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = JSON.stringify(obj === undefined ? null : obj);
|
||||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
|
||||
module.exports.__wbg_new_3047bf4b4f02b802 = function(arg0, arg1) {
|
||||
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_is_undefined = function(arg0) {
|
||||
const ret = getObject(arg0) === undefined;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
|
||||
module.exports.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_memory = function() {
|
||||
const ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_buffer_7af23f65f6c64548 = function(arg0) {
|
||||
const ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_new_cc9018bd6f283b6f = function(arg0) {
|
||||
const ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_json_parse = function(arg0, arg1) {
|
||||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_number_new = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974 = function(arg0, arg1, arg2) {
|
||||
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
||||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
|
||||
const path = require('path').join(__dirname, 'parcel_sourcemap_wasm_bg.wasm');
|
||||
const bytes = require('fs').readFileSync(path);
|
||||
|
||||
const wasmModule = new WebAssembly.Module(bytes);
|
||||
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
wasm = wasmInstance.exports;
|
||||
module.exports.__wasm = wasm;
|
||||
|
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-node/parcel_sourcemap_wasm_bg.wasm
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-node/parcel_sourcemap_wasm_bg.wasm
generated
vendored
Normal file
Binary file not shown.
13
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-web/package.json
generated
vendored
Normal file
13
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-web/package.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "parcel_sourcemap_wasm",
|
||||
"collaborators": [
|
||||
"Jasper De Moor <jasperdemoor@gmail.com>"
|
||||
],
|
||||
"version": "2.1.1",
|
||||
"files": [
|
||||
"parcel_sourcemap_wasm_bg.wasm",
|
||||
"parcel_sourcemap_wasm.js"
|
||||
],
|
||||
"module": "parcel_sourcemap_wasm.js",
|
||||
"sideEffects": false
|
||||
}
|
689
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-web/parcel_sourcemap_wasm.js
generated
vendored
Normal file
689
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-web/parcel_sourcemap_wasm.js
generated
vendored
Normal file
@@ -0,0 +1,689 @@
|
||||
|
||||
let wasm;
|
||||
|
||||
const heap = new Array(32).fill(undefined);
|
||||
|
||||
heap.push(undefined, null, true, false);
|
||||
|
||||
function getObject(idx) { return heap[idx]; }
|
||||
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
|
||||
let cachegetUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8Memory0;
|
||||
}
|
||||
|
||||
const 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 passStringToWasm0(arg, malloc, realloc) {
|
||||
|
||||
if (realloc === undefined) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr = malloc(buf.length);
|
||||
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len);
|
||||
|
||||
const mem = getUint8Memory0();
|
||||
|
||||
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 = realloc(ptr, len, len = offset + arg.length * 3);
|
||||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
|
||||
offset += ret.written;
|
||||
}
|
||||
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
let cachegetInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetInt32Memory0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
||||
|
||||
cachedTextDecoder.decode();
|
||||
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
|
||||
let cachegetUint32Memory0 = null;
|
||||
function getUint32Memory0() {
|
||||
if (cachegetUint32Memory0 === null || cachegetUint32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint32Memory0;
|
||||
}
|
||||
|
||||
function passArray32ToWasm0(arg, malloc) {
|
||||
const ptr = malloc(arg.length * 4);
|
||||
getUint32Memory0().set(arg, ptr / 4);
|
||||
WASM_VECTOR_LEN = arg.length;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
function _assertClass(instance, klass) {
|
||||
if (!(instance instanceof klass)) {
|
||||
throw new Error(`expected instance of ${klass.name}`);
|
||||
}
|
||||
return instance.ptr;
|
||||
}
|
||||
/**
|
||||
*/
|
||||
export class SourceMap {
|
||||
|
||||
static __wrap(ptr) {
|
||||
const obj = Object.create(SourceMap.prototype);
|
||||
obj.ptr = ptr;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
__destroy_into_raw() {
|
||||
const ptr = this.ptr;
|
||||
this.ptr = 0;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
free() {
|
||||
const ptr = this.__destroy_into_raw();
|
||||
wasm.__wbg_sourcemap_free(ptr);
|
||||
}
|
||||
/**
|
||||
* @param {string} project_root
|
||||
* @param {any} buffer
|
||||
*/
|
||||
constructor(project_root, buffer) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(project_root, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_new(retptr, ptr0, len0, addHeapObject(buffer));
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return SourceMap.__wrap(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
getProjectRoot() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getProjectRoot(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} vlq_mappings
|
||||
* @param {any} sources
|
||||
* @param {any} sources_content
|
||||
* @param {any} names
|
||||
* @param {number} line_offset
|
||||
* @param {number} column_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
addVLQMap(vlq_mappings, sources, sources_content, names, line_offset, column_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(vlq_mappings, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_addVLQMap(retptr, this.ptr, ptr0, len0, addHeapObject(sources), addHeapObject(sources_content), addHeapObject(names), line_offset, column_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
toVLQ() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_toVLQ(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getMappings() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getMappings(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getSources() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getSources(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getSourcesContent() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getSourcesContent(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
getNames() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getNames(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {number}
|
||||
*/
|
||||
addName(name) {
|
||||
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.sourcemap_addName(this.ptr, ptr0, len0);
|
||||
return ret >>> 0;
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @returns {number}
|
||||
*/
|
||||
addSource(source) {
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.sourcemap_addSource(this.ptr, ptr0, len0);
|
||||
return ret >>> 0;
|
||||
}
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {string}
|
||||
*/
|
||||
getName(index) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getName(retptr, this.ptr, index);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {string}
|
||||
*/
|
||||
getSource(index) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_getSource(retptr, this.ptr, index);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {number}
|
||||
*/
|
||||
getNameIndex(name) {
|
||||
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.sourcemap_getNameIndex(this.ptr, ptr0, len0);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @returns {any}
|
||||
*/
|
||||
getSourceIndex(source) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_getSourceIndex(retptr, this.ptr, ptr0, len0);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {Int32Array} mappings_arr
|
||||
*/
|
||||
addIndexedMappings(mappings_arr) {
|
||||
const ptr0 = passArray32ToWasm0(mappings_arr, wasm.__wbindgen_malloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_addIndexedMappings(this.ptr, ptr0, len0);
|
||||
}
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
toBuffer() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_toBuffer(retptr, this.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {SourceMap} previous_map_instance
|
||||
* @param {number} line_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
addSourceMap(previous_map_instance, line_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
_assertClass(previous_map_instance, SourceMap);
|
||||
wasm.sourcemap_addSourceMap(retptr, this.ptr, previous_map_instance.ptr, line_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @param {string} source_content
|
||||
* @returns {any}
|
||||
*/
|
||||
setSourceContentBySource(source, source_content) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ptr1 = passStringToWasm0(source_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_setSourceContentBySource(retptr, this.ptr, ptr0, len0, ptr1, len1);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @returns {any}
|
||||
*/
|
||||
getSourceContentBySource(source) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_getSourceContentBySource(retptr, this.ptr, ptr0, len0);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} source
|
||||
* @param {string} source_content
|
||||
* @param {number} line_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
addEmptyMap(source, source_content, line_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ptr1 = passStringToWasm0(source_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
wasm.sourcemap_addEmptyMap(retptr, this.ptr, ptr0, len0, ptr1, len1, line_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {SourceMap} previous_map_instance
|
||||
* @returns {any}
|
||||
*/
|
||||
extends(previous_map_instance) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
_assertClass(previous_map_instance, SourceMap);
|
||||
wasm.sourcemap_extends(retptr, this.ptr, previous_map_instance.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {number} generated_line
|
||||
* @param {number} generated_column
|
||||
* @returns {any}
|
||||
*/
|
||||
findClosestMapping(generated_line, generated_column) {
|
||||
const ret = wasm.sourcemap_findClosestMapping(this.ptr, generated_line, generated_column);
|
||||
return takeObject(ret);
|
||||
}
|
||||
/**
|
||||
* @param {number} generated_line
|
||||
* @param {number} generated_line_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
offsetLines(generated_line, generated_line_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_offsetLines(retptr, this.ptr, generated_line, generated_line_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {number} generated_line
|
||||
* @param {number} generated_column
|
||||
* @param {number} generated_column_offset
|
||||
* @returns {any}
|
||||
*/
|
||||
offsetColumns(generated_line, generated_column, generated_column_offset) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.sourcemap_offsetColumns(retptr, this.ptr, generated_line, generated_column, generated_column_offset);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function load(module, imports) {
|
||||
if (typeof Response === 'function' && module instanceof Response) {
|
||||
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
||||
try {
|
||||
return await WebAssembly.instantiateStreaming(module, imports);
|
||||
|
||||
} catch (e) {
|
||||
if (module.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);
|
||||
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const bytes = await module.arrayBuffer();
|
||||
return await WebAssembly.instantiate(bytes, imports);
|
||||
|
||||
} else {
|
||||
const instance = await WebAssembly.instantiate(module, imports);
|
||||
|
||||
if (instance instanceof WebAssembly.Instance) {
|
||||
return { instance, module };
|
||||
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function init(input) {
|
||||
if (typeof input === 'undefined') {
|
||||
input = new URL('parcel_sourcemap_wasm_bg.wasm', import.meta.url);
|
||||
}
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = JSON.stringify(obj === undefined ? null : obj);
|
||||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_new_3047bf4b4f02b802 = function(arg0, arg1) {
|
||||
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
||||
const ret = getObject(arg0) === undefined;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
imports.wbg.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_memory = function() {
|
||||
const ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_buffer_7af23f65f6c64548 = function(arg0) {
|
||||
const ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_cc9018bd6f283b6f = function(arg0) {
|
||||
const ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
|
||||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_number_new = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974 = function(arg0, arg1, arg2) {
|
||||
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
||||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
|
||||
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
||||
input = fetch(input);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const { instance, module } = await load(await input, imports);
|
||||
|
||||
wasm = instance.exports;
|
||||
init.__wbindgen_wasm_module = module;
|
||||
|
||||
return wasm;
|
||||
}
|
||||
|
||||
export default init;
|
||||
|
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-web/parcel_sourcemap_wasm_bg.wasm
generated
vendored
Normal file
BIN
webGl/my-threejs-test/node_modules/@parcel/source-map/parcel_sourcemap_wasm/dist-web/parcel_sourcemap_wasm_bg.wasm
generated
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user