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
62624922
Commit
62624922
authored
Jun 02, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added function object default value getter implementation.
parent
bc4ceca9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
3 deletions
+68
-3
dispex.c
dlls/mshtml/dispex.c
+31
-0
jstest.html
dlls/mshtml/tests/jstest.html
+3
-0
script.c
dlls/mshtml/tests/script.c
+34
-3
No files found.
dlls/mshtml/dispex.c
View file @
62624922
...
...
@@ -717,6 +717,37 @@ static HRESULT function_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR
return
E_UNEXPECTED
;
hres
=
typeinfo_invoke
(
This
->
obj
,
This
->
info
,
flags
,
params
,
res
,
ei
);
break
;
case
DISPATCH_PROPERTYGET
:
{
unsigned
name_len
;
WCHAR
*
ptr
;
BSTR
str
;
static
const
WCHAR
func_prefixW
[]
=
{
'\n'
,
'f'
,
'u'
,
'n'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
' '
};
static
const
WCHAR
func_suffixW
[]
=
{
'('
,
')'
,
' '
,
'{'
,
'\n'
,
' '
,
' '
,
' '
,
' '
,
'['
,
'n'
,
'a'
,
't'
,
'i'
,
'v'
,
'e'
,
' '
,
'c'
,
'o'
,
'd'
,
'e'
,
']'
,
'\n'
,
'}'
,
'\n'
};
/* FIXME: This probably should be more generic. Also we should try to get IID_IActiveScriptSite and SID_GetCaller. */
if
(
!
caller
)
return
E_ACCESSDENIED
;
name_len
=
SysStringLen
(
This
->
info
->
name
);
ptr
=
str
=
SysAllocStringLen
(
NULL
,
name_len
+
(
sizeof
(
func_prefixW
)
+
sizeof
(
func_suffixW
))
/
sizeof
(
WCHAR
));
if
(
!
str
)
return
E_OUTOFMEMORY
;
memcpy
(
ptr
,
func_prefixW
,
sizeof
(
func_prefixW
));
ptr
+=
sizeof
(
func_prefixW
)
/
sizeof
(
WCHAR
);
memcpy
(
ptr
,
This
->
info
->
name
,
name_len
*
sizeof
(
WCHAR
));
ptr
+=
name_len
;
memcpy
(
ptr
,
func_suffixW
,
sizeof
(
func_suffixW
));
V_VT
(
res
)
=
VT_BSTR
;
V_BSTR
(
res
)
=
str
;
return
S_OK
;
}
default:
FIXME
(
"Unimplemented flags %x
\n
"
,
flags
);
hres
=
E_NOTIMPL
;
...
...
dlls/mshtml/tests/jstest.html
View file @
62624922
...
...
@@ -165,6 +165,9 @@ function test_override_functions() {
var
tmp
=
div
.
addBehavior
();
ok
(
tmp
===
"test"
,
"div.addBehavior() = "
+
tmp
);
tmp
=
String
(
div
.
attachEvent
);
ok
(
tmp
==
"
\
nfunction attachEvent() {
\
n [native code]
\
n}
\
n"
,
"String(div.attachEvent) = "
+
tmp
);
}
function
test_forin
()
{
...
...
dlls/mshtml/tests/script.c
View file @
62624922
...
...
@@ -132,6 +132,8 @@ DEFINE_EXPECT(AXSetInterfaceSafetyOptions_IDispatchEx_caller_secmgr);
DEFINE_EXPECT
(
AXSetInterfaceSafetyOptions_IDispatchEx_caller
);
DEFINE_EXPECT
(
external_success
);
DEFINE_EXPECT
(
QS_VariantConversion
);
DEFINE_EXPECT
(
QS_IActiveScriptSite
);
DEFINE_EXPECT
(
QS_GetCaller
);
DEFINE_EXPECT
(
ChangeType
);
#define TESTSCRIPT_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80746}"
...
...
@@ -162,6 +164,9 @@ static HRESULT ax_getopt_hres = S_OK, ax_setopt_dispex_hres = S_OK;
static
HRESULT
ax_setopt_disp_caller_hres
=
S_OK
,
ax_setopt_disp_data_hres
=
S_OK
;
static
BOOL
skip_loadobject_tests
;
static
IActiveScriptSite
*
site
;
static
SCRIPTSTATE
state
;
static
int
strcmp_wa
(
LPCWSTR
strw
,
const
char
*
stra
)
{
CHAR
buf
[
512
];
...
...
@@ -332,6 +337,19 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG
return
S_OK
;
}
if
(
IsEqualGUID
(
guidService
,
&
IID_IActiveScriptSite
))
{
CHECK_EXPECT
(
QS_IActiveScriptSite
);
ok
(
IsEqualGUID
(
riid
,
&
IID_IOleCommandTarget
),
"uenxpected riid %s
\n
"
,
wine_dbgstr_guid
(
riid
));
return
IActiveScriptSite_QueryInterface
(
site
,
riid
,
ppv
);
}
if
(
IsEqualGUID
(
guidService
,
&
SID_GetCaller
))
{
CHECK_EXPECT
(
QS_GetCaller
);
ok
(
IsEqualGUID
(
riid
,
&
IID_IServiceProvider
),
"uenxpected riid %s
\n
"
,
wine_dbgstr_guid
(
riid
));
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
ok
(
0
,
"unexpected service %s
\n
"
,
wine_dbgstr_guid
(
guidService
));
return
E_NOINTERFACE
;
}
...
...
@@ -1280,9 +1298,6 @@ static void load_doc(IHTMLDocument2 *doc, const char *str)
IHTMLElement_Release
(
body
);
}
static
IActiveScriptSite
*
site
;
static
SCRIPTSTATE
state
;
static
HRESULT
WINAPI
ObjectSafety_QueryInterface
(
IObjectSafety
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
...
...
@@ -1902,6 +1917,22 @@ static void test_func(IDispatchEx *obj)
hres
=
dispex_propput
(
obj
,
id
,
0
,
&
var
,
NULL
);
ok
(
hres
==
E_NOTIMPL
,
"InvokeEx failed: %08x
\n
"
,
hres
);
hres
=
dispex_propget
(
dispex
,
DISPID_VALUE
,
&
var
,
NULL
);
ok
(
hres
==
E_ACCESSDENIED
,
"InvokeEx returned: %08x, expected E_ACCESSDENIED
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
VariantClear
(
&
var
);
SET_EXPECT
(
QS_IActiveScriptSite
);
SET_EXPECT
(
QS_GetCaller
);
hres
=
dispex_propget
(
dispex
,
DISPID_VALUE
,
&
var
,
&
caller_sp
);
ok
(
hres
==
S_OK
,
"InvokeEx returned: %08x, expected S_OK
\n
"
,
hres
);
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"V_VT(var) = %d
\n
"
,
V_VT
(
&
var
));
ok
(
!
strcmp_wa
(
V_BSTR
(
&
var
),
"
\n
function toString() {
\n
[native code]
\n
}
\n
"
),
"V_BSTR(var) = %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
VariantClear
(
&
var
);
todo_wine
CHECK_CALLED
(
QS_IActiveScriptSite
);
todo_wine
CHECK_CALLED
(
QS_GetCaller
);
IDispatchEx_Release
(
dispex
);
}
...
...
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