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

Replicate CallArgs::{get, index, index_mut} onto JSJitMethodCallArgs #223

Merged
merged 1 commit into from Dec 7, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Replicate CallArgs::{get, index, index_mut} onto JSJitMethodCallArgs

  • Loading branch information
KiChjang committed Dec 6, 2015
commit ac7e773f7d92fa12553911ceb7b7cc4e79621f6b
@@ -537,13 +537,23 @@ impl Drop for JSAutoCompartment {

impl JSJitMethodCallArgs {
pub fn get(&self, i: u32) -> HandleValue {
unsafe {
if i < self._base.argc_ {
HandleValue::from_marked_location(self._base._base.argv_.offset(i as isize))
} else {
UndefinedHandleValue
}
}
}

pub fn index(&self, i: u32) -> HandleValue {
assert!(i < self._base.argc_);
unsafe {
HandleValue::from_marked_location(self._base._base.argv_.offset(i as isize))
}
}

pub fn get_mut(&self, i: u32) -> MutableHandleValue {
pub fn index_mut(&self, i: u32) -> MutableHandleValue {
assert!(i < self._base.argc_);
unsafe {
MutableHandleValue::from_marked_location(self._base._base.argv_.offset(i as isize))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.