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

funcResult.GetType() doesn't guard against GetType being undefined. #26

Closed
mwchase opened this issue Sep 18, 2016 · 4 comments
Closed

Comments

@mwchase
Copy link

mwchase commented Sep 18, 2016

I'm experimenting with external functions, in particular just echoing back input, which has all kinds of confusing behavior currently. (For example, you can get a Path by passing in a divert, but I can't figure out how to send it back. For another example, returning strings is weirdly finicky.)

Many of the issues seem to come from funcResult.GetType(), currently on line 904 of Story.js, throwing an error because funcResult.GetType is not a function. This prevents the warning from being printed, and halts execution.

@y-lohse
Copy link
Owner

y-lohse commented Sep 18, 2016

Mmmh, yeah, must have skipped that one. I fixed it on the dev branch, but if you have an example of ink file that runs into this error, I could use it to confirm it's ok now.

y-lohse added a commit that referenced this issue Sep 18, 2016
@mwchase
Copy link
Author

mwchase commented Sep 19, 2016

Here's the code I mentioned. It's currently using an unminified version of the latest iife (so I can get line numbers out of the tracebacks), but switching between them should be fine.
testing.zip
Here's what the output looks like in Inky, using fallbacks that just echo their input:
screen shot 2016-09-19 at 5 37 28 pm

EDIT: I should have included testing.ink as well. It's some pretty abusive code, for its size. Various things you can uncomment to see how they react.
testing.ink.zip
(FWIW, the current C# behavior when passing a divert to an external function is apparently to coerce it to a string.)

@y-lohse
Copy link
Owner

y-lohse commented Sep 20, 2016

Great, thank you. I'll have a go with it.

@y-lohse
Copy link
Owner

y-lohse commented Sep 21, 2016

TBH I don't have time to look at the testing.ink file, but running your html file with the dev version of ink produces the same output as inky and no errors, so it should be ok. But feel free to open another issue if you notice a wrong behavior with diverts etc :-)

@y-lohse y-lohse closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants