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
9fd4f4a4
Commit
9fd4f4a4
authored
Feb 05, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added support for constructor property.
parent
75ab8e20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
dispex.c
dlls/jscript/dispex.c
+17
-0
lang.js
dlls/jscript/tests/lang.js
+5
-0
regexp.js
dlls/jscript/tests/regexp.js
+1
-0
No files found.
dlls/jscript/dispex.c
View file @
9fd4f4a4
...
...
@@ -803,6 +803,7 @@ HRESULT init_dispex_from_constr(DispatchEx *dispex, script_ctx_t *ctx, const bui
dispex_prop_t
*
prop
;
HRESULT
hres
;
static
const
WCHAR
constructorW
[]
=
{
'c'
,
'o'
,
'n'
,
's'
,
't'
,
'r'
,
'u'
,
'c'
,
't'
,
'o'
,
'r'
};
static
const
WCHAR
prototypeW
[]
=
{
'p'
,
'r'
,
'o'
,
't'
,
'o'
,
't'
,
'y'
,
'p'
,
'e'
,
0
};
hres
=
find_prop_name_prot
(
constr
,
prototypeW
,
&
prop
);
...
...
@@ -827,6 +828,22 @@ HRESULT init_dispex_from_constr(DispatchEx *dispex, script_ctx_t *ctx, const bui
if
(
prot
)
jsdisp_release
(
prot
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
ensure_prop_name
(
dispex
,
constructorW
,
FALSE
,
0
,
&
prop
);
if
(
SUCCEEDED
(
hres
))
{
jsexcept_t
jsexcept
;
VARIANT
var
;
V_VT
(
&
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
var
)
=
(
IDispatch
*
)
_IDispatchEx_
(
constr
);
memset
(
&
jsexcept
,
0
,
sizeof
(
jsexcept
));
hres
=
prop_put
(
dispex
,
prop
,
&
var
,
&
jsexcept
,
NULL
/*FIXME*/
);
}
if
(
FAILED
(
hres
))
jsdisp_release
(
dispex
);
return
hres
;
}
...
...
dlls/jscript/tests/lang.js
View file @
9fd4f4a4
...
...
@@ -116,6 +116,7 @@ ok(tmp === 1, "tmp = " + tmp);
var
obj1
=
new
Object
();
ok
(
typeof
(
obj1
)
===
"object"
,
"typeof(obj1) is not object"
);
ok
(
obj1
.
constructor
===
Object
,
"unexpected obj1.constructor"
);
obj1
.
test
=
true
;
obj1
.
func
=
function
()
{
ok
(
this
===
obj1
,
"this is not obj1"
);
...
...
@@ -144,6 +145,7 @@ testConstr1.prototype.pvar = 1;
var
obj2
=
new
testConstr1
(
true
);
ok
(
typeof
(
obj2
)
===
"object"
,
"typeof(obj2) is not object"
);
ok
(
obj2
.
constructor
===
testConstr1
,
"unexpected obj2.constructor"
);
ok
(
obj2
.
pvar
===
1
,
"obj2.pvar is not 1"
);
testConstr1
.
prototype
.
pvar
=
2
;
...
...
@@ -209,6 +211,7 @@ if(false) {
var
obj3
=
{
prop1
:
1
,
prop2
:
typeof
(
false
)
};
ok
(
obj3
.
prop1
===
1
,
"obj3.prop1 is not 1"
);
ok
(
obj3
.
prop2
===
"boolean"
,
"obj3.prop2 is not
\"
boolean
\"
"
);
ok
(
obj3
.
constructor
===
Object
,
"unexpected obj3.constructor"
);
{
var
blockVar
=
1
;
...
...
@@ -422,8 +425,10 @@ ok(+"3e3" === 3000, "+'3e3' !== 3000");
tmp
=
new
Number
(
1
);
ok
(
+
tmp
===
1
,
"+(new Number(1)) = "
+
(
+
tmp
));
ok
(
tmp
.
constructor
===
Number
,
"unexpected tmp.constructor"
);
tmp
=
new
String
(
"1"
);
ok
(
+
tmp
===
1
,
"+(new String('1')) = "
+
(
+
tmp
));
ok
(
tmp
.
constructor
===
String
,
"unexpected tmp.constructor"
);
ok
(
""
+
0
===
"0"
,
"
\"\"
+ 0 !==
\"
0
\"
"
);
ok
(
""
+
123
===
"123"
,
"
\"\"
+ 123 !==
\"
123
\"
"
);
...
...
dlls/jscript/tests/regexp.js
View file @
9fd4f4a4
...
...
@@ -100,6 +100,7 @@ m = "abcabc".match(re = /ca/);
ok
(
typeof
(
m
)
===
"object"
,
"typeof m is not object"
);
ok
(
m
.
length
===
1
,
"m.length is not 1"
);
ok
(
m
[
"0"
]
===
"ca"
,
"m[0] is not
\"
ca
\"
"
);
ok
(
m
.
constructor
===
Array
,
"unexpected m.constructor"
);
ok
(
re
.
lastIndex
===
4
,
"re.lastIndex = "
+
re
.
lastIndex
);
m
=
"abcabc"
.
match
(
/ab/
);
...
...
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