mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 11:41:45 +00:00
Rework constructor handling (#446)
This commit is contained in:
@ -12,18 +12,23 @@
|
||||
(func $~lib/memory/memory.allocate (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
unreachable
|
||||
)
|
||||
(func $new-without-allocator/test (; 1 ;) (type $i) (result i32)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
block (result i32)
|
||||
(func $new-without-allocator/A#constructor (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $0
|
||||
get_local $0
|
||||
end
|
||||
set_local $1
|
||||
get_local $0
|
||||
)
|
||||
(func $new-without-allocator/test (; 2 ;) (type $i) (result i32)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $new-without-allocator/A#constructor
|
||||
set_local $0
|
||||
i32.const 3
|
||||
)
|
||||
(func $null (; 2 ;) (type $v)
|
||||
(func $null (; 3 ;) (type $v)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user