2017-12-15 22:39:53 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const ModuleDependency = require("./ModuleDependency");
|
|
|
|
|
|
|
|
class WebAssemblyImportDependency extends ModuleDependency {
|
|
|
|
constructor(request, name) {
|
|
|
|
super(request);
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
getReference() {
|
2018-02-25 09:00:20 +08:00
|
|
|
if (!this.module) return null;
|
2017-12-15 22:39:53 +08:00
|
|
|
return {
|
|
|
|
module: this.module,
|
|
|
|
importedNames: [this.name]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
get type() {
|
|
|
|
return "wasm import";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = WebAssemblyImportDependency;
|