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
bf7b7272
Commit
bf7b7272
authored
Jul 16, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Properly set Function constructor's constructor property.
parent
d4926503
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
function.c
dlls/jscript/function.c
+14
-6
lang.js
dlls/jscript/tests/lang.js
+1
-1
No files found.
dlls/jscript/function.c
View file @
bf7b7272
...
@@ -639,22 +639,28 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
...
@@ -639,22 +639,28 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
set_constructor_prop
(
script_ctx_t
*
ctx
,
jsdisp_t
*
constr
,
jsdisp_t
*
prot
)
{
VARIANT
v
;
static
const
WCHAR
constructorW
[]
=
{
'c'
,
'o'
,
'n'
,
's'
,
't'
,
'r'
,
'u'
,
'c'
,
't'
,
'o'
,
'r'
,
0
};
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
to_disp
(
constr
);
return
jsdisp_propput_name
(
prot
,
constructorW
,
&
v
,
NULL
);
}
HRESULT
create_builtin_constructor
(
script_ctx_t
*
ctx
,
builtin_invoke_t
value_proc
,
const
WCHAR
*
name
,
HRESULT
create_builtin_constructor
(
script_ctx_t
*
ctx
,
builtin_invoke_t
value_proc
,
const
WCHAR
*
name
,
const
builtin_info_t
*
builtin_info
,
DWORD
flags
,
jsdisp_t
*
prototype
,
jsdisp_t
**
ret
)
const
builtin_info_t
*
builtin_info
,
DWORD
flags
,
jsdisp_t
*
prototype
,
jsdisp_t
**
ret
)
{
{
jsdisp_t
*
constr
;
jsdisp_t
*
constr
;
VARIANT
v
;
HRESULT
hres
;
HRESULT
hres
;
static
const
WCHAR
constructorW
[]
=
{
'c'
,
'o'
,
'n'
,
's'
,
't'
,
'r'
,
'u'
,
'c'
,
't'
,
'o'
,
'r'
,
0
};
hres
=
create_builtin_function
(
ctx
,
value_proc
,
name
,
builtin_info
,
flags
,
prototype
,
&
constr
);
hres
=
create_builtin_function
(
ctx
,
value_proc
,
name
,
builtin_info
,
flags
,
prototype
,
&
constr
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
V_VT
(
&
v
)
=
VT_DISPATCH
;
hres
=
set_constructor_prop
(
ctx
,
constr
,
prototype
);
V_DISPATCH
(
&
v
)
=
to_disp
(
constr
);
hres
=
jsdisp_propput_name
(
prototype
,
constructorW
,
&
v
,
NULL
);
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
jsdisp_release
(
constr
);
jsdisp_release
(
constr
);
return
hres
;
return
hres
;
...
@@ -839,6 +845,8 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
...
@@ -839,6 +845,8 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
constr
->
value_proc
=
FunctionConstr_value
;
constr
->
value_proc
=
FunctionConstr_value
;
constr
->
name
=
FunctionW
;
constr
->
name
=
FunctionW
;
hres
=
set_prototype
(
ctx
,
&
constr
->
dispex
,
&
prot
->
dispex
);
hres
=
set_prototype
(
ctx
,
&
constr
->
dispex
,
&
prot
->
dispex
);
if
(
SUCCEEDED
(
hres
))
hres
=
set_constructor_prop
(
ctx
,
&
constr
->
dispex
,
&
prot
->
dispex
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
jsdisp_release
(
&
constr
->
dispex
);
jsdisp_release
(
&
constr
->
dispex
);
}
}
...
...
dlls/jscript/tests/lang.js
View file @
bf7b7272
...
@@ -101,7 +101,7 @@ testConstructor(Array, "Array");
...
@@ -101,7 +101,7 @@ testConstructor(Array, "Array");
testConstructor
(
Boolean
,
"Boolean"
);
testConstructor
(
Boolean
,
"Boolean"
);
testConstructor
(
Number
,
"Number"
);
testConstructor
(
Number
,
"Number"
);
testConstructor
(
RegExp
,
"RegExp"
);
testConstructor
(
RegExp
,
"RegExp"
);
//
testConstructor(Function, "Function");
testConstructor
(
Function
,
"Function"
);
testConstructor
(
Date
,
"Date"
);
testConstructor
(
Date
,
"Date"
);
testConstructor
(
VBArray
,
"VBArray"
);
testConstructor
(
VBArray
,
"VBArray"
);
...
...
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