Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Extract InCompartment API helper from Servo #491

Open
jdm opened this issue Jan 8, 2020 · 1 comment
Open

Extract InCompartment API helper from Servo #491

jdm opened this issue Jan 8, 2020 · 1 comment

Comments

@jdm
Copy link
Member

jdm commented Jan 8, 2020

https://github.com/servo/servo/blob/da559d47b93854e4c7d4acf0a0d2029a9e643794/components/script/compartments.rs

We should bring the AlreadyInCompartment and InCompartment types into this crate (renaming them to AlreadyInRealm and InRealm in the process), and make the assert method take a *mut JSObject object instead. This will allow us to add a InCompartment argument to ToJSValConvertible, avoiding a source of crashes.

@jdm
Copy link
Member Author

jdm commented Jan 8, 2020

We could also add it to the typed array construction API in

unsafe fn create_new(cx: *mut JSContext, length: u32) -> *mut JSObject;
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant