mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Pass the receiver to get_property_on_prototype (fixes #11600)
This commit is contained in:
parent
f70fa98954
commit
6c1167b1e2
3 changed files with 4 additions and 9 deletions
|
@ -5050,7 +5050,7 @@ if !expando.is_null() {
|
||||||
|
|
||||||
%s
|
%s
|
||||||
let mut found = false;
|
let mut found = false;
|
||||||
if !get_property_on_prototype(cx, proxy, id, &mut found, vp) {
|
if !get_property_on_prototype(cx, proxy, receiver, id, &mut found, vp) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ use js::jsapi::{JS_GetProperty, JS_GetPrototype, JS_GetReservedSlot, JS_HasPrope
|
||||||
use js::jsapi::{JS_HasPropertyById, JS_IsExceptionPending, JS_IsGlobalObject};
|
use js::jsapi::{JS_HasPropertyById, JS_IsExceptionPending, JS_IsGlobalObject};
|
||||||
use js::jsapi::{JS_ResolveStandardClass, JS_SetProperty, ToWindowProxyIfWindow};
|
use js::jsapi::{JS_ResolveStandardClass, JS_SetProperty, ToWindowProxyIfWindow};
|
||||||
use js::jsapi::{JS_StringHasLatin1Chars, MutableHandleValue, ObjectOpResult};
|
use js::jsapi::{JS_StringHasLatin1Chars, MutableHandleValue, ObjectOpResult};
|
||||||
use js::jsval::{JSVal, ObjectValue, UndefinedValue};
|
use js::jsval::{JSVal, UndefinedValue};
|
||||||
use js::rust::{GCMethods, ToString};
|
use js::rust::{GCMethods, ToString};
|
||||||
use libc;
|
use libc;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
|
@ -129,6 +129,7 @@ pub type ProtoOrIfaceArray = [*mut JSObject; PROTO_OR_IFACE_LENGTH];
|
||||||
/// Returns false on JSAPI failure.
|
/// Returns false on JSAPI failure.
|
||||||
pub unsafe fn get_property_on_prototype(cx: *mut JSContext,
|
pub unsafe fn get_property_on_prototype(cx: *mut JSContext,
|
||||||
proxy: HandleObject,
|
proxy: HandleObject,
|
||||||
|
receiver: HandleValue,
|
||||||
id: HandleId,
|
id: HandleId,
|
||||||
found: *mut bool,
|
found: *mut bool,
|
||||||
vp: MutableHandleValue)
|
vp: MutableHandleValue)
|
||||||
|
@ -148,8 +149,7 @@ pub unsafe fn get_property_on_prototype(cx: *mut JSContext,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
rooted!(in(cx) let receiver = ObjectValue(&*proxy.get()));
|
JS_ForwardGetPropertyTo(cx, proto.handle(), id, receiver, vp)
|
||||||
JS_ForwardGetPropertyTo(cx, proto.handle(), id, receiver.handle(), vp)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get an array index from the given `jsid`. Returns `None` if the given
|
/// Get an array index from the given `jsid`. Returns `None` if the given
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[HTMLCollection-as-proto-length-get-throws.html]
|
|
||||||
type: testharness
|
|
||||||
[HTMLcollection as a prototype should not allow getting .length on the base object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue