зеркало из https://github.com/mozilla/gecko-dev.git
[INFER] Mark generic scripted functions as having unknown properties / return type, bug 643285.
This commit is contained in:
Родитель
74227b493f
Коммит
3acc60ac4b
|
@ -0,0 +1,4 @@
|
|||
function fun() {
|
||||
(new Function ("function ff () { actual = '' + ff. caller; } function f () { ff (); } f ();")) ('function pf' + fun + '() {}');
|
||||
}
|
||||
fun();
|
|
@ -2756,6 +2756,14 @@ js_InitFunctionClass(JSContext *cx, JSObject *obj)
|
|||
if (!proto)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* The default 'new' object for Function.prototype has unknown properties.
|
||||
* This will be used for generic scripted functions, e.g. from non-compileAndGo code.
|
||||
*/
|
||||
TypeObject *newType = proto->getNewType(cx);
|
||||
if (!newType || !cx->markTypeObjectUnknownProperties(newType))
|
||||
return NULL;
|
||||
|
||||
JSFunction *fun = js_NewFunction(cx, proto, NULL, 0, JSFUN_INTERPRETED, obj, NULL, NULL, NULL);
|
||||
if (!fun)
|
||||
return NULL;
|
||||
|
|
Загрузка…
Ссылка в новой задаче