diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index ad978f245cb..737c8786f83 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -119,12 +119,6 @@ static HRESULT String_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r return S_OK; } -static HRESULT String_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("%p\n", jsthis); - return E_NOTIMPL; -} - static HRESULT stringobj_to_string(vdisp_t *jsthis, jsval_t *r) { StringInstance *string; @@ -1539,7 +1533,7 @@ static const builtin_prop_t String_props[] = { {indexOfW, String_indexOf, PROPF_METHOD|2}, {italicsW, String_italics, PROPF_METHOD}, {lastIndexOfW, String_lastIndexOf, PROPF_METHOD|2}, - {lengthW, NULL,0, String_get_length, String_set_length}, + {lengthW, NULL,0, String_get_length}, {linkW, String_link, PROPF_METHOD|1}, {localeCompareW, String_localeCompare, PROPF_METHOD|1}, {matchW, String_match, PROPF_METHOD|1}, @@ -1571,7 +1565,7 @@ static const builtin_info_t String_info = { }; static const builtin_prop_t StringInst_props[] = { - {lengthW, NULL,0, String_get_length, String_set_length} + {lengthW, NULL,0, String_get_length} }; static const builtin_info_t StringInst_info = { diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index f124c4698ac..f9178a9713f 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -408,6 +408,12 @@ ok(str.toString() === "", "str.toString() = " + str.toString()); var str = new String("test", "abc"); ok(str.toString() === "test", "str.toString() = " + str.toString()); +str = new String("test"); +ok(str.length === 4, "str.length = " + str.length); +str.length = 3; +str.length = 5; +ok(str.length === 4, "str.length = " + str.length); + var strObj = new Object(); strObj.toString = function() { return "abcd" }; strObj.substr = String.prototype.substr; diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index efdfb0a7161..10963074837 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -166,6 +166,7 @@ function test_getOwnPropertyDescriptor() { test_own_data_prop_desc(Math, "PI", false, false, false); var obj = new String(); + test_own_data_prop_desc(obj, "length", false, false, false); ok(Object.getOwnPropertyDescriptor(obj, "slice") === undefined, "getOwnPropertyDescriptor(slice) did not return undefined"); test_own_data_prop_desc(String.prototype, "slice", true, false, true);