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

Side by Side Diff: src/messages.js

Issue 1164933005: Check for null and undefined when getting type name for stack trace. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | test/mjsunit/regress/regress-3718.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 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 $errorToString; 7 var $errorToString;
8 var $getStackTraceLine; 8 var $getStackTraceLine;
9 var $messageGetPositionInLine; 9 var $messageGetPositionInLine;
10 var $messageGetLineNumber; 10 var $messageGetLineNumber;
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 line = "<error>"; 842 line = "<error>";
843 } 843 }
844 } 844 }
845 lines.push(" at " + line); 845 lines.push(" at " + line);
846 } 846 }
847 return %_CallFunction(lines, "\n", ArrayJoin); 847 return %_CallFunction(lines, "\n", ArrayJoin);
848 } 848 }
849 849
850 850
851 function GetTypeName(receiver, requireConstructor) { 851 function GetTypeName(receiver, requireConstructor) {
852 if (IS_NULL_OR_UNDEFINED(receiver)) return null;
852 var constructor = receiver.constructor; 853 var constructor = receiver.constructor;
853 if (!constructor) { 854 if (!constructor) {
854 return requireConstructor ? null : 855 return requireConstructor ? null :
855 %_CallFunction(receiver, NoSideEffectsObjectToString); 856 %_CallFunction(receiver, NoSideEffectsObjectToString);
856 } 857 }
857 var constructorName = constructor.name; 858 var constructorName = constructor.name;
858 if (!constructorName) { 859 if (!constructorName) {
859 return requireConstructor ? null : 860 return requireConstructor ? null :
860 %_CallFunction(receiver, NoSideEffectsObjectToString); 861 %_CallFunction(receiver, NoSideEffectsObjectToString);
861 } 862 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 // Define accessors first, as this may fail and throw. 1083 // Define accessors first, as this may fail and throw.
1083 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, 1084 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter,
1084 set: StackTraceSetter, 1085 set: StackTraceSetter,
1085 configurable: true }); 1086 configurable: true });
1086 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); 1087 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace);
1087 }; 1088 };
1088 1089
1089 GlobalError.captureStackTrace = captureStackTrace; 1090 GlobalError.captureStackTrace = captureStackTrace;
1090 1091
1091 }); 1092 });
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3718.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698