OLD | NEW |
---|---|
1 // Copyright 2006-2012 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 // Handle id counters. | 5 // Handle id counters. |
6 var next_handle_ = 0; | 6 var next_handle_ = 0; |
7 var next_transient_handle_ = -1; | 7 var next_transient_handle_ = -1; |
8 | 8 |
9 // Mirror cache. | 9 // Mirror cache. |
10 var mirror_cache_ = []; | 10 var mirror_cache_ = []; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 // Different attributes for a property. | 188 // Different attributes for a property. |
189 var PropertyAttribute = {}; | 189 var PropertyAttribute = {}; |
190 PropertyAttribute.None = NONE; | 190 PropertyAttribute.None = NONE; |
191 PropertyAttribute.ReadOnly = READ_ONLY; | 191 PropertyAttribute.ReadOnly = READ_ONLY; |
192 PropertyAttribute.DontEnum = DONT_ENUM; | 192 PropertyAttribute.DontEnum = DONT_ENUM; |
193 PropertyAttribute.DontDelete = DONT_DELETE; | 193 PropertyAttribute.DontDelete = DONT_DELETE; |
194 | 194 |
195 | 195 |
196 // A copy of the scope types from runtime.cc. | 196 // A copy of the scope types from runtime.cc. |
197 var ScopeType = { Global: 0, | 197 var ScopeType = { Global: 0, |
198 Local: 1, | 198 Script: 1, |
yurys
2014/11/14 12:25:32
This will break DevTools code as we rely on these
aandrey
2014/11/14 12:35:22
Can you add the new scope at the end. Our code dep
Dmitry Lomov (no reviews)
2014/11/14 13:56:51
Done.
| |
199 With: 2, | 199 Local: 2, |
200 Closure: 3, | 200 With: 3, |
201 Catch: 4, | 201 Closure: 4, |
202 Block: 5 }; | 202 Catch: 5, |
203 Block: 6 }; | |
203 | 204 |
204 | 205 |
205 // Mirror hierarchy: | 206 // Mirror hierarchy: |
206 // - Mirror | 207 // - Mirror |
207 // - ValueMirror | 208 // - ValueMirror |
208 // - UndefinedMirror | 209 // - UndefinedMirror |
209 // - NullMirror | 210 // - NullMirror |
210 // - NumberMirror | 211 // - NumberMirror |
211 // - StringMirror | 212 // - StringMirror |
212 // - SymbolMirror | 213 // - SymbolMirror |
(...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2286 return this.scope_index_; | 2287 return this.scope_index_; |
2287 }; | 2288 }; |
2288 | 2289 |
2289 | 2290 |
2290 ScopeMirror.prototype.scopeType = function() { | 2291 ScopeMirror.prototype.scopeType = function() { |
2291 return this.details_.type(); | 2292 return this.details_.type(); |
2292 }; | 2293 }; |
2293 | 2294 |
2294 | 2295 |
2295 ScopeMirror.prototype.scopeObject = function() { | 2296 ScopeMirror.prototype.scopeObject = function() { |
2296 // For local and closure scopes create a transient mirror as these objects are | 2297 // For local, closure and script scopes create a transient mirror |
2297 // created on the fly materializing the local or closure scopes and | 2298 // as these objects are created on the fly materializing the local |
2298 // therefore will not preserve identity. | 2299 // or closure scopes and therefore will not preserve identity. |
2299 var transient = this.scopeType() == ScopeType.Local || | 2300 var transient = this.scopeType() == ScopeType.Local || |
2300 this.scopeType() == ScopeType.Closure; | 2301 this.scopeType() == ScopeType.Closure || |
2302 this.scopeType() == ScopeType.Script; | |
2301 return MakeMirror(this.details_.object(), transient); | 2303 return MakeMirror(this.details_.object(), transient); |
2302 }; | 2304 }; |
2303 | 2305 |
2304 | 2306 |
2305 ScopeMirror.prototype.setVariableValue = function(name, new_value) { | 2307 ScopeMirror.prototype.setVariableValue = function(name, new_value) { |
2306 this.details_.setVariableValueImpl(name, new_value); | 2308 this.details_.setVariableValueImpl(name, new_value); |
2307 }; | 2309 }; |
2308 | 2310 |
2309 | 2311 |
2310 /** | 2312 /** |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3014 } | 3016 } |
3015 if (!NUMBER_IS_FINITE(value)) { | 3017 if (!NUMBER_IS_FINITE(value)) { |
3016 if (value > 0) { | 3018 if (value > 0) { |
3017 return 'Infinity'; | 3019 return 'Infinity'; |
3018 } else { | 3020 } else { |
3019 return '-Infinity'; | 3021 return '-Infinity'; |
3020 } | 3022 } |
3021 } | 3023 } |
3022 return value; | 3024 return value; |
3023 } | 3025 } |
OLD | NEW |