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 upscript creates methods taking '*mut JSContext' unsafe #11595
Conversation
highfive
commented
Jun 3, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jun 3, 2016
|
Travis build is failing due to |
rebase + marked the necessary new code as unsafe
4e586ab
to
0c6b26a
highfive
commented
Jun 4, 2016
|
New code was committed to pull request. |
|
Sorry for the delay here; someone else should take this over from me. |
|
-S-awaiting-review +S-needs-code-changes
|
|
Review status: all files reviewed at latest revision, 22 unresolved discussions. a discussion (no related file):
|
|
|
|
Review status: all files reviewed at latest revision, 22 unresolved discussions, some commit checks failed. a discussion (no related file):
|
|
Review status: all files reviewed at latest revision, 22 unresolved discussions, some commit checks failed. a discussion (no related file):
|
|
@ab22 Are you still working on this? |
|
@KiChjang go ahead and assign someone else. I'm having a hard time finding spare time to work on this. |
| // https://html.spec.whatwg.org/multipage/#dom-imagedata-data | ||
| fn Data(&self, _: *mut JSContext) -> *mut JSObject { | ||
| unsafe fn Data(&self, _: *mut JSContext) -> *mut JSObject { |
This comment has been minimized.
This comment has been minimized.
fflorent
Oct 2, 2016
Contributor
The context looks to be ignored here (and also in other places). Should we make this constructor unsafe anyway?
This comment has been minimized.
This comment has been minimized.
nox
Oct 2, 2016
Member
This is a method generated by codegen, so yes it needs to be unsafe, because codegen cannot know that the implementation may be safe.
…ontent-unsafe, r=nox 11485 make dom methods taking mut js content unsafe This is a rebased version of PR #11595 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #11485 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because: no code logic was changed <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/14096) <!-- Reviewable:end -->
ab22 commentedJun 3, 2016
•
edited
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsJust as additional information, in case I missed any, these are the places where I found
*mut JSContextoncomponents/script/dom/bindings/codegen/CodegenRust.py:Places modified:
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L2221-L2224
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L2366-L2367
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L2498-L2501
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L2648-L2652
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L2784-L2788
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L6209-L6212
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4965
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L5621
Places not modified (already extern or unsafe):
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3070-L3075
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3095-L3098
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3143-L3147
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3198-L3202
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3663-L3665
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3788-L3792
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3917-L3919
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L3935-L3936
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4436-L4440
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4522-L4526
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4582-L4585
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4604-L4607
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4659-L4663
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4700-L4702
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4750-L4753
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4823-L4824
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L4915-L4922
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L5290-L5293
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L5311-L5318
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L5809-L5811
JSContext params are stripped here:
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L5713
Can't find code where this is called:
https://github.com/servo/servo/blob/master/components/script/dom/bindings/codegen/CodegenRust.py#L6003
This change is