Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index 87e7a7d0f95ed53f5c85350fa71b29c2cdb0ddcd..e2f51bbffbb6a753add8b0a76b4df0261d308747 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -1023,3 +1023,26 @@ TEST(GetConstructorName) { |
CHECK_EQ(0, StringCmp( |
"Object", i::V8HeapExplorer::GetConstructorName(*js_obj6))); |
} |
+ |
+TEST(FastCaseGetter) { |
+ v8::HandleScope scope; |
+ LocalContext env; |
+ |
+ CompileRun("var obj1 = {};\n" |
+ "obj1.__defineGetter__('propWithGetter', function Y() { return 42; });\n" |
mnaganov (inactive)
2011/11/11 22:47:46
80 chars
|
+ "obj1.__defineSetter__('propWithSetter', function Z(value) { return this.value_ = value; });\n"); |
+ const v8::HeapSnapshot* snapshot = |
+ v8::HeapProfiler::TakeSnapshot(v8_str("fastCaseGetter")); |
+ |
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
+ CHECK_NE(NULL, global); |
+ const v8::HeapGraphNode* obj1 = |
+ GetProperty(global, v8::HeapGraphEdge::kShortcut, "obj1"); |
+ CHECK_NE(NULL, obj1); |
+ const v8::HeapGraphNode* getterFunction = |
+ GetProperty(obj1, v8::HeapGraphEdge::kProperty, "get_propWithGetter"); |
+ CHECK_NE(NULL, getterFunction); |
+ const v8::HeapGraphNode* setterFunction = |
+ GetProperty(obj1, v8::HeapGraphEdge::kProperty, "set_propWithSetter"); |
+ CHECK_NE(NULL, setterFunction); |
+} |