| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- //-------------------------------------------------------------------------------------------------------
- // Copyright (C) Microsoft. All rights reserved.
- // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
- //-------------------------------------------------------------------------------------------------------
- // 0
- {
- with({x:0}) {
- WScript.Echo(x)
- }
- let x = 1
- }
- // 0
- {
- eval('with({x:0}) { WScript.Echo(x) }')
- let x = 1
- }
- // 0
- {
- let f = function() {
- with({x:0}) {
- WScript.Echo(x)
- }
- }
- let x = 1
- f()
- }
- // Reference error.
- {
- try {
- with({}) {
- WScript.Echo(x)
- }
- let x = 1
- } catch(e) {
- WScript.Echo(e)
- }
- }
- // Reference error.
- {
- try {
- eval('with({}) { WScript.Echo(x) }')
- let x = 1
- } catch(e) {
- WScript.Echo(e)
- }
- }
- // 1
- {
- with({x:0}) {
- let x = 1
- WScript.Echo(x)
- }
- }
- // Reference error.
- {
- try {
- with({x:0}) {
- WScript.Echo(x)
- let x = 1
- }
- } catch(e) {
- WScript.Echo(e)
- }
- }
- // string
- with({x: 'x'})
- {
- WScript.Echo(typeof x)
- }
- let x = 5
|