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
403fb41c
Commit
403fb41c
authored
Aug 05, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Create scope in setup_scope.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
68f1df23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
22 deletions
+23
-22
engine.c
dlls/jscript/engine.c
+20
-13
function.c
dlls/jscript/function.c
+3
-9
No files found.
dlls/jscript/engine.c
View file @
403fb41c
...
...
@@ -2775,9 +2775,10 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis
return
hres
;
}
static
HRESULT
setup_scope
(
script_ctx_t
*
ctx
,
call_frame_t
*
frame
,
unsigned
argc
,
jsval_t
*
argv
)
static
HRESULT
setup_scope
(
script_ctx_t
*
ctx
,
call_frame_t
*
frame
,
scope_chain_t
*
scope_chain
,
jsdisp_t
*
variable_object
,
unsigned
argc
,
jsval_t
*
argv
)
{
const
unsigned
orig_stack
=
ctx
->
stack_top
;
scope_chain_t
*
scope
;
unsigned
i
;
jsval_t
v
;
HRESULT
hres
;
...
...
@@ -2822,14 +2823,21 @@ static HRESULT setup_scope(script_ctx_t *ctx, call_frame_t *frame, unsigned argc
frame
->
pop_variables
=
i
;
hres
=
scope_push
(
scope_chain
,
variable_object
,
to_disp
(
variable_object
),
&
scope
);
if
(
FAILED
(
hres
))
{
stack_popn
(
ctx
,
ctx
->
stack_top
-
orig_stack
);
return
hres
;
}
for
(
i
=
0
;
i
<
frame
->
function
->
func_cnt
;
i
++
)
{
if
(
frame
->
function
->
funcs
[
i
].
name
&&
!
frame
->
function
->
funcs
[
i
].
event_target
)
{
jsdisp_t
*
func_obj
;
unsigned
off
;
hres
=
create_source_function
(
ctx
,
frame
->
bytecode
,
frame
->
function
->
funcs
+
i
,
frame
->
base_
scope
,
&
func_obj
);
hres
=
create_source_function
(
ctx
,
frame
->
bytecode
,
frame
->
function
->
funcs
+
i
,
scope
,
&
func_obj
);
if
(
FAILED
(
hres
))
{
stack_popn
(
ctx
,
ctx
->
stack_top
-
orig_stack
);
scope_release
(
scope
);
return
hres
;
}
...
...
@@ -2839,7 +2847,8 @@ static HRESULT setup_scope(script_ctx_t *ctx, call_frame_t *frame, unsigned argc
}
}
frame
->
base_scope
->
frame
=
frame
;
scope
->
frame
=
frame
;
frame
->
base_scope
=
frame
->
scope
=
scope
;
return
S_OK
;
}
...
...
@@ -2915,17 +2924,15 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi
frame
->
argc
=
argc
;
frame
->
bytecode
=
bytecode_addref
(
bytecode
);
if
(
scope
)
{
frame
->
base_scope
=
frame
->
scope
=
scope_addref
(
scope
);
if
(
!
(
flags
&
(
EXEC_GLOBAL
|
EXEC_EVAL
)))
{
hres
=
setup_scope
(
ctx
,
frame
,
argc
,
argv
);
if
(
FAILED
(
hres
))
{
release_bytecode
(
frame
->
bytecode
);
heap_free
(
frame
);
return
hres
;
}
if
(
!
(
flags
&
(
EXEC_GLOBAL
|
EXEC_EVAL
)))
{
hres
=
setup_scope
(
ctx
,
frame
,
scope
,
variable_obj
,
argc
,
argv
);
if
(
FAILED
(
hres
))
{
release_bytecode
(
frame
->
bytecode
);
heap_free
(
frame
);
return
hres
;
}
}
else
if
(
scope
)
{
frame
->
base_scope
=
frame
->
scope
=
scope_addref
(
scope
);
}
frame
->
ip
=
function
->
instr_off
;
...
...
dlls/jscript/function.c
View file @
403fb41c
...
...
@@ -233,7 +233,6 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
BOOL
is_constructor
,
BOOL
caller_execs_source
,
jsval_t
*
r
)
{
jsdisp_t
*
var_disp
;
scope_chain_t
*
scope
;
DWORD
exec_flags
=
0
;
HRESULT
hres
;
...
...
@@ -251,19 +250,14 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
if
(
FAILED
(
hres
))
return
hres
;
hres
=
scope_push
(
function
->
scope_chain
,
var_disp
,
to_disp
(
var_disp
),
&
scope
);
jsdisp_release
(
var_disp
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
caller_execs_source
)
exec_flags
|=
EXEC_RETURN_TO_INTERP
;
if
(
is_constructor
)
exec_flags
|=
EXEC_CONSTRUCTOR
;
hres
=
exec_source
(
ctx
,
exec_flags
,
function
->
code
,
function
->
func_code
,
scope
,
this_obj
,
&
function
->
dispex
,
scope
->
jsobj
,
argc
,
argv
,
r
);
hres
=
exec_source
(
ctx
,
exec_flags
,
function
->
code
,
function
->
func_code
,
function
->
scope_chain
,
this_obj
,
&
function
->
dispex
,
var_disp
,
argc
,
argv
,
r
);
scope_release
(
scope
);
jsdisp_release
(
var_disp
);
return
hres
;
}
...
...
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