This repository was archived by the owner on Nov 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Add lifetimes for Handle and MutableHandle #393
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b90c4ba
Make Handle take lifetimes
marmistrz c534a12
Add lifetimes for MutableHandle
marmistrz 4331642
Fix the tests and MutableHandle::handle
marmistrz ac7db1c
Remove the conversions from Handle to RawHandle
marmistrz 2c207ee
Make null and undefined handlevalues static
marmistrz 0372723
Make Heap::handle return a Handle
marmistrz cfa8046
Add wrappers for raw handle methods
marmistrz f4cd26d
Merge remote-tracking branch 'upstream/master'
marmistrz fdaa1a0
review fixes
marmistrz a28e3e7
Fix a double space
marmistrz 343ee62
Make from_raw public, it's used in interface.rs in servo
marmistrz dc4decc
Add wrappers for glue
marmistrz 8ebb20f
Get rid of Unbox
marmistrz 855b4ee
Use a pointer and a phantom for MutableHandle
marmistrz d58120c
Merge remote-tracking branch 'upstream/master'
marmistrz 709357f
bump the version
marmistrz 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# This is one big heuristic but seems to work well enough | ||
grep_heur() { | ||
grep -v "link_name" "$1" | \ | ||
grep -v '"\]' | \ | ||
grep -F -v '/\*\*' | \ | ||
sed -z 's/,\n */, /g' | \ | ||
sed -z 's/:\n */: /g' | \ | ||
sed -z 's/\n *->/ ->/g' | \ | ||
grep -v '^\}$' | \ | ||
sed 's/^ *pub/pub/' | \ | ||
sed -z 's/\;\n/\n/g' | \ | ||
grep 'pub fn' | \ | ||
grep Handle | \ | ||
grep -v roxyHandler | \ | ||
grep -v 'pub fn Unbox' | # this function seems to be platform specific \ | ||
sed 's/Handle<\*mut JSObject>/HandleObject/g' | ||
} | ||
|
||
grep_heur jsapi_linux_64.rs | sed 's/\(.*\)/wrap!(jsapi: \1);/g' > jsapi_wrappers.in | ||
grep_heur glue.rs | sed 's/\(.*\)/wrap!(glue: \1);/g' > glue_wrappers.in |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
wrap!(glue: pub fn InvokeGetOwnPropertyDescriptor(handler: *const ::libc::c_void, cx: *mut JSContext, proxy: HandleObject, id: HandleId, desc: MutableHandle<PropertyDescriptor>) -> bool); | ||
wrap!(glue: pub fn InvokeHasOwn(handler: *const ::libc::c_void, cx: *mut JSContext, proxy: HandleObject, id: HandleId, bp: *mut bool) -> bool); | ||
wrap!(glue: pub fn CallJitGetterOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); | ||
wrap!(glue: pub fn CallJitSetterOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); | ||
wrap!(glue: pub fn CallJitMethodOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); | ||
wrap!(glue: pub fn NewProxyObject(aCx: *mut JSContext, aHandler: *const ::libc::c_void, aPriv: HandleValue, proto: *mut JSObject, parent: *mut JSObject, call: *mut JSObject, construct: *mut JSObject) -> *mut JSObject); | ||
wrap!(glue: pub fn WrapperNew(aCx: *mut JSContext, aObj: HandleObject, aHandler: *const ::libc::c_void, aClass: *const JSClass, aSingleton: bool) -> *mut JSObject); | ||
wrap!(glue: pub fn NewWindowProxy(aCx: *mut JSContext, aObj: HandleObject, aHandler: *const ::libc::c_void) -> *mut JSObject); | ||
wrap!(glue: pub fn RUST_JSID_IS_INT(id: HandleId) -> bool); | ||
wrap!(glue: pub fn RUST_JSID_TO_INT(id: HandleId) -> i32); | ||
wrap!(glue: pub fn RUST_JSID_IS_STRING(id: HandleId) -> bool); | ||
wrap!(glue: pub fn RUST_JSID_TO_STRING(id: HandleId) -> *mut JSString); |
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.
We should modify the ToJSValConvertible trait to accept a lifetime argument and use it for the rval argument.