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

Side by Side Diff: Source/bindings/v8/DebuggerScript.js

Issue 13575004: Apply script preprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: move clearScriptPreprocessor() to ScriptController::clearWindowShell Created 7 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 return numbers; 295 return numbers;
296 296
297 for (var i = 0; i < breakpoints.length; i++) { 297 for (var i = 0; i < breakpoints.length; i++) {
298 var breakpoint = breakpoints[i]; 298 var breakpoint = breakpoints[i];
299 var scriptBreakPoint = breakpoint.script_break_point(); 299 var scriptBreakPoint = breakpoint.script_break_point();
300 numbers.push(scriptBreakPoint ? scriptBreakPoint.number() : breakpoint.n umber()); 300 numbers.push(scriptBreakPoint ? scriptBreakPoint.number() : breakpoint.n umber());
301 } 301 }
302 return numbers; 302 return numbers;
303 } 303 }
304 304
305 // Matched enum in V8 objects.h
306 DebuggerScript.ScriptCompilationType = {
307 Host: 0,
308 Eval: 1,
309 JSON: 2
310 };
311
312 DebuggerScript._getScriptCompilationTypeInfo = function(script)
313 {
314 var result = "";
315 var fromScript = script.evalFromScript();
316 if (script.compilationType() == DebuggerScript.ScriptCompilationType.Eval && fromScript) {
317 result += 'eval from ';
318 if (fromScript.compilationType() == DebuggerScript.ScriptCompilationType .Eval) {
319 result += DebuggerScript._getScriptCompilationTypeInfo(fromScript);
320 } else {
321 var name = fromScript.name();
322 if (name) {
323 var location = script.evalFromLocation();
324 result += name + (location ? ':' + (location.line + 1) + ':' + ( location.column + 1) : '');
325 } else {
326 result += '(unknown source)';
327 }
328 }
329 return result;
330 } else if (script.compilationType() == Debug.ScriptCompilationType.JSON) {
331 result += 'JSON ';
332 } else { // script.compilation == Debug.ScriptCompilationType.Host
333 result += '[unnamed] ';
334 }
335 return result || 'Failed to extract info';
336 }
337
338 DebuggerScript.getScriptCompilationTypeInfo = function(eventData)
339 {
340 try {
341 var script = eventData.script();
342 return DebuggerScript._getScriptCompilationTypeInfo(script);
343 } catch (exc) {
344 return exc + '';
345 }
346 }
347
305 DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame) 348 DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
306 { 349 {
307 // Get function name. 350 // Get function name.
308 var func; 351 var func;
309 try { 352 try {
310 func = frameMirror.func(); 353 func = frameMirror.func();
311 } catch(e) { 354 } catch(e) {
312 } 355 }
313 var functionName; 356 var functionName;
314 if (func) 357 if (func)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 break; 433 break;
391 case ScopeType.Block: 434 case ScopeType.Block:
392 // Unsupported yet. Mustn't be reachable. 435 // Unsupported yet. Mustn't be reachable.
393 break; 436 break;
394 } 437 }
395 return scopeObject; 438 return scopeObject;
396 } 439 }
397 440
398 return DebuggerScript; 441 return DebuggerScript;
399 })(); 442 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698