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

Primitives Rejected + Incorrect Behavior #563

Open
Drago-Cuven opened this issue Dec 19, 2024 · 0 comments
Open

Primitives Rejected + Incorrect Behavior #563

Drago-Cuven opened this issue Dec 19, 2024 · 0 comments

Comments

@Drago-Cuven
Copy link

Drago-Cuven commented Dec 19, 2024

Hey everyone! I’m working on a TurboWarp extension that’s aiming to revolutionize visual coding engines like TurboWarp, Unsandboxed, PenguinMod, and NitroBolt by allowing users to mix block coding with real Ruby code. Imagine being able to seamlessly combine the simplicity of drag-and-drop with the power of actual programming—that’s what I’m going for.

However, I’m running into some issues, and I could really use your help. While the Ruby code does execute at times, the blocks don’t behave quite right. Instead of giving the expected output, they throw out a ton of unexpected data. Here’s an example of what I’m seeing:

{"inner": {"_wasm_val": 25,"_obj": {"_resource0_slab": {"list": [{"next": 1,"val": null}],"head": 0},"rubyShowVersion": (...e)=>{if(this.interfaceState.hasJSFrameAfterRbFrame){const n=this.guest.rbSetShouldProhibitRewind(!0),s=this.guest.rbGcDisable(),i=Reflect.apply(r,t,e);return this.guest.rbSetShouldProhibitRewind(n),s||this.guest.rbGcEnable(),i}return ... (a LOT more code beyond this.)

Also, when the Ruby code tries to "return" a value, the block ends up throwing this error:

Error: unexpected return

And to make things even more frustrating, the browser console always spits out warnings about primitives being rejected, no matter what Ruby code I try to run.

Steps to Reproduce:

  1. Load my extension in TurboWarp.
  2. Use the Ruby blocks to write some simple code, like puts "Hello World!" or a method that returns a value.
  3. Run the blocks and check the output.
  4. Open the browser console and check for warnings.

What I Expected:

  • The blocks should only show the Ruby code’s output, not dump out a huge JSON structure.
  • Ruby "return" should work as expected without throwing errors.
  • No annoying warnings about primitives in the browser console.

What Actually Happens:

  • Blocks spit out a mess of JSON-like data instead of the expected output.
  • Any "return" statement in Ruby triggers an "unexpected return" error.
  • Console is full of warnings about primitives being rejected.

Environment Details:

  • TurboWarp with Ruby WASM integration.
  • Browser: Google Chrome
  • Extension Version: 0.0.1 alpha

Attachments:

  • Screenshots showing the block behavior and console logs.
    Screenshot 2024-12-19 12 08 56 AM
    Screenshot 2024-12-18 9 58 26 PM
    Screenshot 2024-12-18 9 58 17 PM
    Screenshot 2024-12-18 9 58 04 PM
    Screenshot 2024-12-18 9 30 17 PM

Additional Notes:
I’m really excited about the potential of this project and think it could open up new possibilities for coding enthusiasts and developers. If anyone has ideas or can help troubleshoot these issues, I’d greatly appreciate it. Let me know if you need more details or files to look into it. Thanks!

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

No branches or pull requests

1 participant