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

Side by Side Diff: src/messages.js

Issue 919653002: [V8] Use Function.name in Error.stack (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/isolate.cc ('k') | src/objects.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // ------------------------------------------------------------------- 5 // -------------------------------------------------------------------
6 6
7 var kMessages = { 7 var kMessages = {
8 // Error 8 // Error
9 cyclic_proto: ["Cyclic __proto__ value"], 9 cyclic_proto: ["Cyclic __proto__ value"],
10 code_gen_from_strings: ["%0"], 10 code_gen_from_strings: ["%0"],
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 return script ? script.nameOrSourceURL() : null; 826 return script ? script.nameOrSourceURL() : null;
827 } 827 }
828 828
829 function CallSiteGetFunction() { 829 function CallSiteGetFunction() {
830 return GET_PRIVATE(this, CallSiteStrictModeKey) 830 return GET_PRIVATE(this, CallSiteStrictModeKey)
831 ? UNDEFINED : GET_PRIVATE(this, CallSiteFunctionKey); 831 ? UNDEFINED : GET_PRIVATE(this, CallSiteFunctionKey);
832 } 832 }
833 833
834 function CallSiteGetFunctionName() { 834 function CallSiteGetFunctionName() {
835 // See if the function knows its own name 835 // See if the function knows its own name
836 var name = GET_PRIVATE(this, CallSiteFunctionKey).name; 836 var fun = GET_PRIVATE(this, CallSiteFunctionKey);
837 if (name) { 837 var name = %FunctionGetDebugName(fun);
838 return name;
839 }
840 name = %FunctionGetInferredName(GET_PRIVATE(this, CallSiteFunctionKey));
841 if (name) { 838 if (name) {
842 return name; 839 return name;
843 } 840 }
844 // Maybe this is an evaluation? 841 // Maybe this is an evaluation?
845 var script = %FunctionGetScript(GET_PRIVATE(this, CallSiteFunctionKey)); 842 var script = %FunctionGetScript(fun);
846 if (script && script.compilation_type == COMPILATION_TYPE_EVAL) { 843 if (script && script.compilation_type == COMPILATION_TYPE_EVAL) {
847 return "eval"; 844 return "eval";
848 } 845 }
849 return null; 846 return null;
850 } 847 }
851 848
852 function CallSiteGetMethodName() { 849 function CallSiteGetMethodName() {
853 // See if we can find a unique property on the receiver that holds 850 // See if we can find a unique property on the receiver that holds
854 // this function. 851 // this function.
855 var receiver = GET_PRIVATE(this, CallSiteReceiverKey); 852 var receiver = GET_PRIVATE(this, CallSiteReceiverKey);
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 function SetUpStackOverflowBoilerplate() { 1320 function SetUpStackOverflowBoilerplate() {
1324 var boilerplate = MakeRangeError('stack_overflow', []); 1321 var boilerplate = MakeRangeError('stack_overflow', []);
1325 1322
1326 %DefineAccessorPropertyUnchecked( 1323 %DefineAccessorPropertyUnchecked(
1327 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); 1324 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM);
1328 1325
1329 return boilerplate; 1326 return boilerplate;
1330 } 1327 }
1331 1328
1332 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); 1329 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate();
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698