From d19aaa2b1c37a67db42a17a5badd1c268fa064b7 Mon Sep 17 00:00:00 2001 From: "mvstanton@chromium.org" Date: Tue, 3 Jun 2014 11:52:07 +0000 Subject: [PATCH] Revert "Reland "Make 'name' property on functions configurable."" This reverts commit r21609 due to browser test failures. TBR=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/313583002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/bootstrapper.cc | 34 +++++++++++++++------------------- test/mjsunit/es7/object-observe.js | 3 +-- test/mjsunit/regress/regress-1530.js | 5 ++--- test/mjsunit/regress/regress-270142.js | 2 +- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index d562c65..9f59bcd 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(DONT_ENUM | DONT_DELETE | READ_ONLY); - PropertyAttributes roc_attribs = - static_cast(DONT_ENUM | READ_ONLY); + PropertyAttributes attribs = static_cast( + DONT_ENUM | DONT_DELETE | READ_ONLY); Handle length = - Accessors::FunctionLengthInfo(isolate(), ro_attribs); + Accessors::FunctionLengthInfo(isolate(), attribs); { // Add length. CallbacksDescriptor d(Handle(Name::cast(length->name())), - length, ro_attribs); + length, attribs); map->AppendDescriptor(&d); } Handle name = - Accessors::FunctionNameInfo(isolate(), roc_attribs); + Accessors::FunctionNameInfo(isolate(), attribs); { // Add name. CallbacksDescriptor d(Handle(Name::cast(name->name())), - name, roc_attribs); + name, attribs); map->AppendDescriptor(&d); } Handle args = - Accessors::FunctionArgumentsInfo(isolate(), ro_attribs); + Accessors::FunctionArgumentsInfo(isolate(), attribs); { // Add arguments. CallbacksDescriptor d(Handle(Name::cast(args->name())), - args, ro_attribs); + args, attribs); map->AppendDescriptor(&d); } Handle caller = - Accessors::FunctionCallerInfo(isolate(), ro_attribs); + Accessors::FunctionCallerInfo(isolate(), attribs); { // Add caller. CallbacksDescriptor d(Handle(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(ro_attribs & ~READ_ONLY); + attribs = static_cast(attribs & ~READ_ONLY); } Handle prototype = - Accessors::FunctionPrototypeInfo(isolate(), ro_attribs); + Accessors::FunctionPrototypeInfo(isolate(), attribs); CallbacksDescriptor d(Handle(Name::cast(prototype->name())), - prototype, ro_attribs); + prototype, attribs); map->AppendDescriptor(&d); } } @@ -535,8 +533,6 @@ void Genesis::SetStrictFunctionInstanceDescriptor( static_cast(DONT_ENUM | DONT_DELETE); PropertyAttributes ro_attribs = static_cast(DONT_ENUM | DONT_DELETE | READ_ONLY); - PropertyAttributes roc_attribs = - static_cast(DONT_ENUM | READ_ONLY); Handle length = Accessors::FunctionLengthInfo(isolate(), ro_attribs); @@ -546,10 +542,10 @@ void Genesis::SetStrictFunctionInstanceDescriptor( map->AppendDescriptor(&d); } Handle name = - Accessors::FunctionNameInfo(isolate(), roc_attribs); + Accessors::FunctionNameInfo(isolate(), ro_attribs); { // Add name. CallbacksDescriptor d(Handle(Name::cast(name->name())), - name, roc_attribs); + name, ro_attribs); map->AppendDescriptor(&d); } { // Add arguments. diff --git a/test/mjsunit/es7/object-observe.js b/test/mjsunit/es7/object-observe.js index 20a2d16..7bb579f 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) { diff --git a/test/mjsunit/regress/regress-1530.js b/test/mjsunit/regress/regress-1530.js index 3d40177..db21144 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: {} })"); diff --git a/test/mjsunit/regress/regress-270142.js b/test/mjsunit/regress/regress-270142.js index 63f4d14..6e0865c 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); } -- 2.7.4