forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprototype.js
More file actions
33 lines (27 loc) · 943 Bytes
/
prototype.js
File metadata and controls
33 lines (27 loc) · 943 Bytes
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function echo(msg) {
WScript.Echo(msg);
}
function guarded_call(func) {
try {
func();
} catch (e) {
echo(e.name + ": " + e.message);
}
}
echo(typeof Function.prototype);
echo(Function.prototype);
echo(Function.prototype());
echo(Function.prototype("return 123;"));
echo(Function.prototype(123, "foo", null));
guarded_call(function () {
var o = new Function.prototype();
echo("Fail: " + o);
});
guarded_call(function () {
var o = ({}) instanceof Function.prototype;
echo("Fail: " + o);
});