Reviewers: arv, rossberg,
Message:
PTAL
apologies for the spam, uploaded the wrong version
Description:
[strong] Fix strong object exception messages
A mistake in a recent CL has messed up the error messages for strong object
semantics.
BUG=
LOG=N
Please review this at https://codereview.chromium.org/1166433007/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+29, -11 lines):
M src/messages.h
A + test/message/strong-object-freeze-prop.js
A test/message/strong-object-freeze-prop.out
A + test/message/strong-object-set-proto.js
A test/message/strong-object-set-proto.out
Index: src/messages.h
diff --git a/src/messages.h b/src/messages.h
index
50cb2c60e58da7ee5c191a73d598bd22474a788a..005b0606e75be4fa2aea77371f0df3c9f0fea62c
100644
--- a/src/messages.h
+++ b/src/messages.h
@@ -230,11 +230,10 @@ class CallSite {
"On strong object %, deletion of property % is
deprecated") \
T(StrongImplicitCast, "In strong mode, implicit conversions are
deprecated") \
T(StrongRedefineDisallowed,
\
- "Cannot redefine non-configurable property '%' of strong object % to
be " \
- "non-writable")
\
-
T(StrongSetProto,
\
"On strong object %, redefining writable, non-configurable
property '%' " \
"to be non-writable is
deprecated") \
+
T(StrongSetProto,
\
+ "On strong object %, redefining the internal prototype is
deprecated") \
T(SymbolKeyFor, "% is not a
symbol") \
T(SymbolToPrimitive,
\
"Cannot convert a Symbol wrapper object to a primitive
value") \
Index: test/message/strong-object-freeze-prop.js
diff --git a/test/mjsunit/strong/equality.js
b/test/message/strong-object-freeze-prop.js
similarity index 57%
copy from test/mjsunit/strong/equality.js
copy to test/message/strong-object-freeze-prop.js
index
5e2464c372771df089ee5117ca66a571b35172b2..17250158d56e9c8430906fc73eb27b3ce7cac6fb
100644
--- a/test/mjsunit/strong/equality.js
+++ b/test/message/strong-object-freeze-prop.js
@@ -4,7 +4,8 @@
// Flags: --strong-mode
-(function NoSloppyEquality() {
- assertThrows("'use strong'; 0 == 0", SyntaxError);
- assertThrows("'use strong'; 0 != 0", SyntaxError);
-})();
+"use strong";
+
+let o = {};
+Object.defineProperty(o, "foo", { writable: true });
+Object.defineProperty(o, "foo", { writable: false });
Index: test/message/strong-object-freeze-prop.out
diff --git a/test/message/strong-object-freeze-prop.out
b/test/message/strong-object-freeze-prop.out
new file mode 100644
index
0000000000000000000000000000000000000000..0c611c5928851801fcaa4cac0d9283ee9a66e13b
--- /dev/null
+++ b/test/message/strong-object-freeze-prop.out
@@ -0,0 +1,9 @@
+# Copyright 2015 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.
+*%(basename)s:11: TypeError: On strong object #<Object>, redefining
writable, non-configurable property 'foo' to be non-writable is deprecated
+Object.defineProperty(o, "foo", { writable: false });
+ ^
+TypeError: On strong object #<Object>, redefining writable,
non-configurable property 'foo' to be non-writable is deprecated
+ at Function.defineProperty (native)
+ at *%(basename)s:11:8
Index: test/message/strong-object-set-proto.js
diff --git a/test/mjsunit/compiler/regress-463056.js
b/test/message/strong-object-set-proto.js
similarity index 73%
copy from test/mjsunit/compiler/regress-463056.js
copy to test/message/strong-object-set-proto.js
index
fb871618e42c9387d38a445522bfd01cfbbe9bfa..890dd84d7292372c75cb9180ce67c3accadd0b81
100644
--- a/test/mjsunit/compiler/regress-463056.js
+++ b/test/message/strong-object-set-proto.js
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function f() {
- return ((0%0)&1) + (1>>>(0%0));
-}
+// Flags: --strong-mode
-f();
+"use strong";
+
+({}).__proto__ = {};
Index: test/message/strong-object-set-proto.out
diff --git a/test/message/strong-object-set-proto.out
b/test/message/strong-object-set-proto.out
new file mode 100644
index
0000000000000000000000000000000000000000..bf2c9334f701bc0bdf503adcf341093312a807d0
--- /dev/null
+++ b/test/message/strong-object-set-proto.out
@@ -0,0 +1,9 @@
+# Copyright 2015 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.
+*%(basename)s:9: TypeError: On strong object #<Object>, redefining the
internal prototype is deprecated
+({}).__proto__ = {};
+ ^
+TypeError: On strong object #<Object>, redefining the internal prototype
is deprecated
+ at Object.set __proto__ (native)
+ at *%(basename)s:9:16
--
--
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/d/optout.