forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvar.js
More file actions
41 lines (35 loc) · 932 Bytes
/
var.js
File metadata and controls
41 lines (35 loc) · 932 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
34
35
36
37
38
39
40
41
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var defvar = 10;
WScript.Echo(defvar);
try
{
WScript.Echo(undefvar);
}
catch (e)
{
WScript.Echo(e.message);
}
WScript.Echo(this.defvar);
WScript.Echo(this.undefvar);
function func()
{
WScript.Echo(defvar);
try
{
WScript.Echo(undefvar);
}
catch (e)
{
WScript.Echo(e.message);
}
// this refers to the global object
WScript.Echo(this.defvar);
WScript.Echo(this.undefvar);
return this;
}
var g = func();
WScript.Echo(g.defvar);
WScript.Echo(g.undefvar);