OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 if (!constructor) return false; | 932 if (!constructor) return false; |
933 return GET_PRIVATE(this, CallSiteFunctionKey) === constructor; | 933 return GET_PRIVATE(this, CallSiteFunctionKey) === constructor; |
934 } | 934 } |
935 | 935 |
936 function CallSiteToString() { | 936 function CallSiteToString() { |
937 var fileName; | 937 var fileName; |
938 var fileLocation = ""; | 938 var fileLocation = ""; |
939 if (this.isNative()) { | 939 if (this.isNative()) { |
940 fileLocation = "native"; | 940 fileLocation = "native"; |
941 } else { | 941 } else { |
942 if (this.isEval()) { | 942 fileName = this.getScriptNameOrSourceURL(); |
943 fileName = this.getScriptNameOrSourceURL(); | 943 if (!fileName && this.isEval()) { |
944 if (!fileName) { | 944 fileLocation = this.getEvalOrigin(); |
945 fileLocation = this.getEvalOrigin(); | 945 fileLocation += ", "; // Expecting source position to follow. |
946 fileLocation += ", "; // Expecting source position to follow. | |
947 } | |
948 } else { | |
949 fileName = this.getFileName(); | |
950 } | 946 } |
951 | 947 |
952 if (fileName) { | 948 if (fileName) { |
953 fileLocation += fileName; | 949 fileLocation += fileName; |
954 } else { | 950 } else { |
955 // Source code does not originate from a file and is not native, but we | 951 // Source code does not originate from a file and is not native, but we |
956 // can still get the source position inside the source string, e.g. in | 952 // can still get the source position inside the source string, e.g. in |
957 // an eval string. | 953 // an eval string. |
958 fileLocation += "<anonymous>"; | 954 fileLocation += "<anonymous>"; |
959 } | 955 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 %GetAndClearOverflowedStackTrace(this); | 1346 %GetAndClearOverflowedStackTrace(this); |
1351 }; | 1347 }; |
1352 | 1348 |
1353 %DefineOrRedefineAccessorProperty( | 1349 %DefineOrRedefineAccessorProperty( |
1354 boilerplate, 'stack', getter, setter, DONT_ENUM); | 1350 boilerplate, 'stack', getter, setter, DONT_ENUM); |
1355 | 1351 |
1356 return boilerplate; | 1352 return boilerplate; |
1357 } | 1353 } |
1358 | 1354 |
1359 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1355 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
OLD | NEW |