sebastianwessel / quickjs

A typescript package to execute JavaScript and TypeScript code in a webassembly quickjs sandbox
https://sebastianwessel.github.io/quickjs/
MIT License
609 stars 16 forks source link

bug: Browser examples don't work due to 'Symbol.dispose is not defined' #37

Open vasilev opened 2 months ago

vasilev commented 2 months ago

Describe the bug Both browser examples issue an error message in browser's developer console:

simple.html:

Uncaught TypeError: Symbol.dispose is not defined.
    at pt (quickJS.js:10:40)
    at evalCode (quickJS.js:148:43)
    at simple.html:17:21
(anonymous) @   simple.html:17

playground.html:

After Run Code button click.

TypeError: Symbol.dispose is not defined.
    at pt (quickJS.js:10:40)
    at evalCode (quickJS.js:148:43)
    at HTMLButtonElement.<anonymous> (playground.html:129:35)
(anonymous) @   playground.html:132

To Reproduce Steps to reproduce the behavior:

  1. Clone the repo, cd into browser examples folder, start a simple web server:

    git clone --depth=1 https://github.com/sebastianwessel/quickjs.git
    cd quickjs/example/browser
    python3 -m http.server
  2. Point your browser to http://0.0.0.0:8000/simple.html to run the simple.html example.

  3. Point your browser to http://0.0.0.0:8000/playground.html to get the playground's UI, and press "Run Code" button there.

Expected behavior Expected the examples to work: obtain the meaningfull text output in devconsole or playground's output box. Expected no errors.

Screenshots N/A

Desktop (please complete the following information): Tested in Chromium 124.0.6367 and in Firefox 122.0.1 .

Smartphone (please complete the following information): N/A

Additional context N/A

BTW, thank you for this cool library!

sebastianwessel commented 2 months ago

Thanks for your feedback. Yes, it's an already known bug which will be fixed in the upcoming refactored version.