Skip to content

Commit

Permalink
handles to generic Tagged instead of Value
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Herman committed Nov 17, 2015
1 parent 5971964 commit d1c8d63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/internal/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl ObjectInternal for Object {
impl Object {
// FIXME: make get/set overloadable with a `PropertyName` trait that has private unsafe get/set methods
// FIXME: make it generic instead of Value
pub fn get<'a, T: Scope<'a>>(&mut self, _: &mut T, mut key: Handle<Value>) -> JS<'a, Value> {
pub fn get<'a, T: Scope<'a>, K: Tagged>(&mut self, _: &mut T, mut key: Handle<K>) -> JS<'a, Value> {
unsafe {
// FIXME: could use a Value build_opt
let mut result = Value::zero_internal();
Expand All @@ -414,7 +414,7 @@ impl Object {
// FIXME: overloadable with a `PropertyName` trait
// FIXME: make it generic instead of Value
// FIXME: kill the scope argument here?
pub fn set<'a, T: Scope<'a>>(&mut self, scope: &mut T, key: &str, val: Handle<Value>) -> Result<bool> {
pub fn set<'a, T: Scope<'a>, V: Tagged>(&mut self, scope: &mut T, key: &str, val: Handle<V>) -> Result<bool> {
let mut key = try!(String::new(scope, key).ok_or(Throw));
let mut result = false;
if unsafe { Nan_Set(&mut result, self.to_raw_mut_ref(), key.to_raw_mut_ref(), val.to_raw_ref()) } {
Expand Down

0 comments on commit d1c8d63

Please sign in to comment.