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

GlobalScope::current should return Option #17238

Closed
jdm opened this issue Jun 8, 2017 · 12 comments
Closed

GlobalScope::current should return Option #17238

jdm opened this issue Jun 8, 2017 · 12 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Jun 8, 2017

It invokes CurrentGlobalOrNull but does not actually handle the null case and asserts in global_scope_from_global.

@jdm jdm added the A-content/dom label Jun 8, 2017
@jdm jdm mentioned this issue Jun 8, 2017
4 of 5 tasks complete
@fnune
Copy link
Contributor

@fnune fnune commented Jun 8, 2017

I would like to work on this, considering I've been working on the PR where this was originated.

@jdm
Copy link
Member Author

@jdm jdm commented Jun 8, 2017

Sure! I expect in many cases we can just attach .expect("No current global object") to the existing uses of the API.

@fnune
Copy link
Contributor

@fnune fnune commented Jun 8, 2017

Sounds good, I'll be on it in the weekend. If you think you'd like to do this earlier, I'd have no problems with that :)

@jdm
Copy link
Member Author

@jdm jdm commented Jun 8, 2017

Nope, no hurry!

@cbrewster cbrewster added the C-assigned label Jun 9, 2017
@jdm
Copy link
Member Author

@jdm jdm commented Jun 20, 2017

@brainlessdeveloper Have you made progress on this?

@jdm jdm added the E-easy label Jun 20, 2017
@highfive
Copy link

@highfive highfive commented Jun 20, 2017

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@fnune
Copy link
Contributor

@fnune fnune commented Jun 20, 2017

I've been quite busy recently, I wouldn't mind if you unassign me. I have to complete #16508 too.

@jdm jdm removed the C-assigned label Jun 21, 2017
@moonlightdrive
Copy link
Contributor

@moonlightdrive moonlightdrive commented Jun 22, 2017

@highfive: assign me

I have a PR waiting for review, but would like to take a look at this in the meantime.. if that's alright?

@highfive highfive added the C-assigned label Jun 22, 2017
@highfive
Copy link

@highfive highfive commented Jun 22, 2017

Hey @moonlightdrive! Thanks for your interest in working on this issue. It's now assigned to you!

@jdm
Copy link
Member Author

@jdm jdm commented Jun 22, 2017

Yes, please do. I'm going to be dealing with that PR soon; sorry for the delay.

@moonlightdrive
Copy link
Contributor

@moonlightdrive moonlightdrive commented Jun 22, 2017

@jdm no worries!

How should I verify that my changes work? Is there a particular test I should run?

@jdm
Copy link
Member Author

@jdm jdm commented Jun 22, 2017

If you make the API return Option and use expect() in every existing case, there will be no functional change.

bors-servo added a commit that referenced this issue Jun 23, 2017
…sajeffrey

return Option from GlobalScope::current

<!-- Please describe your changes on the following line: -->
handles the case where `GlobalScope::current` calls `CurrentGlobalOrNull` and the result is null

---
<!-- 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 #17238

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because: no functionality change & ./mach build -d has no errors

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17472)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.