RuntimeContext.throw to break out of current function in non-strict #3056
Denneisk
started this conversation in
Suggestions
Replies: 1 comment
-
Super better alternative: write all future functions with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It would just be nice if calling
throw
would return from the function in non-strict usage. That way I could simplify the following construct:Additionally, you could run
fixDefault
to automatically return a default value if one isn't specified.Pros:
Cons:
Yes it's dumb, but it's just so much nicer and it's forward-thinking as extension developers shouldn't have to adapt their code for non-strict behavior.
Why not inline?
Assume
validate
is more complex.Inlining this would be a lot of repeated code.
Beta Was this translation helpful? Give feedback.
All reactions