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

Side by Side Diff: test/inspector/runtime/function-inferred-names.js

Issue 2488193003: Generate inferred names for es6 class functions (Closed)
Patch Set: fix test expectation Created 4 years, 1 month 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/parser.cc ('k') | test/inspector/runtime/function-inferred-names-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 print("Tests that creating instances from classes and functions will have the co rrect inferred name.");
6
7 var functionKeywordInstance = "var f1 = function(){}; var o1 = new f1();";
8 var namespacedFunctionInstance = "var obj = {}; obj.functionClass = function(){} ; var o2 = new obj.functionClass()";
9 var classKeywordInstance = "var f2 = class(){}; var o3 = new f2();";
10 var namespacedClassInstance = "obj.classClass = class(){}; var o4 = new obj.clas sClass()";
11
marja 2016/11/14 19:40:07 What's up with this duplication? What are these st
luoe 2016/11/14 19:51:37 My fault here, I thought I removed these duplicate
12 Protocol.Runtime.enable();
13
14 InspectorTest.runTestSuite([
15 function functionKeywordInstance(next) {
16 Protocol.Runtime.evaluate({ expression: "var f1 = function(){}; new f1();" } ).then(dumpResults).then(next);
17 },
18 function namespacedFunctionInstance(next) {
19 Protocol.Runtime.evaluate({ expression: "var obj = {}; obj.functionClass = f unction(){}; new obj.functionClass()" }).then(dumpResults).then(next);
20 },
21 function classKeywordInstance(next) {
22 Protocol.Runtime.evaluate({ expression: "var f2 = class{}; new f2();" }).the n(dumpResults).then(next);
23 },
24 function namespacedClassInstance(next) {
25 Protocol.Runtime.evaluate({ expression: "var obj = {}; obj.classClass = clas s{}; new obj.classClass()" }).then(dumpResults).then(next);
26 },
27
28 ]);
29
30 function dumpResults(response) {
31 InspectorTest.log(response.result.result.className);
32 }
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | test/inspector/runtime/function-inferred-names-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698