wowserhq / stormjs

StormLib for Javascript, powered by Emscripten
MIT License
14 stars 6 forks source link

Feature: open and close files #14

Closed fallenoak closed 6 years ago

fallenoak commented 6 years ago

Closes #5

timkurvers commented 6 years ago

Nice! 👍

Should it throw when opening a file when MPQ is closed?

fallenoak commented 6 years ago

@timkurvers Good catch.

We should probably add a branch for the this.handle guard that throws if !this.handle. In cases like MPQ.prototype.close, I think it's okay to silently do nothing if it's already closed, but in cases like MPQ.prototype.openFile, it really should throw.

Thoughts?

timkurvers commented 6 years ago

@fallenoak Agree! 👍