Giter Club home page Giter Club logo

Comments (5)

ysangkok avatar ysangkok commented on August 22, 2024

oh wait, i also get the error on http://copy.sh/v86/debug.html?profile=archlinux

how can it be that the error doesn't occur in production mode? is it because the length is actually unused and the closure compiler optimizes it out?

from v86.

copy avatar copy commented on August 22, 2024

This is a weakness in the saving/restoring mechanism. It's essentially an extended version of JSON.parse and JSON.stringify, with extra handling for array buffers, typed arrays and skipping certain properties. Since properties names are changed during compilation, the snapshots cannot be shared between minified and unminified versions.

As an alternative, all properties would need to be written out explicitly, for example like this:

RTC.prototype.save_state = function()
{
    return [
        this.cmos_index,
        this.boot_order,
        // ...
    ];
};

RTC.prototype.restore_state = function(state)
{
    this.cmos_index = state[0];
    this.boot_order = state[1];
    // ...
};

That's probably a better strategy to implement this (but more complex), and I'll leave the issue open for this purpose. It's not high on my priority list at the moment, though.

Fixing this would also allow using state buffers between different versions of the emulator, assuming no changes to the state format are made. Closure Compiler renames properties differently even if minor changes are made to the code.

An alternative would be to switch to a less aggressive minifier. In my opinion, dead code elimination and linting are too useful to switch away from Closure Compiler.

from v86.

copy avatar copy commented on August 22, 2024

This problem has been annoying me, because I had to rebuild the Archlinux image after every code change and couldn't even build it with a script.

It's fixed now: State images should work between different builds of the emulator and after rebuilds.

from v86.

iAmInActions avatar iAmInActions commented on August 22, 2024

im encountering the error on the latest build with ubuntu 10.04. my save works on the online version but not my local build.

error is:

Uncaught TypeError: a[1] is undefined
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:65
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:101
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:81
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:262
    Od file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:202
    Od file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:62
    n file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:364
    g file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:365
    setTimeout handler*bf/t< file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    bf file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:369
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:360
    promise callback*done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:360
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    Pa file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:360
    onload file:///home/actionguy/Projects/wasm-linux-vm/index.html:31
    EventHandlerNonNull* file:///home/actionguy/Projects/wasm-linux-vm/index.html:29
v86_all.js:65:240

from v86.

copy avatar copy commented on August 22, 2024

@iAmInActions Can you open the file in debug.html and post the error again?

from v86.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.