-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use own array implementation in VBS API #178
Conversation
Codecov Report
@@ Coverage Diff @@
## master #178 +/- ##
==========================================
- Coverage 90.84% 90.83% -0.01%
==========================================
Files 273 275 +2
Lines 14342 14359 +17
Branches 1675 1678 +3
==========================================
+ Hits 13028 13042 +14
- Misses 812 816 +4
+ Partials 502 501 -1
Continue to review full report at Codecov.
|
cfaf04a
to
83f2fdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might needs to be extended to objects, but I think it's the cleanest solution for now.
fully agree yes. So I tested this and my expectation is, that when we use mm-playfield.vpx and see the rom errors (due missing switch settings in the test table) AND press the ESC onscreen button, the rom should be loaded. however I still see
Uncaught TypeError: Cannot set property 'State' of undefined
at TimerApi.eval (tablescript.js:31)
at TimerApi.emit (events.js:146)
at EventProxy.fireDispID (event-proxy.js:50)
at EventProxy.fireGroupEvent (event-proxy.js:44)
at PlayerPhysics.updatePhysics (player-physics.js:312)
at Player.updatePhysics (player.js:89)
at player.worker.js:88
which points to ` __vbsHelper.getOrCall(__scope.Lights, idx).State = __vbsHelper.getOrCall(ChgLamp, ii, 1);``
shouln't that be solved now? or do I need an updated table with specific error handling enabled?
Your test result is unfortunate ;) Lemme actually test this :) |
stupid users are NEVER guilty ;) |
The use case doesn't actually use |
AHA, we can another error now:
while line 34 looks like |
Yes, that's expected, because error handling is actually off per default ("off" as is "crash on error"), so now we'll need to implement You can temporarily try to set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
work great now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the old grammar to support On Error
.
In a future PR, I'd like to split Redim
into two helpers. One for a normal Redim
and one for a Preserve
. We could also pass the dimensions in as a variable argument list instead of an array. I think this would make the transpiled code look cleaner.
Thanks for the review guys! |
This PR adds a new object
VbsArray
, which should be used in the scripting API, i.e. what the table script and its dependencies deal with when they get an array.It's a proxy that is iterable and can set and get values, but returns an
VbsUndefined
object instead of justundefined
when an index doesn't exist.VbsUndefined
is an empty proxy that either throws an exception when VBS error handling is enabled (On Error Goto 0
), or sets theErr
object accordingly (ifOn Error Resume
) if it's accessed.This should mitigate the problem we have in #141. It's actually another fifth solution to the proposed other four.
It might needs to be extended to objects, but I think it's the cleanest solution for now.
TODO
VbsArray