Fix #2108 by renaming unwrap functions to native_from_reflector

As noted by @bholley. "unwrap" is confusing because we are
both stripping off wrappers *and* getting a native from a
reflector. Changing the "unwrap" usage to "native_from_reflector"
for clarity.

This renames 'unwrap' to 'native_from_reflector' and
'unwrap_jsmanaged' to 'native_from_reflector_jsmanaged'.
This commit is contained in:
Chris Double 2015-03-12 19:06:07 +13:00
parent 7b6e314df1
commit 2af19b2675
5 changed files with 13 additions and 13 deletions

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::conversions::unwrap_jsmanaged;
use dom::bindings::conversions::native_from_reflector_jsmanaged;
use dom::bindings::conversions::{ToJSValConvertible};
use dom::bindings::js::{JS, JSRef, Temporary, Root};
use dom::bindings::js::{OptionalRootable, OptionalRootedRootable, ResultRootable};
@ -108,7 +108,7 @@ unsafe fn GetSubframeWindow(cx: *mut JSContext, proxy: *mut JSObject, id: jsid)
let index = get_array_index_from_id(cx, id);
if let Some(index) = index {
let target = GetProxyPrivate(proxy).to_object();
let win: Root<Window> = unwrap_jsmanaged(target).unwrap().root();
let win: Root<Window> = native_from_reflector_jsmanaged(target).unwrap().root();
let mut found = false;
return win.r().IndexedGetter(index, &mut found);
}