From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/jscript/function.c | 6 ++++++ dlls/mshtml/tests/documentmode.js | 10 ++++++++++ 2 files changed, 16 insertions(+)
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 567e2596969..2e811b857cd 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -976,10 +976,16 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod return S_OK; }
+static const builtin_prop_t HostFunction_props[] = { + {L"arguments", NULL, 0, Function_get_arguments}, +}; + static const builtin_info_t HostFunction_info = { .class = JSCLASS_FUNCTION, .call = Function_value, .destructor = Function_destructor, + .props_cnt = ARRAY_SIZE(HostFunction_props), + .props = HostFunction_props, .gc_traverse = Function_gc_traverse };
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 1987112166d..58c04800696 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -387,12 +387,19 @@ sync_test("builtin_obj", function() { window.toString.call(null); ok(false, "expected exception calling window.toString with null context"); }catch(ex) {} + + ok(!Object.hasOwnProperty.call(f, "arguments"), "arguments is a prop of createElement"); + ok(!Object.hasOwnProperty.call(f, "caller"), "caller is a prop of createElement"); + ok(!Object.hasOwnProperty.call(f, "length"), "length is a prop of createElement"); }else { ok(Object.getPrototypeOf(f) === Function.prototype, "unexpected document.createElement prototype"); e = window.toString.call(null); ok(e === "[object Window]", "window.toString with null context = " + e); e = window.toString.call(external.nullDisp); ok(e === "[object Window]", "window.toString with nullDisp context = " + e); + + ok(f.hasOwnProperty("arguments"), "arguments not a prop of createElement"); + ok(!f.hasOwnProperty("length"), "length is a prop of createElement"); }
e = 0; @@ -4038,6 +4045,9 @@ sync_test("constructors", function() { }catch(e) { ok(e.number === 0x0ffff - 0x80000000, "new XMLHttpRequest.create() threw " + e.number); } + todo_wine. + ok(XMLHttpRequest.create.hasOwnProperty("arguments"), "arguments not a prop of XMLHttpRequest.create"); + ok(!XMLHttpRequest.create.hasOwnProperty("length"), "length is a prop of XMLHttpRequest.create");
r = Object.getOwnPropertyDescriptor(HTMLMetaElement, "prototype"); ok(r.value === HTMLMetaElement.prototype, "HTMLMetaElement.prototype value = " + r.value);