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
fd91fe52
Commit
fd91fe52
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 getting value of accessor property.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d8aa26f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
dispex.c
dlls/jscript/dispex.c
+14
-6
es5.js
dlls/mshtml/tests/es5.js
+10
-0
No files found.
dlls/jscript/dispex.c
View file @
fd91fe52
...
...
@@ -434,8 +434,14 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t
static
HRESULT
prop_get
(
jsdisp_t
*
This
,
dispex_prop_t
*
prop
,
jsval_t
*
r
)
{
jsdisp_t
*
prop_obj
=
This
;
HRESULT
hres
;
while
(
prop
->
type
==
PROP_PROTREF
)
{
prop_obj
=
prop_obj
->
prototype
;
prop
=
prop_obj
->
props
+
prop
->
u
.
ref
;
}
switch
(
prop
->
type
)
{
case
PROP_BUILTIN
:
if
(
prop
->
u
.
p
->
getter
)
{
...
...
@@ -456,18 +462,20 @@ static HRESULT prop_get(jsdisp_t *This, dispex_prop_t *prop, jsval_t *r)
*
r
=
jsval_obj
(
obj
);
}
break
;
case
PROP_PROTREF
:
hres
=
prop_get
(
This
->
prototype
,
This
->
prototype
->
props
+
prop
->
u
.
ref
,
r
);
break
;
case
PROP_JSVAL
:
hres
=
jsval_copy
(
prop
->
u
.
val
,
r
);
break
;
case
PROP_ACCESSOR
:
FIXME
(
"not supported on accessor property
\n
"
);
hres
=
E_NOTIMPL
;
if
(
prop
->
u
.
accessor
.
getter
)
{
hres
=
jsdisp_call_value
(
prop
->
u
.
accessor
.
getter
,
to_disp
(
This
),
DISPATCH_METHOD
,
0
,
NULL
,
r
);
}
else
{
*
r
=
jsval_undefined
();
hres
=
S_OK
;
}
break
;
case
PROP_IDX
:
hres
=
This
->
builtin_info
->
idx_get
(
This
,
prop
->
u
.
idx
,
r
);
hres
=
prop_obj
->
builtin_info
->
idx_get
(
prop_obj
,
prop
->
u
.
idx
,
r
);
break
;
default:
ERR
(
"type %d
\n
"
,
prop
->
type
);
...
...
dlls/mshtml/tests/es5.js
View file @
fd91fe52
...
...
@@ -257,6 +257,8 @@ function test_defineProperty() {
Object
.
defineProperty
(
obj
,
"getsetprop"
,
desc
);
test_accessor_prop_desc
(
obj
,
"getsetprop"
,
desc
);
ok
(
obj
.
getsetprop
===
1
,
"getsetprop = "
+
obj
.
getsetprop
);
Object
.
defineProperty
(
obj
,
"notConf"
,
{
writable
:
true
,
enumerable
:
true
,
configurable
:
false
,
value
:
1
});
test_own_data_prop_desc
(
obj
,
"notConf"
,
true
,
true
,
false
);
...
...
@@ -379,9 +381,11 @@ function test_defineProperty() {
function
child
()
{}
desc
=
{
get
:
function
()
{
ok
(
this
===
obj
,
"this != obj"
);
return
getsetprop_value
;
},
set
:
function
(
v
)
{
ok
(
this
===
obj
,
"this != obj"
);
getsetprop_value
=
v
;
},
configurable
:
true
...
...
@@ -389,11 +393,17 @@ function test_defineProperty() {
Object
.
defineProperty
(
child
.
prototype
,
"parent_accessor"
,
desc
);
obj
=
new
child
();
getsetprop_value
=
6
;
ok
(
obj
.
parent_accessor
===
6
,
"parent_accessor = "
+
obj
.
parent_accessor
);
ok
(
Object
.
getOwnPropertyDescriptor
(
obj
,
"parent_accessor"
)
===
undefined
,
"getOwnPropertyDescriptor(parent_accessor) did not return undefined"
);
test_accessor_prop_desc
(
child
.
prototype
,
"parent_accessor"
,
desc
);
desc
.
get
=
undefined
;
Object
.
defineProperty
(
child
.
prototype
,
"parent_accessor"
,
desc
);
ok
(
obj
.
parent_accessor
===
undefined
,
"parent_accessor = "
+
obj
.
parent_accessor
);
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