Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date.now is documented as i64 but wasm module expects a f64 #2911

Closed
nguterresn opened this issue Feb 11, 2025 · 2 comments
Closed

Date.now is documented as i64 but wasm module expects a f64 #2911

nguterresn opened this issue Feb 11, 2025 · 2 comments
Labels

Comments

@nguterresn
Copy link

Bug description

As the title states, the documentation state Date.now() returns a i64 value but the wasm module actually expects a f64.

(type (;18;) (func (result f64)))
(import "env" "Date.now" (func (;95;) (type 18)))

Steps to reproduce

Check the wat file.

AssemblyScript version

v0.27.32

@nguterresn nguterresn added the bug label Feb 11, 2025
@MaxGraey
Copy link
Member

It's binded import. Actual Date.now() in AssemblyScript will reuse it and cast to i64. See https://github.com/AssemblyScript/assemblyscript/blob/main/std/assembly/date.ts#L40

@MaxGraey MaxGraey added question and removed bug labels Feb 11, 2025
@nguterresn
Copy link
Author

@MaxGraey what does that mean?

From the native side I've tried to bind to a int64 function but it didn't work. It only worked when I change it to f64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants