mirror of
https://github.com/tc39/test262.git
synced 2025-05-04 06:50:32 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import * as assert from '../assert.js';
|
|
import Builder from '../Builder.js';
|
|
|
|
(function EmptyModule() {
|
|
const builder = new Builder();
|
|
const bin = builder.WebAssembly();
|
|
assert.eq(bin.hexdump().trim(),
|
|
"00000000 00 61 73 6d 01 00 00 00 |·asm···· |");
|
|
})();
|
|
|
|
(function EmptyModule() {
|
|
const bin = (new Builder())
|
|
.setPreamble({ "magic number": 0x45464F43, version: 0xFFFFFFFF })
|
|
.WebAssembly();
|
|
assert.eq(bin.hexdump().trim(),
|
|
"00000000 43 4f 46 45 ff ff ff ff |COFE···· |");
|
|
})();
|
|
|
|
(function CustomSection() {
|
|
const bin = (new Builder())
|
|
.Unknown("OHHAI")
|
|
.Byte(0xDE)
|
|
.Byte(0xAD)
|
|
.Byte(0xC0)
|
|
.Byte(0xFE)
|
|
.End()
|
|
.WebAssembly();
|
|
assert.eq(bin.hexdump().trim(),
|
|
["00000000 00 61 73 6d 01 00 00 00 00 0a 05 4f 48 48 41 49 |·asm·······OHHAI|",
|
|
"00000010 de ad c0 fe |···· |"].join("\n"));
|
|
})();
|