Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: test/mjsunit/regress/regress-270142.js

Issue 99203006: Make a strict function's "name" property non-writable. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Back out [[Configurable]] change, will be handled separately. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698