Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 825 return script ? script.nameOrSourceURL() : null; | 825 return script ? script.nameOrSourceURL() : null; |
| 826 } | 826 } |
| 827 | 827 |
| 828 function CallSiteGetFunction() { | 828 function CallSiteGetFunction() { |
| 829 return GET_PRIVATE(this, CallSiteStrictModeKey) | 829 return GET_PRIVATE(this, CallSiteStrictModeKey) |
| 830 ? UNDEFINED : GET_PRIVATE(this, CallSiteFunctionKey); | 830 ? UNDEFINED : GET_PRIVATE(this, CallSiteFunctionKey); |
| 831 } | 831 } |
| 832 | 832 |
| 833 function CallSiteGetFunctionName() { | 833 function CallSiteGetFunctionName() { |
| 834 // See if the function knows its own name | 834 // See if the function knows its own name |
| 835 var name = GET_PRIVATE(this, CallSiteFunctionKey).name; | 835 var fun = GET_PRIVATE(this, CallSiteFunctionKey); |
| 836 if (name) { | 836 var name = %GetDataProperty(fun, 'name'); |
| 837 if (IS_STRING(name)) { | |
|
yurys
2015/03/06 11:11:26
Is it supposed to return in case of empty string?
kozy
2015/03/06 12:49:59
If user set empty function name then we show this
| |
| 837 return name; | 838 return name; |
| 838 } | 839 } |
| 839 name = %FunctionGetInferredName(GET_PRIVATE(this, CallSiteFunctionKey)); | 840 name = %FunctionGetDebugName(fun); |
| 840 if (name) { | 841 if (name) { |
| 841 return name; | 842 return name; |
| 842 } | 843 } |
| 843 // Maybe this is an evaluation? | 844 // Maybe this is an evaluation? |
| 844 var script = %FunctionGetScript(GET_PRIVATE(this, CallSiteFunctionKey)); | 845 var script = %FunctionGetScript(fun); |
| 845 if (script && script.compilation_type == COMPILATION_TYPE_EVAL) { | 846 if (script && script.compilation_type == COMPILATION_TYPE_EVAL) { |
| 846 return "eval"; | 847 return "eval"; |
| 847 } | 848 } |
| 848 return null; | 849 return null; |
| 849 } | 850 } |
| 850 | 851 |
| 851 function CallSiteGetMethodName() { | 852 function CallSiteGetMethodName() { |
| 852 // See if we can find a unique property on the receiver that holds | 853 // See if we can find a unique property on the receiver that holds |
| 853 // this function. | 854 // this function. |
| 854 var receiver = GET_PRIVATE(this, CallSiteReceiverKey); | 855 var receiver = GET_PRIVATE(this, CallSiteReceiverKey); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1322 function SetUpStackOverflowBoilerplate() { | 1323 function SetUpStackOverflowBoilerplate() { |
| 1323 var boilerplate = MakeRangeError('stack_overflow', []); | 1324 var boilerplate = MakeRangeError('stack_overflow', []); |
| 1324 | 1325 |
| 1325 %DefineAccessorPropertyUnchecked( | 1326 %DefineAccessorPropertyUnchecked( |
| 1326 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1327 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
| 1327 | 1328 |
| 1328 return boilerplate; | 1329 return boilerplate; |
| 1329 } | 1330 } |
| 1330 | 1331 |
| 1331 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1332 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
| OLD | NEW |