Reviewers: Michael Starzinger, jochen,
Message:
At your leisure, please take a look.
(I hope I'm following expected process for this v8 CL & review. Please let
me
know if not :) )
Description:
Make a strict function's "name" property read only.
Have the 'name' property be read-only for strict functions as well.
LOG=N
R=
TEST=mjsunit/regress/regress-270142
BUG=270142
Please review this at https://codereview.chromium.org/99203006/
SVN Base: git://github.com/v8/v8.git@bleeding_edge
Affected files (+17, -8 lines):
M src/bootstrapper.cc
A + test/mjsunit/regress/regress-270142.js
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
4d69f8407f4fb4e9bff20bd174b8cb848d824fe6..48181c02833b2a84156dfb6063ca5f5dfbcf2258
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -554,7 +554,7 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
map->AppendDescriptor(&d, witness);
}
{ // Add name.
- CallbacksDescriptor d(*factory()->name_string(), *name, rw_attribs);
+ CallbacksDescriptor d(*factory()->name_string(), *name, ro_attribs);
map->AppendDescriptor(&d, witness);
}
{ // Add arguments.
Index: test/mjsunit/regress/regress-270142.js
diff --git a/test/mjsunit/compiler/increment-typefeedback.js
b/test/mjsunit/regress/regress-270142.js
similarity index 80%
copy from test/mjsunit/compiler/increment-typefeedback.js
copy to test/mjsunit/regress/regress-270142.js
index
798959296c43014f252d65ae5dd11e00563bfd04..6e0865c4f846407228549ef8cce7aff5db6da89d
100644
--- a/test/mjsunit/compiler/increment-typefeedback.js
+++ b/test/mjsunit/regress/regress-270142.js
@@ -25,15 +25,24 @@
// (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: --allow-natives-syntax
+// Check that "name"'s property descriptor for non-strict and strict
+// functions correspond.
function f(x) {
- x++;
return x;
}
-f(0.5);
-f(0.5);
-%OptimizeFunctionOnNextCall(f);
-f(0.5);
-assertOptimized(f);
+function g(x) {
+ "use strict";
+ return x;
+}
+
+function checkNameDescriptor(f) {
+ var descriptor = Object.getOwnPropertyDescriptor(f, "name");
+ assertFalse(descriptor.configurable);
+ assertFalse(descriptor.enumerable);
+ assertFalse(descriptor.writable);
+}
+
+checkNameDescriptor(f);
+checkNameDescriptor(g);
--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.