-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy patharguments3.js
36 lines (30 loc) · 1.04 KB
/
arguments3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var echo = function(v) {
WScript.Echo(v);
}
var get_args = function(a, b) {
return arguments;
}
echo("--- toString test ---");
echo(get_args());
echo(get_args(1, '2', null));
echo("\n--- getOwnPropertyNames should enumerate all properties ---");
//
// TODO: Currently the following outputs 2 length properties.
//
echo(Object.getOwnPropertyNames(
get_args()));
echo(Object.getOwnPropertyNames(
get_args(1)));
echo(Object.getOwnPropertyNames(
get_args(1, 2)));
var a = get_args(1, 2, '3', 'arg4', 'arg5');
echo(Object.getOwnPropertyNames(a));
delete a[0];
delete a[1];
delete a[4];
a[0] = 'arg0';
echo(Object.getOwnPropertyNames(a));