Chromium Code Reviews| Index: test/mjsunit/global.js |
| diff --git a/test/mjsunit/global.js b/test/mjsunit/global.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5e22e1bbc3a16ab89c4d5b1392170824e6851e1d |
| --- /dev/null |
| +++ b/test/mjsunit/global.js |
| @@ -0,0 +1,23 @@ |
| +// Copyright 2016 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| + |
| +function Test() { |
| + var globalObject = global; |
| + assertEquals(globalObject, global); |
| + assertEquals(globalObject, global.global); |
| + |
| + var thisObject = this; |
| + assertEquals(globalObject, thisObject); |
|
targos
2016/12/23 17:31:21
This test fails and I don't understand why.
ljharb
2016/12/23 18:04:23
Are the tests run in strict or sloppy mode?
You m
|
| + assertEquals(globalObject, thisObject.global); |
| + |
| + const desc = Object.getOwnPropertyDescriptor(globalObject, 'global'); |
| + assertPropertiesEqual({ |
| + value: globalObject, |
| + writable: true, |
| + enumerable: false, |
| + configurable: true |
| + }, desc); |
| +} |
| +Test(); |