}
-function GetLoadedScripts() {
- ClearMirrorCache(); // The mirror cache may be holding onto scripts.
- return %DebugGetLoadedScripts();
-}
-
-
Debug.setListener = function(listener, opt_data) {
if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) {
throw new Error('Parameters have wrong types.');
// scanning the heap.
Debug.scripts = function() {
// Collect all scripts in the heap.
- return GetLoadedScripts();
+ return %DebugGetLoadedScripts();
};
}
// Collect all scripts in the heap.
- var scripts = GetLoadedScripts();
+ var scripts = %DebugGetLoadedScripts();
response.body = [];
var script_id = request.arguments.script_id;
var preview_only = !!request.arguments.preview_only;
- var scripts = GetLoadedScripts();
+ var scripts = %DebugGetLoadedScripts();
var the_script = null;
for (var i = 0; i < scripts.length; i++) {
}
-/**
- * Clear the mirror handle cache.
- */
-function ClearMirrorCache() {
- next_handle_ = 0;
- mirror_cache_ = [];
-}
-
-
// Wrapper to check whether an object is a Promise. The call may not work
// if promises are not enabled.
// TODO(yangguo): remove try-catch once promises are enabled by default.
json = '{"seq":0,"type":"request","command":"backtrace"}'
dcp.processDebugJSONRequest(json);
+ // Make sure looking up loaded scripts does not clear the cache.
+ Debug.scripts();
+
// Some mirrors where cached.
assertFalse(debug.next_handle_ == 0, "Mirror cache not used");
assertFalse(debug.mirror_cache_.length == 0, "Mirror cache not used");
EXPECTED_FUZZABLE_COUNT = 325
EXPECTED_CCTEST_COUNT = 6
EXPECTED_UNKNOWN_COUNT = 5
-EXPECTED_BUILTINS_COUNT = 798
+EXPECTED_BUILTINS_COUNT = 796
# Don't call these at all.