Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e72e8f3a
Commit
e72e8f3a
authored
Jun 21, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jun 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Don't use iface_to_jsdisp where it's not necessary to grab it.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
0e9d2215
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
32 deletions
+13
-32
array.c
dlls/jscript/array.c
+1
-2
dispex.c
dlls/jscript/dispex.c
+1
-2
engine.c
dlls/jscript/engine.c
+6
-14
json.c
dlls/jscript/json.c
+1
-2
jsregexp.c
dlls/jscript/jsregexp.c
+4
-12
No files found.
dlls/jscript/array.c
View file @
e72e8f3a
...
...
@@ -1663,9 +1663,8 @@ static HRESULT ArrayConstr_isArray(script_ctx_t *ctx, jsval_t vthis, WORD flags,
return
S_OK
;
}
obj
=
iface_
to_jsdisp
(
get_object
(
argv
[
0
]));
obj
=
to_jsdisp
(
get_object
(
argv
[
0
]));
if
(
r
)
*
r
=
jsval_bool
(
obj
&&
is_class
(
obj
,
JSCLASS_ARRAY
));
if
(
obj
)
jsdisp_release
(
obj
);
return
S_OK
;
}
...
...
dlls/jscript/dispex.c
View file @
e72e8f3a
...
...
@@ -101,10 +101,9 @@ static inline BOOL is_function_prop(dispex_prop_t *prop)
if
(
is_object_instance
(
prop
->
u
.
val
))
{
jsdisp_t
*
jsdisp
=
iface_
to_jsdisp
(
get_object
(
prop
->
u
.
val
));
jsdisp_t
*
jsdisp
=
to_jsdisp
(
get_object
(
prop
->
u
.
val
));
if
(
jsdisp
)
ret
=
is_class
(
jsdisp
,
JSCLASS_FUNCTION
);
jsdisp_release
(
jsdisp
);
}
return
ret
;
}
...
...
dlls/jscript/engine.c
View file @
e72e8f3a
...
...
@@ -514,12 +514,9 @@ static HRESULT disp_get_id(script_ctx_t *ctx, IDispatch *disp, const WCHAR *name
BSTR
bstr
;
HRESULT
hres
;
jsdisp
=
iface_to_jsdisp
(
disp
);
if
(
jsdisp
)
{
hres
=
jsdisp_get_id
(
jsdisp
,
name
,
flags
,
id
);
jsdisp_release
(
jsdisp
);
return
hres
;
}
jsdisp
=
to_jsdisp
(
disp
);
if
(
jsdisp
)
return
jsdisp_get_id
(
jsdisp
,
name
,
flags
,
id
);
if
(
name_bstr
)
{
bstr
=
name_bstr
;
...
...
@@ -1771,7 +1768,7 @@ static HRESULT interp_obj_prop(script_ctx_t *ctx)
jsdisp_t
*
func
;
assert
(
is_object_instance
(
val
));
func
=
iface_
to_jsdisp
(
get_object
(
val
));
func
=
to_jsdisp
(
get_object
(
val
));
desc
.
mask
=
desc
.
flags
;
if
(
type
==
PROPERTY_DEFINITION_GETTER
)
{
...
...
@@ -1783,7 +1780,6 @@ static HRESULT interp_obj_prop(script_ctx_t *ctx)
}
hres
=
jsdisp_define_property
(
obj
,
name
,
&
desc
);
jsdisp_release
(
func
);
}
jsval_release
(
val
);
...
...
@@ -1927,15 +1923,12 @@ static HRESULT interp_instanceof(script_ctx_t *ctx)
hres
=
JS_E_OBJECT_EXPECTED
;
else
if
(
is_object_instance
(
prot
))
{
if
(
is_object_instance
(
v
))
tmp
=
iface_
to_jsdisp
(
get_object
(
v
));
tmp
=
to_jsdisp
(
get_object
(
v
));
for
(
iter
=
tmp
;
!
ret
&&
iter
;
iter
=
iter
->
prototype
)
{
hres
=
disp_cmp
(
get_object
(
prot
),
to_disp
(
iter
),
&
ret
);
if
(
FAILED
(
hres
))
break
;
}
if
(
tmp
)
jsdisp_release
(
tmp
);
}
else
{
FIXME
(
"prototype is not an object
\n
"
);
hres
=
E_FAIL
;
...
...
@@ -2221,9 +2214,8 @@ static HRESULT typeof_string(jsval_t v, const WCHAR **ret)
case
JSV_OBJECT
:
{
jsdisp_t
*
dispex
;
if
((
dispex
=
iface_
to_jsdisp
(
get_object
(
v
))))
{
if
((
dispex
=
to_jsdisp
(
get_object
(
v
))))
{
*
ret
=
is_class
(
dispex
,
JSCLASS_FUNCTION
)
?
L"function"
:
L"object"
;
jsdisp_release
(
dispex
);
}
else
{
*
ret
=
L"object"
;
}
...
...
dlls/jscript/json.c
View file @
e72e8f3a
...
...
@@ -754,14 +754,13 @@ static HRESULT stringify(stringify_ctx_t *ctx, jsdisp_t *object, const WCHAR *na
jsdisp_t
*
obj
;
DISPID
id
;
obj
=
iface_
to_jsdisp
(
get_object
(
value
));
obj
=
to_jsdisp
(
get_object
(
value
));
if
(
!
obj
)
{
jsval_release
(
value
);
return
S_FALSE
;
}
hres
=
jsdisp_get_id
(
obj
,
L"toJSON"
,
0
,
&
id
);
jsdisp_release
(
obj
);
if
(
hres
==
S_OK
)
FIXME
(
"Use toJSON.
\n
"
);
}
...
...
dlls/jscript/jsregexp.c
View file @
e72e8f3a
...
...
@@ -666,17 +666,14 @@ HRESULT create_regexp_var(script_ctx_t *ctx, jsval_t src_arg, jsval_t *flags_arg
if
(
is_object_instance
(
src_arg
))
{
jsdisp_t
*
obj
;
obj
=
iface_
to_jsdisp
(
get_object
(
src_arg
));
obj
=
to_jsdisp
(
get_object
(
src_arg
));
if
(
obj
)
{
if
(
is_class
(
obj
,
JSCLASS_REGEXP
))
{
RegExpInstance
*
regexp
=
regexp_from_jsdisp
(
obj
);
hres
=
create_regexp
(
ctx
,
regexp
->
str
,
regexp
->
jsregexp
->
flags
,
ret
);
jsdisp_release
(
obj
);
return
hres
;
}
jsdisp_release
(
obj
);
}
}
...
...
@@ -913,21 +910,16 @@ static HRESULT RegExpConstr_value(script_ctx_t *ctx, jsval_t vthis, WORD flags,
case
DISPATCH_METHOD
:
if
(
argc
)
{
if
(
is_object_instance
(
argv
[
0
]))
{
jsdisp_t
*
jsdisp
=
iface_
to_jsdisp
(
get_object
(
argv
[
0
]));
jsdisp_t
*
jsdisp
=
to_jsdisp
(
get_object
(
argv
[
0
]));
if
(
jsdisp
)
{
if
(
is_class
(
jsdisp
,
JSCLASS_REGEXP
))
{
if
(
argc
>
1
&&
!
is_undefined
(
argv
[
1
]))
{
jsdisp_release
(
jsdisp
);
if
(
argc
>
1
&&
!
is_undefined
(
argv
[
1
]))
return
JS_E_REGEXP_SYNTAX
;
}
if
(
r
)
*
r
=
jsval_obj
(
jsdisp
);
else
jsdisp_release
(
jsdisp
);
*
r
=
jsval_obj
(
jsdisp_addref
(
jsdisp
));
return
S_OK
;
}
jsdisp_release
(
jsdisp
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment