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

Side by Side Diff: test/mjsunit/es6/function-name-configurable.js

Issue 1080393004: [es6] Function.prototype.name should be the empty string (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | test/mjsunit/es6/function-prototype-name.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function getStrictF() { 5 function getStrictF() {
6 'use strict'; 6 'use strict';
7 return function f() {}; 7 return function f() {};
8 } 8 }
9 9
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 test(testFunctionToString); 84 test(testFunctionToString);
85 85
86 86
87 (function testSetOnInstance() { 87 (function testSetOnInstance() {
88 // This needs to come before testDelete below 88 // This needs to come before testDelete below
89 assertTrue(Function.prototype.hasOwnProperty('name')); 89 assertTrue(Function.prototype.hasOwnProperty('name'));
90 90
91 function f() {} 91 function f() {}
92 delete f.name; 92 delete f.name;
93 assertEquals('Empty', f.name); 93 assertEquals('', f.name);
94 94
95 f.name = 42; 95 f.name = 42;
96 assertEquals('Empty', f.name); // non writable prototype property. 96 assertEquals('', f.name); // non writable prototype property.
97 assertFalse(f.hasOwnProperty('name')); 97 assertFalse(f.hasOwnProperty('name'));
98 98
99 Object.defineProperty(Function.prototype, 'name', {writable: true}); 99 Object.defineProperty(Function.prototype, 'name', {writable: true});
100 100
101 f.name = 123; 101 f.name = 123;
102 assertTrue(f.hasOwnProperty('name')); 102 assertTrue(f.hasOwnProperty('name'));
103 assertEquals(123, f.name); 103 assertEquals(123, f.name);
104 })(); 104 })();
105 105
106 106
107 (function testDelete() { 107 (function testDelete() {
108 function f() {} 108 function f() {}
109 assertTrue(delete f.name); 109 assertTrue(delete f.name);
110 assertFalse(f.hasOwnProperty('name')); 110 assertFalse(f.hasOwnProperty('name'));
111 assertEquals('Empty', f.name); 111 assertEquals('', f.name);
112 112
113 assertTrue(delete Function.prototype.name); 113 assertTrue(delete Function.prototype.name);
114 assertEquals(undefined, f.name); 114 assertEquals(undefined, f.name);
115 })(); 115 })();
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | test/mjsunit/es6/function-prototype-name.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698