Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
33984c39
Commit
33984c39
authored
Jan 30, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use enter_script and leave_script to call script site notifications.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9855c248
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
20 deletions
+10
-20
engine.c
dlls/jscript/engine.c
+5
-0
engine.h
dlls/jscript/engine.h
+1
-0
jscript.c
dlls/jscript/jscript.c
+4
-18
caller.c
dlls/jscript/tests/caller.c
+0
-2
No files found.
dlls/jscript/engine.c
View file @
33984c39
...
...
@@ -2977,6 +2977,11 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi
unsigned
i
;
HRESULT
hres
;
if
(
!
ctx
->
ei
->
enter_notified
)
{
ctx
->
ei
->
enter_notified
=
TRUE
;
IActiveScriptSite_OnEnterScript
(
ctx
->
site
);
}
for
(
i
=
0
;
i
<
function
->
func_cnt
;
i
++
)
{
jsdisp_t
*
func_obj
;
...
...
dlls/jscript/engine.h
View file @
33984c39
...
...
@@ -227,6 +227,7 @@ struct _jsexcept_t {
BOOL
valid_value
;
jsval_t
value
;
BOOL
enter_notified
;
jsexcept_t
*
prev
;
};
...
...
dlls/jscript/jscript.c
View file @
33984c39
...
...
@@ -129,22 +129,12 @@ HRESULT leave_script(script_ctx_t *ctx, HRESULT result)
result
=
ei
->
error
;
if
(
FAILED
(
result
))
WARN
(
"%08x
\n
"
,
result
);
if
(
ei
->
enter_notified
&&
ctx
->
site
)
IActiveScriptSite_OnLeaveScript
(
ctx
->
site
);
reset_ei
(
ei
);
return
result
;
}
static
HRESULT
exec_global_code
(
JScript
*
This
,
bytecode_t
*
code
)
{
HRESULT
hres
;
IActiveScriptSite_OnEnterScript
(
This
->
site
);
hres
=
exec_source
(
This
->
ctx
,
EXEC_GLOBAL
,
code
,
&
code
->
global_code
,
NULL
,
NULL
,
NULL
,
This
->
ctx
->
global
,
0
,
NULL
,
NULL
);
IActiveScriptSite_OnLeaveScript
(
This
->
site
);
return
hres
;
}
static
void
clear_script_queue
(
JScript
*
This
)
{
while
(
!
list_empty
(
&
This
->
queued_code
))
...
...
@@ -176,7 +166,7 @@ static void exec_queued_code(JScript *This)
LIST_FOR_EACH_ENTRY
(
iter
,
&
This
->
queued_code
,
bytecode_t
,
entry
)
{
enter_script
(
This
->
ctx
,
&
ei
);
hres
=
exec_
global_code
(
This
,
iter
);
hres
=
exec_
source
(
This
->
ctx
,
EXEC_GLOBAL
,
iter
,
&
iter
->
global_code
,
NULL
,
NULL
,
NULL
,
This
->
ctx
->
global
,
0
,
NULL
,
NULL
);
leave_script
(
This
->
ctx
,
hres
);
}
...
...
@@ -818,8 +808,6 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
if
(
dwFlags
&
SCRIPTTEXT_ISEXPRESSION
)
{
jsval_t
r
;
IActiveScriptSite_OnEnterScript
(
This
->
site
);
hres
=
exec_source
(
This
->
ctx
,
EXEC_GLOBAL
,
code
,
&
code
->
global_code
,
NULL
,
NULL
,
NULL
,
This
->
ctx
->
global
,
0
,
NULL
,
&
r
);
if
(
SUCCEEDED
(
hres
))
{
if
(
pvarResult
)
...
...
@@ -827,7 +815,6 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
jsval_release
(
r
);
}
IActiveScriptSite_OnLeaveScript
(
This
->
site
);
return
leave_script
(
This
->
ctx
,
hres
);
}
...
...
@@ -840,8 +827,7 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
if
(
!
pvarResult
&&
!
is_started
(
This
->
ctx
))
{
list_add_tail
(
&
This
->
queued_code
,
&
code
->
entry
);
}
else
{
hres
=
exec_global_code
(
This
,
code
);
hres
=
exec_source
(
This
->
ctx
,
EXEC_GLOBAL
,
code
,
&
code
->
global_code
,
NULL
,
NULL
,
NULL
,
This
->
ctx
->
global
,
0
,
NULL
,
NULL
);
if
(
code
->
is_persistent
)
list_add_tail
(
&
This
->
persistent_code
,
&
code
->
entry
);
else
...
...
dlls/jscript/tests/caller.c
View file @
33984c39
...
...
@@ -105,9 +105,7 @@ static void _call_change_type(unsigned line, IVariantChangeType *change_type, VA
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"ChangeType(%d) failed: %08x
\n
"
,
vt
,
hres
);
ok_
(
__FILE__
,
line
)(
V_VT
(
dst
)
==
vt
,
"V_VT(dst) = %d
\n
"
,
V_VT
(
dst
));
if
(
V_VT
(
src
)
==
VT_DISPATCH
&&
vt
!=
VT_BOOL
)
{
todo_wine
CHECK_CALLED
(
OnEnterScript
);
todo_wine
CHECK_CALLED
(
OnLeaveScript
);
}
}
...
...
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