-
Notifications
You must be signed in to change notification settings - Fork 58
Additional fixes. #39
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
Additional fixes. #39
Conversation
Unfortunately there's no other way to suppress them optionally that I can find, and they were the only warnings in our build.
Import paths can be in the format: relative/to/script.js /absolute/path/to/script.js ~/relative/to/home/script.js
BohemianCoding/Sketch#3319 Script import: Add support for absolute and ~ paths
Also guards against multiple imports of the same URL, and therefore circular imports Ref BohemianCoding/Sketch#3319
BohemianCoding/Sketch#3319 Add support for nested @import statements
Fix a bug which ignored first line of @import-ed scripts
The theory here is that JS references to objects may be in the ffi arguments as raw pointers, so it's a good idea to protect everything. May be spurious...
…get created but aren't referenced from JS anywhere at the point the struct is made, so I suspect that they might be destroyed again immediately.
We will "leak" any object in the map until the JS reference is garbage collected, or until the end of the script session - which is not ideal, but better than crashing.
…and ensure everything gets disposed of.
# Conflicts: # Cocoa Script.xcodeproj/project.pbxproj # src/framework/mocha/MochaRuntime.m # src/framework/mocha/Objects/MOBox.m
Make sure that boxes get dissassociated and clean out the JS object's private pointer, before they are dealloced.
…tom class instead of a dictionary.
(if we ever conclude that this code is good, I can make more of an attempt to factor it out into some more manageable PRs - for now this is mostly just FYI) |
4f65077
to
363a1eb
Compare
Thanks- I'll take a look at this when I get a chance. I'd like to merge in all your changes as well- but there's some stuff that I need to sort through and figure out what's breaking Acorn. |
Sure - no hurry, and just yell if you need a hand disentangling our stuff :) |
Oops - this branch got deleted on our end, so the PR went away. I'll make another. |
This is an evolution of the code in PR #34. We've had some crashes reported for Sketch using that code, so I've refined it further.
I still don't think I've got all the crashes out, so I will probably have to reinstate the JSValueProtect hack in the meantime.
Debugging this code is quite interesting though.
I've downgraded a couple of the assertions to just be debug() statements, and I get the "box should have been disassociated" one firing occasionally, seemingly when things are being cleaned up.
It looks like it's firing for something that was passed as a parameter in a function call, though I'm not 100% certain.