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
42c2bd7b
Commit
42c2bd7b
authored
Jun 21, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Correctly handle forin statement on pure IDispatch object.
parent
3d56d674
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
2 deletions
+51
-2
engine.c
dlls/jscript/engine.c
+3
-2
lang.js
dlls/jscript/tests/lang.js
+3
-0
run.c
dlls/jscript/tests/run.c
+45
-0
No files found.
dlls/jscript/engine.c
View file @
42c2bd7b
...
...
@@ -884,8 +884,9 @@ HRESULT forin_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_
hres
=
IDispatch_QueryInterface
(
V_DISPATCH
(
&
val
),
&
IID_IDispatchEx
,
(
void
**
)
&
in_obj
);
IDispatch_Release
(
V_DISPATCH
(
&
val
));
if
(
FAILED
(
hres
))
{
FIXME
(
"Object doesn't support IDispatchEx
\n
"
);
return
E_NOTIMPL
;
TRACE
(
"Object doesn't support IDispatchEx
\n
"
);
V_VT
(
ret
)
=
VT_EMPTY
;
return
S_OK
;
}
V_VT
(
&
retv
)
=
VT_EMPTY
;
...
...
dlls/jscript/tests/lang.js
View file @
42c2bd7b
...
...
@@ -205,6 +205,9 @@ for(var iter in null)
for
(
var
iter
in
false
)
ok
(
false
,
"unexpected forin call, test = "
+
iter
);
for
(
var
iter
in
pureDisp
)
ok
(
false
,
"unexpected forin call in pureDisp object"
);
tmp
=
0
;
if
(
true
)
tmp
=
1
;
...
...
dlls/jscript/tests/run.c
View file @
42c2bd7b
...
...
@@ -90,6 +90,7 @@ DEFINE_EXPECT(invoke_func);
#define DISPID_GLOBAL_PROPGETFUNC 0x100d
#define DISPID_GLOBAL_OBJECT_FLAG 0x100e
#define DISPID_GLOBAL_ISWIN64 0x100f
#define DISPID_GLOBAL_PUREDISP 0x1010
#define DISPID_TESTOBJ_PROP 0x2000
#define DISPID_TESTOBJ_ONLYDISPID 0x2001
...
...
@@ -324,6 +325,29 @@ static IDispatchExVtbl testObjVtbl = {
static
IDispatchEx
testObj
=
{
&
testObjVtbl
};
static
HRESULT
WINAPI
pureDisp_QueryInterface
(
IDispatchEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IDispatch
))
{
*
ppv
=
iface
;
return
S_OK
;
}
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
IDispatchExVtbl
pureDispVtbl
=
{
pureDisp_QueryInterface
,
DispatchEx_AddRef
,
DispatchEx_Release
,
DispatchEx_GetTypeInfoCount
,
DispatchEx_GetTypeInfo
,
DispatchEx_GetIDsOfNames
,
DispatchEx_Invoke
};
static
IDispatchEx
pureDisp
=
{
&
pureDispVtbl
};
static
HRESULT
WINAPI
Global_GetDispID
(
IDispatchEx
*
iface
,
BSTR
bstrName
,
DWORD
grfdex
,
DISPID
*
pid
)
{
if
(
!
strcmp_wa
(
bstrName
,
"ok"
))
{
...
...
@@ -417,6 +441,12 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"pureDisp"
))
{
test_grfdex
(
grfdex
,
fdexNameCaseSensitive
);
*
pid
=
DISPID_GLOBAL_PUREDISP
;
return
S_OK
;
}
if
(
strict_dispid_check
)
ok
(
0
,
"unexpected call %s
\n
"
,
wine_dbgstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
...
...
@@ -566,6 +596,21 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_DISPATCH
(
pvarRes
)
=
(
IDispatch
*
)
&
testObj
;
return
S_OK
;
case
DISPID_GLOBAL_PUREDISP
:
ok
(
wFlags
==
INVOKE_PROPERTYGET
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
!
pdp
->
rgvarg
,
"rgvarg != NULL
\n
"
);
ok
(
!
pdp
->
rgdispidNamedArgs
,
"rgdispidNamedArgs != NULL
\n
"
);
ok
(
!
pdp
->
cArgs
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pdp
->
cNamedArgs
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
ok
(
pvarRes
!=
NULL
,
"pvarRes == NULL
\n
"
);
ok
(
V_VT
(
pvarRes
)
==
VT_EMPTY
,
"V_VT(pvarRes) = %d
\n
"
,
V_VT
(
pvarRes
));
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
V_VT
(
pvarRes
)
=
VT_DISPATCH
;
V_DISPATCH
(
pvarRes
)
=
(
IDispatch
*
)
&
pureDisp
;
return
S_OK
;
case
DISPID_GLOBAL_NULL_BSTR
:
if
(
pvarRes
)
{
V_VT
(
pvarRes
)
=
VT_BSTR
;
...
...
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