Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: test/mjsunit/harmony/global.js

Issue 2599903003: Implement "global" property of global object
Patch Set: implement behind a harmony flag Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/global.js
diff --git a/test/mjsunit/harmony/global.js b/test/mjsunit/harmony/global.js
new file mode 100644
index 0000000000000000000000000000000000000000..a5157f43955de0fbf99664c4d710c404489730cb
--- /dev/null
+++ b/test/mjsunit/harmony/global.js
@@ -0,0 +1,24 @@
+// 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.
+
+// Flags: --harmony-global
+
+function Test() {
+ var globalObject = global;
+ assertEquals(globalObject, global);
+ assertEquals(globalObject, global.global);
+
+ var thisObject = this;
+ assertEquals(globalObject, thisObject);
+ assertEquals(globalObject, thisObject.global);
+
+ const desc = Object.getOwnPropertyDescriptor(globalObject, 'global');
+ assertPropertiesEqual({
+ value: globalObject,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ }, desc);
+}
+Test();
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698