diff --git a/src/context/mod.rs b/src/context/mod.rs index 2476efbba..2487974ef 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -11,7 +11,7 @@ use neon_runtime; use neon_runtime::raw; use borrow::{Ref, RefMut, Borrow, BorrowMut}; use borrow::internal::Ledger; -use types::{Value, JsValue, JsObject, JsArray, JsFunction, JsBoolean, JsNumber, JsString, StringResult, JsNull, JsUndefined}; +use types::{Managed, Value, JsValue, JsObject, JsArray, JsFunction, JsBoolean, JsNumber, JsString, StringResult, JsNull, JsUndefined}; use types::binary::{JsArrayBuffer, JsBuffer}; use types::error::JsError; use object::{Object, This}; @@ -456,12 +456,10 @@ impl<'a, T: This> CallContext<'a, T> { a.downcast_or_throw(self) } -/* - /// Produces a handle to the `this`-binding. - pub fn this(&mut self) -> Handle<'a, T> { - Handle::new_internal(T::as_this(self.info.this(self))) + /// Produces a handle to the called function's `this`-binding. + pub fn this(&mut self) -> &'a T { + T::as_this(self.info.this(self).to_raw()) } -*/ } impl<'a, T: This> ContextInternal<'a> for CallContext<'a, T> { diff --git a/src/prelude.rs b/src/prelude.rs index af51c3434..59bfaf816 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -1,8 +1,8 @@ //! A convenience module that re-exports the most commonly-used Neon APIs. -pub use types::{JsBuffer, JsArrayBuffer, BinaryData, JsError, JsUndefined, JsNull, JsBoolean, JsString, JsNumber, /*JsObject,*/ /*JsArray,*/ JsFunction, Value}; +pub use types::{JsBuffer, JsArrayBuffer, BinaryData, JsError, JsUndefined, JsNull, JsBoolean, JsString, JsNumber, JsObject, JsArray, JsFunction, Value}; pub use object::{Object, Class}; pub use borrow::{Borrow, BorrowMut}; -pub use context::{CallKind, Context, ModuleContext, /*ExecuteContext, ComputeContext,*/ CallContext, FunctionContext, MethodContext, TaskContext}; +pub use context::{CallKind, Context, ModuleContext, ExecuteContext, ComputeContext, CallContext, FunctionContext, MethodContext, TaskContext}; pub use result::NeonResult; pub use task::Task;