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
6afd5354
Commit
6afd5354
authored
Aug 10, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Lookup global members after script_disp.
parent
25e9e4f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
engine.c
dlls/jscript/engine.c
+23
-13
run.c
dlls/jscript/tests/run.c
+2
-0
No files found.
dlls/jscript/engine.c
View file @
6afd5354
...
...
@@ -356,6 +356,26 @@ static HRESULT literal_to_var(literal_t *literal, VARIANT *v)
return
S_OK
;
}
static
BOOL
lookup_global_members
(
script_ctx_t
*
ctx
,
BSTR
identifier
,
exprval_t
*
ret
)
{
named_item_t
*
item
;
DISPID
id
;
HRESULT
hres
;
for
(
item
=
ctx
->
named_items
;
item
;
item
=
item
->
next
)
{
if
(
item
->
flags
&
SCRIPTITEM_GLOBALMEMBERS
)
{
hres
=
disp_get_id
(
item
->
disp
,
identifier
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
if
(
ret
)
exprval_set_idref
(
ret
,
item
->
disp
,
id
);
return
TRUE
;
}
}
}
return
FALSE
;
}
HRESULT
exec_source
(
exec_ctx_t
*
ctx
,
parser_ctx_t
*
parser
,
source_elements_t
*
source
,
jsexcept_t
*
ei
,
VARIANT
*
retv
)
{
script_ctx_t
*
script
=
parser
->
script
;
...
...
@@ -493,25 +513,15 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js
}
}
for
(
item
=
ctx
->
parser
->
script
->
named_items
;
item
;
item
=
item
->
next
)
{
if
(
item
->
flags
&
SCRIPTITEM_GLOBALMEMBERS
)
{
hres
=
disp_get_id
(
item
->
disp
,
identifier
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
break
;
}
}
if
(
item
)
{
exprval_set_idref
(
ret
,
item
->
disp
,
id
);
return
S_OK
;
}
hres
=
jsdisp_get_id
(
ctx
->
parser
->
script
->
script_disp
,
identifier
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
exprval_set_idref
(
ret
,
(
IDispatch
*
)
_IDispatchEx_
(
ctx
->
parser
->
script
->
script_disp
),
id
);
return
S_OK
;
}
if
(
lookup_global_members
(
ctx
->
parser
->
script
,
identifier
,
ret
))
return
S_OK
;
if
(
flags
&
EXPR_NEWREF
)
{
hres
=
jsdisp_get_id
(
ctx
->
var_disp
,
identifier
,
fdexNameEnsure
,
&
id
);
if
(
FAILED
(
hres
))
...
...
dlls/jscript/tests/run.c
View file @
6afd5354
...
...
@@ -835,6 +835,8 @@ static void run_tests(void)
parse_script_a
(
"ok(typeof(test) === 'object',
\"
typeof(test) != 'object'
\"
);"
);
parse_script_a
(
"function reportSuccess() {}; reportSuccess();"
);
run_from_res
(
"lang.js"
);
run_from_res
(
"api.js"
);
run_from_res
(
"regexp.js"
);
...
...
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