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
0cbe1574
Commit
0cbe1574
authored
May 26, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
May 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store builtin constructor's length in instance object.
parent
913278c5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
5 deletions
+35
-5
dispex.c
dlls/jscript/dispex.c
+15
-0
function.c
dlls/jscript/function.c
+10
-1
jscript.h
dlls/jscript/jscript.h
+5
-2
api.js
dlls/jscript/tests/api.js
+5
-2
No files found.
dlls/jscript/dispex.c
View file @
0cbe1574
...
...
@@ -358,6 +358,9 @@ static HRESULT prop_put(DispatchEx *This, dispex_prop_t *prop, VARIANT *val,
{
HRESULT
hres
;
if
(
prop
->
flags
&
PROPF_CONST
)
return
S_OK
;
switch
(
prop
->
type
)
{
case
PROP_BUILTIN
:
if
(
!
(
prop
->
flags
&
PROPF_METHOD
))
{
...
...
@@ -974,6 +977,18 @@ HRESULT jsdisp_propput_name(DispatchEx *obj, const WCHAR *name, VARIANT *val, js
return
prop_put
(
obj
,
prop
,
val
,
ei
,
caller
);
}
HRESULT
jsdisp_propput_const
(
DispatchEx
*
obj
,
const
WCHAR
*
name
,
VARIANT
*
val
)
{
dispex_prop_t
*
prop
;
HRESULT
hres
;
hres
=
ensure_prop_name
(
obj
,
name
,
FALSE
,
PROPF_ENUM
|
PROPF_CONST
,
&
prop
);
if
(
FAILED
(
hres
))
return
hres
;
return
VariantCopy
(
&
prop
->
u
.
var
,
val
);
}
HRESULT
jsdisp_propput_idx
(
DispatchEx
*
obj
,
DWORD
idx
,
VARIANT
*
val
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
WCHAR
buf
[
12
];
...
...
dlls/jscript/function.c
View file @
0cbe1574
...
...
@@ -606,7 +606,16 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
if
(
FAILED
(
hres
))
return
hres
;
hres
=
set_prototype
(
ctx
,
&
function
->
dispex
,
prototype
);
if
(
builtin_info
)
{
VARIANT
var
;
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
function
->
length
;
hres
=
jsdisp_propput_const
(
&
function
->
dispex
,
lengthW
,
&
var
);
}
if
(
SUCCEEDED
(
hres
))
hres
=
set_prototype
(
ctx
,
&
function
->
dispex
,
prototype
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
&
function
->
dispex
);
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
0cbe1574
...
...
@@ -68,6 +68,7 @@ extern HINSTANCE jscript_hinstance;
#define PROPF_METHOD 0x0100
#define PROPF_ENUM 0x0200
#define PROPF_CONSTR 0x0400
#define PROPF_CONST 0x0800
/* NOTE: Keep in sync with names in Object.toString implementation */
typedef
enum
{
...
...
@@ -203,6 +204,7 @@ HRESULT disp_propget(script_ctx_t*,IDispatch*,DISPID,VARIANT*,jsexcept_t*,IServi
HRESULT
disp_propput
(
script_ctx_t
*
,
IDispatch
*
,
DISPID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propget
(
DispatchEx
*
,
DISPID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propput_name
(
DispatchEx
*
,
const
WCHAR
*
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propput_const
(
DispatchEx
*
,
const
WCHAR
*
,
VARIANT
*
);
HRESULT
jsdisp_propput_idx
(
DispatchEx
*
,
DWORD
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propget_name
(
DispatchEx
*
,
LPCWSTR
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_get_idx
(
DispatchEx
*
,
DWORD
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
...
...
@@ -318,8 +320,9 @@ typedef struct {
DWORD
len
;
}
match_result_t
;
#define REM_CHECK_GLOBAL 0x0001
#define REM_RESET_INDEX 0x0002
#define REM_CHECK_GLOBAL 0x0001
#define REM_RESET_INDEX 0x0002
#define REM_NO_CTX_UPDATE 0x0004
HRESULT
regexp_match_next
(
script_ctx_t
*
,
DispatchEx
*
,
DWORD
,
const
WCHAR
*
,
DWORD
,
const
WCHAR
**
,
match_result_t
**
,
DWORD
*
,
DWORD
*
,
match_result_t
*
);
HRESULT
regexp_match
(
script_ctx_t
*
,
DispatchEx
*
,
const
WCHAR
*
,
DWORD
,
BOOL
,
match_result_t
**
,
DWORD
*
);
...
...
dlls/jscript/tests/api.js
View file @
0cbe1574
...
...
@@ -2129,7 +2129,7 @@ ok(ActiveXObject.length == 1, "ActiveXObject.length = " + ActiveXObject.length);
ok
(
Array
.
length
==
1
,
"Array.length = "
+
Array
.
length
);
ok
(
Boolean
.
length
==
1
,
"Boolean.length = "
+
Boolean
.
length
);
ok
(
CollectGarbage
.
length
==
0
,
"CollectGarbage.length = "
+
CollectGarbage
.
length
);
//
ok(Date.length == 7, "Date.length = " + Date.length);
ok
(
Date
.
length
==
7
,
"Date.length = "
+
Date
.
length
);
ok
(
Enumerator
.
length
==
7
,
"Enumerator.length = "
+
Enumerator
.
length
);
ok
(
Error
.
length
==
1
,
"Error.length = "
+
Error
.
length
);
ok
(
EvalError
.
length
==
1
,
"EvalError.length = "
+
EvalError
.
length
);
...
...
@@ -2147,7 +2147,7 @@ ok(ScriptEngineMajorVersion.length == 0,
"ScriptEngineMajorVersion.length = "
+
ScriptEngineMajorVersion
.
length
);
ok
(
ScriptEngineMinorVersion
.
length
==
0
,
"ScriptEngineMinorVersion.length = "
+
ScriptEngineMinorVersion
.
length
);
//
ok(String.length == 1, "String.length = " + String.length);
ok
(
String
.
length
==
1
,
"String.length = "
+
String
.
length
);
ok
(
SyntaxError
.
length
==
1
,
"SyntaxError.length = "
+
SyntaxError
.
length
);
ok
(
TypeError
.
length
==
1
,
"TypeError.length = "
+
TypeError
.
length
);
ok
(
URIError
.
length
==
1
,
"URIError.length = "
+
URIError
.
length
);
...
...
@@ -2164,4 +2164,7 @@ ok(parseFloat.length == 1, "parseFloat.length = " + parseFloat.length);
ok
(
parseInt
.
length
==
2
,
"parseInt.length = "
+
parseInt
.
length
);
ok
(
unescape
.
length
==
1
,
"unescape.length = "
+
unescape
.
length
);
String
.
length
=
3
;
ok
(
String
.
length
==
1
,
"String.length = "
+
String
.
length
);
reportSuccess
();
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