creepjs
creepjs copied to clipboard
what is ```- failed prototype test execution```
how its getting determined in a proxied object
- failed prototype test execution
It means that the test silently failed to complete due to an unforeseen error.
like which error bro any examples
It can be any error produced by the client. There should be none. Are you seeing - failed prototype test execution
in a clean browser?
no only when using proxied object
get(target, ctx) {
var methods = ["call", "bind", "apply", "toString", "string"];
if(methods.includes(ctx)) {
return target[ctx].bind(target);
} else if(typeof ctx === 'symbol') {
return target[ctx];
} else {
return target.bind(target);
}
}
like this when using proxy
I see. It's likely a side effect of the way that proxy object is written. I have no solution, but you can run the test script and log the error. Let's leave the issue open. I will set a task to auto log this error to the console.
Ok will update
i believe
Object prototype may only be an Object or null: undefined
TypeError: Object prototype may only be an Object or null: undefined
at Reflect.setPrototypeOf (<anonymous>)
at Object.setPrototypeOf (<anonymous>:361:46)
at Function.setPrototypeOf (<anonymous>)
at getNullConversionTypeErrorLie (https://example.com/test.js:189:12)
at getLies (https://example.com/test.js:534:39)
at https://example.com/test.js:649:15
at Array.forEach (<anonymous>)
at searchLies (https://example.com/test.js:600:18)
at getPrototypeLies (https://example.com/test.js:729:3)
at https://example.com/test.js:772:58
this causing the issue
try {
const proto = obj.prototype ? obj.prototype : obj
let res // response from getLies
// search if function
try {
const apiFunction = proto[name] // may trigger TypeError
if (typeof apiFunction == 'function') {
res = getLies({
apiFunction: proto[name],
proto,
lieProps: props
})
if (res.lied) {
return (props[apiName] = res.lieTypes)
}
return
}
// since there is no TypeError and the typeof is not a function,
// handle invalid values and ingnore name, length, and constants
if (
name != 'name' &&
name != 'length' &&
name[0] !== name[0].toUpperCase()) {
const lie = [`failed descriptor.value undefined`]
return (
props[apiName] = lie
)
}
} catch (error) { }
// else search getter function
const getterFunction = Object.getOwnPropertyDescriptor(proto, name).get
res = getLies({
apiFunction: getterFunction,
proto,
obj,
lieProps: props
}) // send the obj for special tests
if (res.lied) {
return (props[apiName] = res.lieTypes)
}
return
} catch (error) {
const lie = `failed prototype test execution`
return (
props[apiName] = [lie]
)
}
try block failed and triggered the error and when capturing the error above on the console
specifically this error happens only when the proxied is property like Navigator.prototype.platform
but proxying other functions like Element.prototype.setAttribute
not causing any errors