Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix binding generation for overloaded functions with optionals and de… #19180
+14
−7
Conversation
| @@ -483,7 +483,8 @@ def pickFirstSignature(condition, filterLambda): | |||
| else: | |||
| # Just throw; we have no idea what we're supposed to | |||
| # do with this. | |||
| caseBody.append(CGGeneric("return Throw(cx, NS_ERROR_XPC_BAD_CONVERT_JS);")) | |||
| caseBody.append(CGGeneric("throw_internal_error(cx, \"NS_ERROR_XPC_BAD_CONVERT_JS\");\n" | |||
This comment has been minimized.
This comment has been minimized.
jdm
Nov 10, 2017
Member
Let's pass "Could not convert JavaScript argument" instead: https://dxr.mozilla.org/mozilla-central/source/js/xpconnect/src/xpc.msg#20
…fault values
|
@bors-servo r+ |
|
|
bors-servo
added a commit
that referenced
this pull request
Nov 11, 2017
Fix binding generation for overloaded functions with optionals and de…
…fault values
The generated bindings for an interface like this:
```webidl
void someFunction(Foo foo, optional long a = 0, optional long b = 1);
void someFunction(Bar bar, optional long a = 0);
```
are failing to build with an error like:
```bash
error[E0425]: cannot find function `Throw` in this scope
--> /Users/ferjm/dev/mozilla/servo/target/debug/build/script-7b1a12ddd08207e3/out/Bindings/TestBindingBinding.rs:15395:24
|
15395 | return Throw(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
| ^^^^^ not found in this scope
error[E0425]: cannot find value `NS_ERROR_XPC_BAD_CONVERT_JS` in this scope
--> /Users/ferjm/dev/mozilla/servo/target/debug/build/script-7b1a12ddd08207e3/out/Bindings/TestBindingBinding.rs:15395:34
|
15395 | return Throw(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `Throw` in this scope
--> /Users/ferjm/dev/mozilla/servo/target/debug/build/script-7b1a12ddd08207e3/out/Bindings/TestBindingBinding.rs:15468:24
|
15468 | return Throw(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
| ^^^^^ not found in this scope
error[E0425]: cannot find value `NS_ERROR_XPC_BAD_CONVERT_JS` in this scope
--> /Users/ferjm/dev/mozilla/servo/target/debug/build/script-7b1a12ddd08207e3/out/Bindings/TestBindingBinding.rs:15468:34
|
15468 | return Throw(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error: aborting due to 4 previous errors
error: Could not compile `script`.
```
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes
** Note that this depends** on servo/rust-mozjs#379
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19180)
<!-- Reviewable:end -->
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ferjm commentedNov 10, 2017
•
edited
…fault values
The generated bindings for an interface like this:
are failing to build with an error like:
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors** Note that this depends** on servo/rust-mozjs#379
This change is