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
1857cdf5
Commit
1857cdf5
authored
Aug 03, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: More arguments object tests.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2f63a1e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
lang.js
dlls/jscript/tests/lang.js
+36
-0
No files found.
dlls/jscript/tests/lang.js
View file @
1857cdf5
...
...
@@ -101,6 +101,10 @@ function testFunc1(x, y) {
ok
(
tmp
===
false
,
"arguments deleted"
);
ok
(
typeof
(
arguments
)
===
"object"
,
"typeof(arguments) = "
+
typeof
(
arguments
));
x
=
2
;
ok
(
x
===
2
,
"x = "
+
x
);
ok
(
arguments
[
0
]
===
2
,
"arguments[0] = "
+
arguments
[
0
]);
return
true
;
}
...
...
@@ -211,6 +215,38 @@ function argumentsTest() {
argumentsTest
();
// arguments object detached from its execution context
(
function
()
{
var
args
,
get_x
,
set_x
;
function
test_args
(
detached
)
{
ok
(
args
[
0
]
===
1
,
"args[0] = "
+
args
[
0
]);
set_x
(
2
);
ok
(
args
[
0
]
===
(
detached
?
1
:
2
),
"args[0] = "
+
args
[
0
]
+
" expected "
+
(
detached
?
1
:
2
));
args
[
0
]
=
3
;
ok
(
get_x
()
===
(
detached
?
2
:
3
),
"get_x() = "
+
get_x
());
ok
(
args
[
0
]
===
3
,
"args[0] = "
+
args
[
0
]);
}
(
function
(
x
)
{
args
=
arguments
;
get_x
=
function
()
{
return
x
;
};
set_x
=
function
(
v
)
{
x
=
v
;
};
test_args
(
false
);
x
=
1
;
})(
1
);
test_args
(
true
);
})();
// arguments is a regular variable, it may be overwritten
(
function
()
{
ok
(
typeof
(
arguments
)
===
"object"
,
"typeof(arguments) = "
+
typeof
(
arguments
));
arguments
=
1
;
ok
(
arguments
===
1
,
"arguments = "
+
arguments
);
})();
(
function
callAsExprTest
()
{
ok
(
callAsExprTest
.
arguments
===
null
,
"callAsExprTest.arguments = "
+
callAsExprTest
.
arguments
);
})(
1
,
2
);
...
...
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