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
2e767e81
Commit
2e767e81
authored
Jun 05, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Add Object.preventExtensions semi-stub implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fe0bd340
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
2 deletions
+45
-2
object.c
dlls/jscript/object.c
+23
-1
es5.js
dlls/mshtml/tests/es5.js
+22
-1
No files found.
dlls/jscript/object.c
View file @
2e767e81
...
...
@@ -671,13 +671,35 @@ static HRESULT Object_keys(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
return
hres
;
}
static
HRESULT
Object_preventExtensions
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
unsigned
argc
,
jsval_t
*
argv
,
jsval_t
*
r
)
{
jsdisp_t
*
obj
;
if
(
!
argc
||
!
is_object_instance
(
argv
[
0
])
||
!
get_object
(
argv
[
0
]))
{
FIXME
(
"invalid arguments
\n
"
);
return
E_NOTIMPL
;
}
FIXME
(
"(%s) semi-stub
\n
"
,
debugstr_jsval
(
argv
[
0
]));
obj
=
to_jsdisp
(
get_object
(
argv
[
0
]));
if
(
!
obj
)
{
FIXME
(
"Non-JS object
\n
"
);
return
E_NOTIMPL
;
}
if
(
r
)
*
r
=
jsval_obj
(
jsdisp_addref
(
obj
));
return
S_OK
;
}
static
const
builtin_prop_t
ObjectConstr_props
[]
=
{
{
L"create"
,
Object_create
,
PROPF_ES5
|
PROPF_METHOD
|
2
},
{
L"defineProperties"
,
Object_defineProperties
,
PROPF_ES5
|
PROPF_METHOD
|
2
},
{
L"defineProperty"
,
Object_defineProperty
,
PROPF_ES5
|
PROPF_METHOD
|
2
},
{
L"getOwnPropertyDescriptor"
,
Object_getOwnPropertyDescriptor
,
PROPF_ES5
|
PROPF_METHOD
|
2
},
{
L"getPrototypeOf"
,
Object_getPrototypeOf
,
PROPF_ES5
|
PROPF_METHOD
|
1
},
{
L"keys"
,
Object_keys
,
PROPF_ES5
|
PROPF_METHOD
|
1
}
{
L"keys"
,
Object_keys
,
PROPF_ES5
|
PROPF_METHOD
|
1
},
{
L"preventExtensions"
,
Object_preventExtensions
,
PROPF_ES5
|
PROPF_METHOD
|
1
},
};
static
const
builtin_info_t
ObjectConstr_info
=
{
...
...
dlls/mshtml/tests/es5.js
View file @
2e767e81
...
...
@@ -924,7 +924,28 @@ sync_test("reduce", function() {
try
{
[].
reduce
(
function
(
a
)
{
return
0
;
});
ok
(
false
,
"expected exception"
);
}
catch
(
e
)
{
trace
(
e
.
message
);
}
}
catch
(
e
)
{}
ok
(
Array
.
prototype
.
reduce
.
length
===
1
,
"Array.prototype.reduce.length = "
+
Array
.
prototype
.
reduce
.
length
);
});
sync_test
(
"preventExtensions"
,
function
()
{
var
o
=
{};
var
r
=
Object
.
preventExtensions
(
o
);
ok
(
r
===
o
,
"r != o"
);
o
.
x
=
1
;
todo_wine
.
ok
(
!
(
"x"
in
o
),
"x property added to o"
);
try
{
Object
.
defineProperty
(
o
,
"y"
,
{
value
:
true
});
todo_wine
.
ok
(
false
,
"expected exception"
);
}
catch
(
e
)
{
ok
(
e
.
name
===
"TypeError"
,
"got "
+
e
.
name
+
" exception"
);
}
r
=
Object
.
preventExtensions
(
o
);
ok
(
r
===
o
,
"r != o"
);
ok
(
Object
.
preventExtensions
.
length
===
1
,
"Object.preventExtensions.length = "
+
Object
.
preventExtensions
.
length
);
});
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