이 번역은 완료되지 않았습니다. 이 문서를 번역해 주세요.

WebAssembly.Module 객체는 브라우저에서 이미 컴파일 된 stateless WebAssembly 코드를 포함하며 Workers와 효율적으로 공유하고 여러 번 인스턴스화 할 수 있습니다.

WebAssembly.Module() 생성자 함수를 호출하여 지정된 WebAssembly 바이너리 코드를 동기식으로 컴파일 할 수 있습니다. 그러나 Module을 쓰는 주된 방법은 WebAssembly.compile ()과 같은 비동기 컴파일 함수를 사용하는 것입니다.

생성자 구문

Important: 대형 모듈의 컴파일은 비용이 많이들 수 있으므로 개발자는 동기 컴파일이 절대적으로 필요한 경우에만 Module () 생성자를 사용해야합니다. 비동기 WebAssembly.compileStreaming () 메서드를 사용하세요.

var myModule = new WebAssembly.Module(bufferSource);

매개변수

bufferSource
컴파일 할 .wasm 모듈의 이진 코드가 들어있는 typed array또는 ArrayBuffer입니다.

Function Properties of the Module Constructor

WebAssembly.Module.customSections()
모듈과 문자열이 주어지면 모듈의 모든 사용자 정의 섹션 내용의 사본을 주어진 문자열 이름으로 반환합니다.
WebAssembly.Module.exports()
모듈이 주어지면 선언 된 모든 내보내기에 대한 설명이 들어있는 배열을 반환합니다.
WebAssembly.Module.imports()
모듈이 주어지면 선언 된 모든 가져 오기에 대한 설명이 들어있는 배열을 반환합니다.

Module instances

모든 Module 인스턴스는 Module() 생성자의 prototype object에서 상속받습니다.이 인스턴스는 모든 Module 인스턴스에 적용되도록 수정할 수 있습니다.

Instance properties

Module.prototype.constructor
Returns the function that created this object's instance. By default this is the WebAssembly.Module() constructor.
Module.prototype[@@toStringTag]
The initial value of the @@toStringTag property is the String value "WebAssembly.Module".

Instance methods

모듈 인스턴스에는 기본 메서드가 없습니다.

명세

Specification Status Comment
WebAssembly JavaScript Interface
The definition of 'WebAssembly.Module()' in that specification.
Working Draft Initial draft definition.

브라우저 호환성

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung InternetNode.js
Basic supportChrome Full support 57Edge Full support 16Firefox Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
IE No support NoOpera Full support 44Safari Full support 11WebView Android Full support 57Chrome Android Full support 57Edge Mobile Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the Experimental JavaScript Features preference.
Firefox Android Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
Opera Android ? Safari iOS Full support 11Samsung Internet Android Full support 7.0nodejs Full support 8.0.0
customSectionsChrome Full support 57Edge Full support 16Firefox Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
IE No support NoOpera Full support 44Safari Full support 11WebView Android Full support 57Chrome Android Full support 57Edge Mobile Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the Experimental JavaScript Features preference.
Firefox Android Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
Opera Android ? Safari iOS Full support 11Samsung Internet Android Full support 7.0nodejs Full support 8.0.0
exportsChrome Full support 57Edge Full support 16Firefox Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
IE No support NoOpera Full support 44Safari Full support 11WebView Android Full support 57Chrome Android Full support 57Edge Mobile Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the Experimental JavaScript Features preference.
Firefox Android Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
Opera Android ? Safari iOS Full support 11Samsung Internet Android Full support 7.0nodejs Full support 8.0.0
importsChrome Full support 57Edge Full support 16Firefox Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
IE No support NoOpera Full support 44Safari Full support 11WebView Android Full support 57Chrome Android Full support 57Edge Mobile Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the Experimental JavaScript Features preference.
Firefox Android Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
Opera Android ? Safari iOS Full support 11Samsung Internet Android Full support 7.0nodejs Full support 8.0.0
prototypeChrome Full support 57Edge Full support 16Firefox Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
IE No support NoOpera Full support 44Safari Full support 11WebView Android Full support 57Chrome Android Full support 57Edge Mobile Full support Yes
Disabled
Full support Yes
Disabled
Disabled This feature is behind the Experimental JavaScript Features preference.
Firefox Android Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
Opera Android ? Safari iOS Full support 11Samsung Internet Android Full support 7.0nodejs Full support 8.0.0

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also

문서 태그 및 공헌자

이 페이지의 공헌자: urty5656, limkukhyun
최종 변경자: urty5656,