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 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 // Check for legal arguments. | 2136 // Check for legal arguments. |
2137 if (!IS_UNDEFINED(frame) && global) { | 2137 if (!IS_UNDEFINED(frame) && global) { |
2138 return response.failed('Arguments "frame" and "global" are exclusive'); | 2138 return response.failed('Arguments "frame" and "global" are exclusive'); |
2139 } | 2139 } |
2140 | 2140 |
2141 var additional_context_object; | 2141 var additional_context_object; |
2142 if (additional_context) { | 2142 if (additional_context) { |
2143 additional_context_object = {}; | 2143 additional_context_object = {}; |
2144 for (var i = 0; i < additional_context.length; i++) { | 2144 for (var i = 0; i < additional_context.length; i++) { |
2145 var mapping = additional_context[i]; | 2145 var mapping = additional_context[i]; |
2146 if (!IS_STRING(mapping.name) || !IS_NUMBER(mapping.handle)) { | 2146 |
| 2147 if (!IS_STRING(mapping.name)) { |
2147 return response.failed("Context element #" + i + | 2148 return response.failed("Context element #" + i + |
2148 " must contain name:string and handle:number"); | 2149 " doesn't contain name:string property"); |
2149 } | 2150 } |
2150 var context_value_mirror = LookupMirror(mapping.handle); | 2151 |
2151 if (!context_value_mirror) { | 2152 var raw_value = DebugCommandProcessor.resolveValue_(mapping); |
2152 return response.failed("Context object '" + mapping.name + | 2153 additional_context_object[mapping.name] = raw_value; |
2153 "' #" + mapping.handle + "# not found"); | |
2154 } | |
2155 additional_context_object[mapping.name] = context_value_mirror.value(); | |
2156 } | 2154 } |
2157 } | 2155 } |
2158 | 2156 |
2159 // Global evaluate. | 2157 // Global evaluate. |
2160 if (global) { | 2158 if (global) { |
2161 // Evaluate in the native context. | 2159 // Evaluate in the native context. |
2162 response.body = this.exec_state_.evaluateGlobal( | 2160 response.body = this.exec_state_.evaluateGlobal( |
2163 expression, Boolean(disable_break), additional_context_object); | 2161 expression, Boolean(disable_break), additional_context_object); |
2164 return; | 2162 return; |
2165 } | 2163 } |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2749 | 2747 |
2750 default: | 2748 default: |
2751 json = null; | 2749 json = null; |
2752 } | 2750 } |
2753 return json; | 2751 return json; |
2754 } | 2752 } |
2755 | 2753 |
2756 Debug.TestApi = { | 2754 Debug.TestApi = { |
2757 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ | 2755 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ |
2758 }; | 2756 }; |
OLD | NEW |