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

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

Issue 1582783004: [es6] add SetFunctionName() behaviour to AssignmentExpression (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/parsing/preparser.h ('k') | no next file » | 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 // Flags: --harmony-function-name 5 // Flags: --harmony-function-name
6 6
7 (function testVariableDeclarationsFunction() { 7 (function testVariableDeclarationsFunction() {
8 'use strict'; 8 'use strict';
9 var a = function(){}; 9 var a = function(){};
10 assertEquals('a', a.name); 10 assertEquals('a', a.name);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 static [sym2]() { } 113 static [sym2]() { }
114 } 114 }
115 115
116 // Should be 'a' 116 // Should be 'a'
117 assertEquals('', C.prototype[a].name); 117 assertEquals('', C.prototype[a].name);
118 // Should be '[1]' 118 // Should be '[1]'
119 assertEquals('', C.prototype[sym1].name); 119 assertEquals('', C.prototype[sym1].name);
120 // Should be '[2]' 120 // Should be '[2]'
121 assertEquals('', C[sym2].name); 121 assertEquals('', C[sym2].name);
122 })(); 122 })();
123
124
125 (function testAssignment() {
126 var basicFn, arrowFn, generatorFn, classLit;
127
128 basicFn = function() { return true; };
adamk 2016/01/13 22:45:09 Please also add a case where the function has a na
caitp (gmail) 2016/01/13 22:53:46 Done.
129 assertEquals('basicFn', basicFn.name);
130 var basicFn2 = basicFn;
131 assertEquals('basicFn', basicFn2.name);
132
133 arrowFn = x => x;
134 assertEquals('arrowFn', arrowFn.name);
135 var arrowFn2 = arrowFn;
136 assertEquals('arrowFn', arrowFn2.name);
137
138 generatorFn = function*() { yield true; };
139 assertEquals('generatorFn', generatorFn.name);
140 var generatorFn2 = generatorFn;
141 assertEquals('generatorFn', generatorFn2.name);
142
143 classLit = class { constructor() {} };
adamk 2016/01/13 22:45:09 Can you also add a case where the class is named,
caitp (gmail) 2016/01/13 22:53:46 Done.
144 assertEquals('classLit', classLit.name);
145 var classLit2 = classLit;
146 assertEquals('classLit', classLit2.name);
147 })();
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698