Reviewers: mvstanton,

Description:
Version 3.27.18.1 (merged r21632)

Revert "Reland "Make 'name' property on functions configurable.""

R=mvstan...@chromium.org
BUG=

Please review this at https://codereview.chromium.org/310773004/

SVN Base: https://v8.googlecode.com/svn/trunk

Affected files (+20, -26 lines):
  M src/bootstrapper.cc
  M src/version.cc
  M test/mjsunit/es7/object-observe.js
  M test/mjsunit/regress/regress-1530.js
  M test/mjsunit/regress/regress-270142.js


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 3a34182c41f65befb53ad70e8516235d043569ac..4c8701a55fddd8b522b299de7604c07fb5728cb8 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -386,47 +386,45 @@ void Genesis::SetFunctionInstanceDescriptor(
   int size = (prototypeMode == DONT_ADD_PROTOTYPE) ? 4 : 5;
   Map::EnsureDescriptorSlack(map, size);

-  PropertyAttributes ro_attribs =
-      static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
-  PropertyAttributes roc_attribs =
-      static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
+  PropertyAttributes attribs = static_cast<PropertyAttributes>(
+      DONT_ENUM | DONT_DELETE | READ_ONLY);

   Handle<AccessorInfo> length =
-      Accessors::FunctionLengthInfo(isolate(), ro_attribs);
+      Accessors::FunctionLengthInfo(isolate(), attribs);
   {  // Add length.
     CallbacksDescriptor d(Handle<Name>(Name::cast(length->name())),
-                          length, ro_attribs);
+                          length, attribs);
     map->AppendDescriptor(&d);
   }
   Handle<AccessorInfo> name =
-      Accessors::FunctionNameInfo(isolate(), roc_attribs);
+      Accessors::FunctionNameInfo(isolate(), attribs);
   {  // Add name.
     CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())),
-                          name, roc_attribs);
+                          name, attribs);
     map->AppendDescriptor(&d);
   }
   Handle<AccessorInfo> args =
-      Accessors::FunctionArgumentsInfo(isolate(), ro_attribs);
+      Accessors::FunctionArgumentsInfo(isolate(), attribs);
   {  // Add arguments.
     CallbacksDescriptor d(Handle<Name>(Name::cast(args->name())),
-                          args, ro_attribs);
+                          args, attribs);
     map->AppendDescriptor(&d);
   }
   Handle<AccessorInfo> caller =
-      Accessors::FunctionCallerInfo(isolate(), ro_attribs);
+      Accessors::FunctionCallerInfo(isolate(), attribs);
   {  // Add caller.
     CallbacksDescriptor d(Handle<Name>(Name::cast(caller->name())),
-                          caller, ro_attribs);
+                          caller, attribs);
     map->AppendDescriptor(&d);
   }
   if (prototypeMode != DONT_ADD_PROTOTYPE) {
     if (prototypeMode == ADD_WRITEABLE_PROTOTYPE) {
- ro_attribs = static_cast<PropertyAttributes>(ro_attribs & ~READ_ONLY);
+      attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY);
     }
     Handle<AccessorInfo> prototype =
-        Accessors::FunctionPrototypeInfo(isolate(), ro_attribs);
+        Accessors::FunctionPrototypeInfo(isolate(), attribs);
     CallbacksDescriptor d(Handle<Name>(Name::cast(prototype->name())),
-                          prototype, ro_attribs);
+                          prototype, attribs);
     map->AppendDescriptor(&d);
   }
 }
@@ -535,8 +533,6 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
       static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
   PropertyAttributes ro_attribs =
       static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
-  PropertyAttributes roc_attribs =
-      static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);

   Handle<AccessorInfo> length =
       Accessors::FunctionLengthInfo(isolate(), ro_attribs);
@@ -546,10 +542,10 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
     map->AppendDescriptor(&d);
   }
   Handle<AccessorInfo> name =
-      Accessors::FunctionNameInfo(isolate(), roc_attribs);
+      Accessors::FunctionNameInfo(isolate(), ro_attribs);
   {  // Add name.
     CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())),
-                          name, roc_attribs);
+                          name, ro_attribs);
     map->AppendDescriptor(&d);
   }
   {  // Add arguments.
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index 14dcef32b3fd6124e233b06eaef0eaf3d4c84b7f..e6a9c94b4960dc30a9396bbedeeec5cfaceed565 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     27
 #define BUILD_NUMBER      18
-#define PATCH_LEVEL       0
+#define PATCH_LEVEL       1
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
Index: test/mjsunit/es7/object-observe.js
diff --git a/test/mjsunit/es7/object-observe.js b/test/mjsunit/es7/object-observe.js index 20a2d160514ee554a9a091512d309a43a9ccd32a..7bb579f0c1462b6b33ff1bc6c3229067317f2845 100644
--- a/test/mjsunit/es7/object-observe.js
+++ b/test/mjsunit/es7/object-observe.js
@@ -1142,8 +1142,7 @@ var properties = ["a", "1", 1, "length", "setPrototype", "name", "caller"];
 function blacklisted(obj, prop) {
   return (obj instanceof Int32Array && prop == 1) ||
          (obj instanceof Int32Array && prop === "length") ||
-         (obj instanceof ArrayBuffer && prop == 1) ||
-         (obj instanceof Function && prop === "name")
+         (obj instanceof ArrayBuffer && prop == 1)
 }

 for (var i in objects) for (var j in properties) {
Index: test/mjsunit/regress/regress-1530.js
diff --git a/test/mjsunit/regress/regress-1530.js b/test/mjsunit/regress/regress-1530.js index 3d4017782032922689862551a7eb819f66fc4521..db2114450e4133371bc9045e0c409f5154333d01 100644
--- a/test/mjsunit/regress/regress-1530.js
+++ b/test/mjsunit/regress/regress-1530.js
@@ -62,9 +62,8 @@ assertSame(new f().foo, 'other');
 assertSame(Object.getPrototypeOf(new f()), z);
 assertSame(Object.getOwnPropertyDescriptor(f, 'prototype').value, z);

-// Verify that non-configurability of other properties is respected, but
-// non-writability is ignored by Object.defineProperty().
-assertDoesNotThrow("Object.defineProperty(f, 'name', { value: {} })");
+// Verify that non-writability of other properties is respected.
+assertThrows("Object.defineProperty(f, 'name', { value: {} })");
 assertThrows("Object.defineProperty(f, 'length', { value: {} })");
 assertThrows("Object.defineProperty(f, 'caller', { value: {} })");
 assertThrows("Object.defineProperty(f, 'arguments', { value: {} })");
Index: test/mjsunit/regress/regress-270142.js
diff --git a/test/mjsunit/regress/regress-270142.js b/test/mjsunit/regress/regress-270142.js index 63f4d1414ead55029eb509a2f971aeea3e4bd722..6e0865c4f846407228549ef8cce7aff5db6da89d 100644
--- a/test/mjsunit/regress/regress-270142.js
+++ b/test/mjsunit/regress/regress-270142.js
@@ -39,7 +39,7 @@ function g(x) {

 function checkNameDescriptor(f) {
   var descriptor = Object.getOwnPropertyDescriptor(f, "name");
-  assertTrue(descriptor.configurable);
+  assertFalse(descriptor.configurable);
   assertFalse(descriptor.enumerable);
   assertFalse(descriptor.writable);
 }


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to