Revision: 11402
Author:   [email protected]
Date:     Fri Apr 20 06:35:09 2012
Log: Put new global var semantics behind a flag until WebKit tests are cleaned up.

[email protected]
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10163003
http://code.google.com/p/v8/source/detail?r=11402

Modified:
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/test/cctest/test-api.cc
 /branches/bleeding_edge/test/cctest/test-decls.cc
 /branches/bleeding_edge/test/mjsunit/declare-locally.js
 /branches/bleeding_edge/test/mjsunit/regress/regress-1119.js
 /branches/bleeding_edge/test/mjsunit/regress/regress-115452.js
 /branches/bleeding_edge/test/mjsunit/regress/regress-1170.js

=======================================
--- /branches/bleeding_edge/src/flag-definitions.h      Fri Apr 20 03:42:12 2012
+++ /branches/bleeding_edge/src/flag-definitions.h      Fri Apr 20 06:35:09 2012
@@ -132,6 +132,8 @@

 // Flags for language modes and experimental language features.
 DEFINE_bool(use_strict, false, "enforce strict mode")
+DEFINE_bool(es52_globals, false,
+            "activate new semantics for global var declarations")

 DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof")
 DEFINE_bool(harmony_scoping, false, "enable harmony block scoping")
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Fri Apr 20 04:06:12 2012
+++ /branches/bleeding_edge/src/runtime.cc      Fri Apr 20 06:35:09 2012
@@ -1300,7 +1300,10 @@
       // value of the variable if the property is already there.
       // Do the lookup locally only, see ES5 errata.
       LookupResult lookup(isolate);
-      global->LocalLookup(*name, &lookup);
+      if (FLAG_es52_globals)
+        global->LocalLookup(*name, &lookup);
+      else
+        global->Lookup(*name, &lookup);
       if (lookup.IsProperty()) {
         // We found an existing property. Unless it was an interceptor
         // that claims the property is absent, skip this declaration.
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc     Fri Apr 20 03:21:08 2012
+++ /branches/bleeding_edge/test/cctest/test-api.cc     Fri Apr 20 06:35:09 2012
@@ -12483,6 +12483,7 @@
 // Check that a variable declaration with no explicit initialization
 // value does shadow an existing property in the prototype chain.
 THREADED_TEST(InitGlobalVarInProtoChain) {
+  i::FLAG_es52_globals = true;
   v8::HandleScope scope;
   LocalContext context;
   // Introduce a variable in the prototype chain.
=======================================
--- /branches/bleeding_edge/test/cctest/test-decls.cc Mon Apr 16 06:20:50 2012 +++ /branches/bleeding_edge/test/cctest/test-decls.cc Fri Apr 20 06:35:09 2012
@@ -521,6 +521,7 @@


 TEST(ExistsInPrototype) {
+  i::FLAG_es52_globals = true;
   HandleScope scope;

   // Sanity check to make sure that the holder of the interceptor
@@ -583,6 +584,7 @@


 TEST(AbsentInPrototype) {
+  i::FLAG_es52_globals = true;
   HandleScope scope;

   { AbsentInPrototypeContext context;
=======================================
--- /branches/bleeding_edge/test/mjsunit/declare-locally.js Mon Apr 16 06:20:50 2012 +++ /branches/bleeding_edge/test/mjsunit/declare-locally.js Fri Apr 20 06:35:09 2012
@@ -33,6 +33,8 @@
 // This exercises the code in runtime.cc in
 // DeclareGlobal...Locally().

+// Flags: --es52_globals
+
 this.__proto__.foo = 42;
 this.__proto__.bar = 87;

=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-1119.js Mon Apr 16 06:20:50 2012 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-1119.js Fri Apr 20 06:35:09 2012
@@ -28,6 +28,8 @@
 // Test runtime declaration of properties with var which are intercepted
 // by JS accessors.

+// Flags: --es52_globals
+
 this.__defineSetter__("x", function() { hasBeenInvoked = true; });
 this.__defineSetter__("y", function() { throw 'exception'; });

=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-115452.js Mon Apr 16 06:20:50 2012 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-115452.js Fri Apr 20 06:35:09 2012
@@ -27,6 +27,8 @@

 // Test that a function declaration cannot overwrite a read-only property.

+// Flags: --es52_globals
+
 function foobl() {}
 assertTrue(typeof this.foobl == "function");
 assertTrue(Object.getOwnPropertyDescriptor(this, "foobl").writable);
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-1170.js Mon Apr 16 06:20:50 2012 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-1170.js Fri Apr 20 06:35:09 2012
@@ -25,6 +25,8 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+// Flags: --es52_globals
+
 var setter_value = 0;

 this.__defineSetter__("a", function(v) { setter_value = v; });

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to