-
Notifications
You must be signed in to change notification settings - Fork 323
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
Execute foreign function and check autoscoped constructor result #10187
Merged
+112
−25
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aa05145
Test that yields: Not_Invokable.Error (a, b) => a + b
JaroslavTulach 890cba4
Support execute on TruffleObject
JaroslavTulach ab0724c
Check if autoscoped constructor really produces Atom
JaroslavTulach 55dce2f
Pick prototype's scope to begin with
JaroslavTulach 4584c66
Merge remote-tracking branch 'origin/develop' into wip/jtulach/Foreig…
JaroslavTulach fe14b8d
Execute JavaScript with insufficient number of arguments
JaroslavTulach 98fff4d
There is no such thing as partially applied autoscope constructor any…
JaroslavTulach 48af079
add: runtime test
4e6 84f4198
misc: runtime test cleanup
4e6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -448,6 +448,21 @@ add_specs suite_builder = | |
foo = v:Foo | ||
Foo.Value 10 . should_equal foo | ||
|
||
group_builder.specify "Foo.Value constructor is not autoscoped" <| | ||
|
||
v = ..Value | ||
err = Test.expect_panic Type_Error <| | ||
f = v:Foo | ||
f | ||
|
||
msg = err.to_text | ||
|
||
msg . should_contain "Type error:" | ||
msg . should_contain "Expected `..Value` to be Foo" | ||
msg . should_contain "got Foo.Value[" | ||
msg . should_contain "foo=_" | ||
msg . should_contain "Try to apply foo argument" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running from Standard.Base import all
type Foo
Value a
main =
v = ..Value
f = v:Foo
f yields
|
||
|
||
group_builder.specify "..False can be autoscoped" <| | ||
|
||
bool b:Boolean = b | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
would be nice to also see what happens if I try to specify more or less arguments to the function. Can you do, e.g.,
?
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.
Invoking:
yields
NaN
as3 + undefined
isNaN
.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.
I'd expect it to behave the same way as if
js_plus
was an enso function. I.e.main
should return a functionThere 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.
Tested in fe14b8d
You might expect it, but there is no chance to achieve such behavior. JavaScript functions don't have a fixed arity. You can invoke them with any number of arguments. If you want that to be changed, then you need to beg for a change of the ECMAScript specification ;-)
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.
You're right, I didn't think about that