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
d8aa26f6
Commit
d8aa26f6
authored
May 15, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
May 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Support accessor properties in getOwnPropertyDescriptor.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7d7eee09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
dispex.c
dlls/jscript/dispex.c
+9
-0
es5.js
dlls/mshtml/tests/es5.js
+22
-0
No files found.
dlls/jscript/dispex.c
View file @
d8aa26f6
...
...
@@ -1623,6 +1623,15 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl
return
hres
;
}
break
;
case
PROP_ACCESSOR
:
desc
->
explicit_getter
=
desc
->
explicit_setter
=
TRUE
;
if
(
!
flags_only
)
{
desc
->
getter
=
prop
->
u
.
accessor
.
getter
?
jsdisp_addref
(
prop
->
u
.
accessor
.
getter
)
:
NULL
;
desc
->
setter
=
prop
->
u
.
accessor
.
setter
?
jsdisp_addref
(
prop
->
u
.
accessor
.
setter
)
:
NULL
;
}
break
;
default:
return
DISP_E_UNKNOWNNAME
;
}
...
...
dlls/mshtml/tests/es5.js
View file @
d8aa26f6
...
...
@@ -204,6 +204,19 @@ function test_getOwnPropertyDescriptor() {
}
function
test_defineProperty
()
{
function
test_accessor_prop_desc
(
obj
,
prop
,
orig_desc
)
{
var
expected_enumerable
=
"enumerable"
in
orig_desc
&&
!!
orig_desc
.
enumerable
;
var
expected_configurable
=
"configurable"
in
orig_desc
&&
!!
orig_desc
.
configurable
;
var
desc
=
Object
.
getOwnPropertyDescriptor
(
obj
,
prop
);
ok
(
desc
.
enumerable
===
expected_enumerable
,
"desc.enumerable = "
+
desc
.
enumerable
+
" expected "
+
expected_enumerable
);
ok
(
desc
.
configurable
===
expected_configurable
,
"desc.configurable = "
+
desc
.
configurable
+
" expected "
+
expected_configurable
);
ok
(
desc
.
get
===
orig_desc
.
get
,
"desc.get = "
+
desc
.
get
);
ok
(
desc
.
set
===
orig_desc
.
set
,
"desc.set = "
+
desc
.
set
);
}
function
expect_exception
(
func
,
expected_number
)
{
try
{
func
();
...
...
@@ -242,6 +255,7 @@ function test_defineProperty() {
}
};
Object
.
defineProperty
(
obj
,
"getsetprop"
,
desc
);
test_accessor_prop_desc
(
obj
,
"getsetprop"
,
desc
);
Object
.
defineProperty
(
obj
,
"notConf"
,
{
writable
:
true
,
enumerable
:
true
,
configurable
:
false
,
value
:
1
});
test_own_data_prop_desc
(
obj
,
"notConf"
,
true
,
true
,
false
);
...
...
@@ -304,6 +318,7 @@ function test_defineProperty() {
configurable
:
false
};
Object
.
defineProperty
(
obj
,
"notConfAcc"
,
desc
);
test_accessor_prop_desc
(
obj
,
"notConfAcc"
,
desc
);
expect_exception
(
function
()
{
Object
.
defineProperty
(
obj
,
"notConfAcc"
,
{
value
:
1
});
...
...
@@ -322,10 +337,13 @@ function test_defineProperty() {
},
JS_E_NONCONFIGURABLE_REDEFINED
);
Object
.
defineProperty
(
obj
,
"notConfAcc"
,
{
get
:
desc
.
get
});
test_accessor_prop_desc
(
obj
,
"notConfAcc"
,
desc
);
Object
.
defineProperty
(
obj
,
"notConfAcc"
,
{
set
:
desc
.
set
});
test_accessor_prop_desc
(
obj
,
"notConfAcc"
,
desc
);
Object
.
defineProperty
(
obj
,
"notConfAcc"
,
{
configurable
:
false
});
test_accessor_prop_desc
(
obj
,
"notConfAcc"
,
desc
);
desc
=
{
get
:
function
()
{
...
...
@@ -337,15 +355,18 @@ function test_defineProperty() {
configurable
:
true
};
Object
.
defineProperty
(
obj
,
"confAcc"
,
desc
);
test_accessor_prop_desc
(
obj
,
"confAcc"
,
desc
);
Object
.
defineProperty
(
obj
,
"confAcc"
,
{
writable
:
1
});
test_own_data_prop_desc
(
obj
,
"confAcc"
,
true
,
false
,
true
);
Object
.
defineProperty
(
obj
,
"confAcc"
,
desc
);
test_accessor_prop_desc
(
obj
,
"confAcc"
,
desc
);
desc
.
get
=
function
()
{};
desc
.
set
=
undefined
;
Object
.
defineProperty
(
obj
,
"confAcc"
,
desc
);
test_accessor_prop_desc
(
obj
,
"confAcc"
,
desc
);
expect_exception
(
function
()
{
Object
.
defineProperty
(
obj
,
"invaliddesc"
,
{
get
:
undefined
,
value
:
1
});
...
...
@@ -371,6 +392,7 @@ function test_defineProperty() {
ok
(
Object
.
getOwnPropertyDescriptor
(
obj
,
"parent_accessor"
)
===
undefined
,
"getOwnPropertyDescriptor(parent_accessor) did not return undefined"
);
test_accessor_prop_desc
(
child
.
prototype
,
"parent_accessor"
,
desc
);
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