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
cf802971
Commit
cf802971
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 Number.prototyp.constructor.
parent
c957f8a9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
function.c
dlls/jscript/function.c
+25
-0
jscript.h
dlls/jscript/jscript.h
+2
-0
number.c
dlls/jscript/number.c
+1
-1
lang.js
dlls/jscript/tests/lang.js
+2
-0
No files found.
dlls/jscript/function.c
View file @
cf802971
...
...
@@ -639,6 +639,31 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
return
S_OK
;
}
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
)
{
jsdisp_t
*
constr
;
VARIANT
v
;
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
);
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
to_disp
(
constr
);
hres
=
jsdisp_propput_name
(
prototype
,
constructorW
,
&
v
,
NULL
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
constr
);
return
hres
;
}
*
ret
=
constr
;
return
S_OK
;
}
HRESULT
create_source_function
(
script_ctx_t
*
ctx
,
bytecode_t
*
code
,
function_code_t
*
func_code
,
scope_chain_t
*
scope_chain
,
jsdisp_t
**
ret
)
{
...
...
dlls/jscript/jscript.h
View file @
cf802971
...
...
@@ -225,6 +225,8 @@ VARIANT_BOOL jsdisp_is_own_prop(jsdisp_t *obj, BSTR name) DECLSPEC_HIDDEN;
HRESULT
create_builtin_function
(
script_ctx_t
*
,
builtin_invoke_t
,
const
WCHAR
*
,
const
builtin_info_t
*
,
DWORD
,
jsdisp_t
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_builtin_constructor
(
script_ctx_t
*
,
builtin_invoke_t
,
const
WCHAR
*
,
const
builtin_info_t
*
,
DWORD
,
jsdisp_t
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
Function_value
(
script_ctx_t
*
,
vdisp_t
*
,
WORD
,
unsigned
,
VARIANT
*
,
VARIANT
*
,
jsexcept_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
Function_invoke
(
jsdisp_t
*
,
IDispatch
*
,
WORD
,
unsigned
,
VARIANT
*
,
VARIANT
*
,
jsexcept_t
*
);
...
...
dlls/jscript/number.c
View file @
cf802971
...
...
@@ -625,7 +625,7 @@ HRESULT create_number_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi
return
hres
;
number
->
value
=
0
;
hres
=
create_builtin_
function
(
ctx
,
NumberConstr_value
,
NumberW
,
NULL
,
hres
=
create_builtin_
constructor
(
ctx
,
NumberConstr_value
,
NumberW
,
NULL
,
PROPF_CONSTR
|
1
,
&
number
->
dispex
,
ret
);
jsdisp_release
(
&
number
->
dispex
);
...
...
dlls/jscript/tests/lang.js
View file @
cf802971
...
...
@@ -91,6 +91,8 @@ ok(Function.prototype.prototype === undefined, "Function.prototype.prototype is
ok
(
Date
.
prototype
!==
undefined
,
"Date.prototype is undefined"
);
ok
(
Date
.
prototype
.
prototype
===
undefined
,
"Date.prototype is not undefined"
);
ok
(
Number
.
prototype
.
constructor
===
Number
,
"Number.prototype.constructor !== Number"
);
Function
.
prototype
.
test
=
true
;
ok
(
testFunc1
.
test
===
true
,
"testFunc1.test !== true"
);
ok
(
Function
.
test
===
true
,
"Function.test !== true"
);
...
...
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