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
3767d63a
Commit
3767d63a
authored
May 14, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
May 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use jsdisp_define_property to set function prototypes.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
20007e58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
function.c
dlls/jscript/function.c
+4
-8
es5.js
dlls/mshtml/tests/es5.js
+4
-0
No files found.
dlls/jscript/function.c
View file @
3767d63a
...
...
@@ -641,11 +641,6 @@ static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_
return
S_OK
;
}
static
inline
HRESULT
set_prototype
(
script_ctx_t
*
ctx
,
jsdisp_t
*
dispex
,
jsdisp_t
*
prototype
)
{
return
jsdisp_propput_dontenum
(
dispex
,
prototypeW
,
jsval_obj
(
prototype
));
}
HRESULT
create_builtin_function
(
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
)
{
...
...
@@ -660,7 +655,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
hres
=
jsdisp_define_data_property
(
&
function
->
dispex
,
lengthW
,
0
,
jsval_number
(
function
->
length
));
if
(
SUCCEEDED
(
hres
))
hres
=
set_prototype
(
ctx
,
&
function
->
dispex
,
prototype
);
hres
=
jsdisp_define_data_property
(
&
function
->
dispex
,
prototypeW
,
0
,
jsval_obj
(
prototype
)
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
&
function
->
dispex
);
return
hres
;
...
...
@@ -713,7 +708,8 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod
hres
=
create_function
(
ctx
,
NULL
,
PROPF_CONSTR
,
FALSE
,
NULL
,
&
function
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
set_prototype
(
ctx
,
&
function
->
dispex
,
prototype
);
hres
=
jsdisp_define_data_property
(
&
function
->
dispex
,
prototypeW
,
PROPF_WRITABLE
,
jsval_obj
(
prototype
));
if
(
SUCCEEDED
(
hres
))
hres
=
set_constructor_prop
(
ctx
,
&
function
->
dispex
,
prototype
);
if
(
FAILED
(
hres
))
...
...
@@ -871,7 +867,7 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
if
(
SUCCEEDED
(
hres
))
{
constr
->
value_proc
=
FunctionConstr_value
;
constr
->
name
=
FunctionW
;
hres
=
set_prototype
(
ctx
,
&
constr
->
dispex
,
&
prot
->
dispex
);
hres
=
jsdisp_define_data_property
(
&
constr
->
dispex
,
prototypeW
,
0
,
jsval_obj
(
&
prot
->
dispex
)
);
if
(
SUCCEEDED
(
hres
))
hres
=
set_constructor_prop
(
ctx
,
&
constr
->
dispex
,
&
prot
->
dispex
);
if
(
FAILED
(
hres
))
...
...
dlls/mshtml/tests/es5.js
View file @
3767d63a
...
...
@@ -195,6 +195,10 @@ function test_getOwnPropertyDescriptor() {
test_own_data_prop_desc
(
arguments
,
"callee"
,
true
,
false
,
true
);
})();
test_own_data_prop_desc
(
String
,
"prototype"
,
false
,
false
,
false
);
test_own_data_prop_desc
(
function
(){},
"prototype"
,
true
,
false
,
false
);
test_own_data_prop_desc
(
Function
,
"prototype"
,
false
,
false
,
false
);
next_test
();
}
...
...
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