Commit Graph

210 Commits

Author SHA1 Message Date
Gabriel Ivăncescu ce1b3f5f1d jscript: Replace the value_prop in builtin_info with a call method.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:20:29 +01:00
Gabriel Ivăncescu adad455049 jscript: Get rid of the value_prop from jsdisp props.
The mapping between DISPID and index into props has to be adjusted since
the value_prop (props[0]) is now gone.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:20:25 +01:00
Gabriel Ivăncescu 8b3afbe402 jscript: Access the PROTREF with proper index instead of get_prop.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 18:48:42 +01:00
Gabriel Ivăncescu 5842ec60e2 jscript: Use ~0 to mark invalid bucket.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 18:48:40 +01:00
Gabriel Ivăncescu 464134c20f jscript: Use to_primitive when getting the default value.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 18:48:37 +01:00
Gabriel Ivăncescu c1861dc7d0 jscript: Support deletion for accessor, builtin and idx props.
IDX props are not configurable, thus they cannot be deleted, so it makes
no sense to special-case them anyway.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 18:48:35 +01:00
Gabriel Ivăncescu 3f135a0611 jscript: Throw when defining a PROTREF prop on a non-extensible object.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 18:48:32 +01:00
Gabriel Ivăncescu 738894a47c jscript: Fixup PROTREF props when looking them up.
Convert them to PROP_DELETE if the referenced prop in the prototype chain
doesn't exist anymore.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 18:48:29 +01:00
Gabriel Ivăncescu 58722dfe35 jscript: Treat prototype refs as non-existent when deleting.
Delete only affects own properties.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 18:48:26 +01:00
Gabriel Ivăncescu 46367d1ecc jscript: Implement Object.prototype.__proto__ property.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:10:09 +01:00
Gabriel Ivăncescu 4e5c4758ff jscript: Fix some refcount leaks.
In particular, most leak when jsdisp->ctx is not the current ctx.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-01 20:52:24 +01:00
Gabriel Ivăncescu 749c5d55e5 jscript: Return the failure code if the value invoke failed.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:48:33 +02:00
Gabriel Ivăncescu 59bb402bf1 jscript: Fix refcounting the object prototype fallback.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-07 23:19:21 +02:00
Gabriel Ivăncescu 678789c72f jscript: Fix GetIDsOfNames for more than one name.
Names after the first one are supposed to retrieve DISPIDs for parameters,
but it doesn't seem to be implemented on Windows.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Jacek Caban 9885de45af jscript: Add Object.getOwnPropertyNames implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 22:57:11 +02:00
Jacek Caban c4948c428a jscript: Use enum to pass enumeration type to jsdisp_next_prop.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 22:57:11 +02:00
Gijs Vermeulen 9268407bc6 jscript: Remove unreachable statement in disp_call_value().
Spotted by Rafał Mikrut.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49277
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:33:57 +02:00
Jacek Caban 1f49903e66 jscript: Add Object.isFrozen and Object.isSealed implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:13:39 +02:00
Jacek Caban f5b6c7cc7e jscript: Throw error in jsdisp_delete_idx for non-configurable properties.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:13:39 +02:00
Jacek Caban 380ae426a4 jscript: Throw error when trying to add a property to non-extensible objects in jsdisp_propput_idx.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:13:27 +02:00
Jacek Caban 51742d80cd jscript: Add Object.seal implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-01 18:34:06 +02:00
Jacek Caban 0d3634b3ff jscript: Add Object.freeze implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-01 18:34:06 +02:00
Jacek Caban 7f1c98cac6 jscript: Support non-extensible objects in jsdisp_define_property.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-01 18:34:06 +02:00
Jacek Caban 7750753758 jscript: Support non-extensible objects.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-01 18:29:53 +02:00
Jacek Caban f568b48e66 jscript: Get dispid and call invoke in a single step when setting a member property.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-01 18:29:48 +02:00
Jacek Caban 29d9659095 jscript: Support calling properties with getters.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-31 22:16:25 +02:00
Gabriel Ivăncescu ba1f47a770 jscript: Use default object prototype if it's null.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-11 22:58:26 +01:00
Gabriel Ivăncescu 580413032c jscript: Check for null instance prototype.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 21:31:33 +01:00
Jacek Caban 492b65df1f jscript: Improve prop_get and prop_put debug traces.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 19:01:38 +01:00
Michael Stefaniuc 59b9747644 jscript: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 16:53:52 +01:00
Puetz Kevin A b60c4c6ef6 jscript: Fix `this` within IDispatchEx::InvokeEx.
Latent bug revealed by 614ea7e6243ead003bcfe4624895154972f3445f;
Now that cross-context calls go through disp_call* instead of
jsdisp_call*, and thus through InvokeEx, the `this` pointer is
lost when calling methods inherited from a prototype.

Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 22:30:48 +02:00
Puetz Kevin A 616f5a5d4b jscript: Fix some memory problems in disp_call_value.
Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 19:37:19 +02:00
Jacek Caban 102fe73e66 jscript: Add Object.keys implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-04 22:36:39 +02:00
Jacek Caban bfb2e5d959 jscript: Delay error object creation for builtin errors with message string until it's needed.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-03 20:48:04 +01:00
Jacek Caban bcba07229a jscript: Support propagating error message.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-03 20:48:03 +01:00
Jacek Caban 0f4d4f7184 jscript: Store error location in jsexcept_t.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-03 20:48:03 +01:00
Jacek Caban 83fa76c25e jscript: Propagate Invoke error code using jsexcept_t.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-03 20:48:03 +01:00
Jacek Caban 8b836797e2 jscript: Directly return error code instead of using throw_type_error where possible.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-02 16:25:12 +01:00
Jacek Caban 63683b42f7 jscript: Use separated jsexcept_t instance for each external call.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-30 15:58:40 +01:00
Jacek Caban 274503c839 jscript: Support DISP_E_EXCEPTION InvokeEx result.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-30 15:58:38 +01:00
Jacek Caban 614ea7e624 jscript: Use internal jsdisp calls only within the same script context.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-30 15:58:34 +01:00
Gabriel Ivăncescu 691faf0eae jscript: Implement ScriptTypeInfo_GetMops.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:01 +01:00
Gabriel Ivăncescu 0dc32852cb jscript: Implement ScriptTypeInfo_CreateInstance.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00
Gabriel Ivăncescu 26c7b39407 jscript: Implement ScriptTypeInfo_AddressOfMember.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00
Gabriel Ivăncescu dff51ec933 jscript: Implement ScriptTypeInfo_GetDllEntry.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00
Gabriel Ivăncescu 4a38774b53 jscript: Implement ScriptTypeInfo_GetDocumentation.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00
Gabriel Ivăncescu 35521e9e07 jscript: Implement ScriptTypeInfo_Invoke.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00
Gabriel Ivăncescu d9a560b1ce jscript: Implement ScriptTypeInfo_GetImplTypeFlags.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00
Gabriel Ivăncescu f6197e7454 jscript: Implement ScriptTypeInfo_GetRefTypeInfo.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00
Gabriel Ivăncescu 2990bc3515 jscript: Implement ScriptTypeInfo_GetRefTypeOfImplType.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 21:02:00 +01:00