FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
assemblyscript/tests/binaryen/const-expr.js at memoryData · deep-stack/assemblyscript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
deep-stack
/
assemblyscript
Public
forked from
cerc-io/assemblyscript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
assemblyscript
/
tests
/
binaryen
/
const-expr.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (25 loc) · 756 Bytes
Breadcrumbs
assemblyscript
/
tests
/
binaryen
/
const-expr.js
Copy path
File metadata and controls
29 lines (25 loc) · 756 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var
binaryen
=
require
(
"binaryen"
)
;
var
mod
=
new
binaryen
.
Module
(
)
;
var
addType
=
mod
.
addFunctionType
(
"iii"
,
binaryen
.
i32
,
[
binaryen
.
i32
,
binaryen
.
i32
]
)
;
mod
.
addFunction
(
"add"
,
addType
,
[
]
,
mod
.
i32
.
add
(
mod
.
get_local
(
0
,
binaryen
.
i32
)
,
mod
.
get_local
(
1
,
binaryen
.
i32
)
)
)
;
mod
.
addFunctionExport
(
"add"
,
"add"
)
;
var
testType
=
mod
.
addFunctionType
(
"i"
,
binaryen
.
i32
,
[
]
)
;
mod
.
addFunction
(
"test"
,
testType
,
[
]
,
mod
.
call
(
"add"
,
[
mod
.
i32
.
const
(
1
)
,
mod
.
i32
.
const
(
2
)
]
,
binaryen
.
i32
)
)
;
mod
.
addFunctionExport
(
"test"
,
"test"
)
;
binaryen
.
setOptimizeLevel
(
4
)
;
binaryen
.
setShrinkLevel
(
0
)
;
binaryen
.
setDebugInfo
(
false
)
;
mod
.
runPasses
(
[
"precompute"
]
)
;
if
(
!
mod
.
validate
(
)
)
console
.
log
(
"-> does not validate"
)
;
console
.
log
(
mod
.
emitText
(
)
)
;
Back
|
FazBrowse Home
|
New Git URL