File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
graal-nodejs/test/graal/unit Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -97,4 +97,11 @@ EXPORT_TO_JS(CheckBackingStore) {
9797 args.GetReturnValue ().Set (true );
9898}
9999
100+ // WasmMemoryObject::Buffer
101+
102+ EXPORT_TO_JS (Buffer) {
103+ Local<WasmMemoryObject> memory = args[0 ].As <WasmMemoryObject>();
104+ args.GetReturnValue ().Set (memory->Buffer ());
105+ }
106+
100107#undef SUITE
Original file line number Diff line number Diff line change @@ -117,6 +117,11 @@ if (typeof WebAssembly !== 'undefined') {
117117 } ) ) ;
118118 assert . strictEqual ( calls , 6 ) ;
119119 } ) . timeout ( 5000 ) ;
120+
121+ it ( 'Buffer() should return the underlying ArrayBuffer' , function ( ) {
122+ let memory = new WebAssembly . Memory ( { initial : 1 } ) ;
123+ assert . strictEqual ( module . WasmMemory_Buffer ( memory ) , memory . buffer ) ;
124+ } ) ;
120125 } ) ;
121126 } ) ;
122127}
You can’t perform that action at this time.
0 commit comments