forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInternalToString.js
More file actions
28 lines (23 loc) · 1.05 KB
/
InternalToString.js
File metadata and controls
28 lines (23 loc) · 1.05 KB
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function writeLine(v) {
v = v.replace(/\(pdt\)/g, "(pacific daylight time)")
.replace(/\(pst\)/g, "(pacific standard time)");
WScript.Echo(v);
}
var a = new Object();
a.toString = function() { writeLine("In toString() "); return "foo" }
var v = String.prototype.toLowerCase.call(a);
writeLine("Test call ToString - user defined object: " + v);
a = true;
v = String.prototype.toLowerCase.call(a);
writeLine("Test call ToString - bool: " + v);
a = 123
v = String.prototype.toLowerCase.call(a);
writeLine("Test call ToString - number: " + v);
a = new Date();
a.setTime(20000)
v = String.prototype.toLowerCase.call(a);
writeLine("Test call ToString - date: " + v);