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

Unified Diff: src/mirror-debugger.js

Issue 1126103006: Provide accessor for object internal properties that doesn't require debugger to be active (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/contexts.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index 9ea23d7122f955c92f69808f02e2885e8c5bd711..dbdc68e68f88e282a88737c26dd68ea6d631ce06 100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -904,57 +904,12 @@ ObjectMirror.prototype.toText = function() {
* @return {Array} array (possibly empty) of InternalProperty instances
*/
ObjectMirror.GetInternalProperties = function(value) {
- if (IS_STRING_WRAPPER(value) || IS_NUMBER_WRAPPER(value) ||
- IS_BOOLEAN_WRAPPER(value)) {
- var primitiveValue = %_ValueOf(value);
- return [new InternalPropertyMirror("[[PrimitiveValue]]", primitiveValue)];
- } else if (IS_FUNCTION(value)) {
- var bindings = %BoundFunctionGetBindings(value);
- var result = [];
- if (bindings && IS_ARRAY(bindings)) {
- result.push(new InternalPropertyMirror("[[TargetFunction]]",
- bindings[0]));
- result.push(new InternalPropertyMirror("[[BoundThis]]", bindings[1]));
- var boundArgs = [];
- for (var i = 2; i < bindings.length; i++) {
- boundArgs.push(bindings[i]);
- }
- result.push(new InternalPropertyMirror("[[BoundArgs]]", boundArgs));
- }
- return result;
- } else if (IS_MAP_ITERATOR(value) || IS_SET_ITERATOR(value)) {
- var details = IS_MAP_ITERATOR(value) ? %MapIteratorDetails(value)
- : %SetIteratorDetails(value);
- var kind;
- switch (details[2]) {
- case 1: kind = "keys"; break;
- case 2: kind = "values"; break;
- case 3: kind = "entries"; break;
- }
- var result = [
- new InternalPropertyMirror("[[IteratorHasMore]]", details[0]),
- new InternalPropertyMirror("[[IteratorIndex]]", details[1])
- ];
- if (kind) {
- result.push(new InternalPropertyMirror("[[IteratorKind]]", kind));
- }
- return result;
- } else if (IS_GENERATOR(value)) {
- return [
- new InternalPropertyMirror("[[GeneratorStatus]]",
- GeneratorGetStatus_(value)),
- new InternalPropertyMirror("[[GeneratorFunction]]",
- %GeneratorGetFunction(value)),
- new InternalPropertyMirror("[[GeneratorReceiver]]",
- %GeneratorGetReceiver(value))
- ];
- } else if (ObjectIsPromise(value)) {
- return [
- new InternalPropertyMirror("[[PromiseStatus]]", PromiseGetStatus_(value)),
- new InternalPropertyMirror("[[PromiseValue]]", PromiseGetValue_(value))
- ];
+ var properties = %DebugGetInternalProperties(value);
+ var result = [];
+ for (var i = 0; i < properties.length; i += 2) {
+ result.push(new InternalPropertyMirror(properties[i], properties[i + 1]));
}
- return [];
+ return result;
}
« no previous file with comments | « src/contexts.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698