| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 { | 542 { |
| 543 // NOTE: This list contains only not native Command Line API methods. Fo
r full list: V8Console. | 543 // NOTE: This list contains only not native Command Line API methods. Fo
r full list: V8Console. |
| 544 // NOTE: Argument names of these methods will be printed in the console,
so use pretty names! | 544 // NOTE: Argument names of these methods will be printed in the console,
so use pretty names! |
| 545 var members = [ "$", "$$", "$x", "monitorEvents", "unmonitorEvents", "ge
tEventListeners" ]; | 545 var members = [ "$", "$$", "$x", "monitorEvents", "unmonitorEvents", "ge
tEventListeners" ]; |
| 546 for (var member of members) | 546 for (var member of members) |
| 547 nativeCommandLineAPI[member] = CommandLineAPIImpl[member]; | 547 nativeCommandLineAPI[member] = CommandLineAPIImpl[member]; |
| 548 var functionToStringMap = new Map([ | 548 var functionToStringMap = new Map([ |
| 549 ["$", "function $(selector, [startNode]) { [Command Line AP
I] }"], | 549 ["$", "function $(selector, [startNode]) { [Command Line AP
I] }"], |
| 550 ["$$", "function $$(selector, [startNode]) { [Command Line A
PI] }"], | 550 ["$$", "function $$(selector, [startNode]) { [Command Line A
PI] }"], |
| 551 ["$x", "function $x(xpath, [startNode]) { [Command Line API]
}"], | 551 ["$x", "function $x(xpath, [startNode]) { [Command Line API]
}"], |
| 552 ["dir", "function dir(value) { [Command Line API] }"], | |
| 553 ["dirxml", "function dirxml(value) { [Command Line API] }"], | |
| 554 ["keys", "function keys(object) { [Command Line API] }"], | |
| 555 ["values", "function values(object) { [Command Line API] }"], | |
| 556 ["inspect", "function inspect(object) { [Command Line API] }"], | |
| 557 ["copy", "function copy(value) { [Command Line API] }"], | |
| 558 ["clear", "function clear() { [Command Line API] }"], | |
| 559 ["debug", "function debug(function) { [Command Line API] }"], | |
| 560 ["undebug", "function undebug(function) { [Command Line API] }"], | |
| 561 ["monitor", "function monitor(function) { [Command Line API] }"], | |
| 562 ["unmonitor", "function unmonitor(function) { [Command Line API] }"
], | |
| 563 ["table", "function table(data, [columns]) { [Command Line API]
}"], | |
| 564 ["profile", "function profile(title) { [Command Line API] }"], | |
| 565 ["profileEnd", "function profileEnd(title) { [Command Line API] }"], | |
| 566 ["monitorEvents", "function monitorEvents(object, [types]) { [Comm
and Line API] }"], | 552 ["monitorEvents", "function monitorEvents(object, [types]) { [Comm
and Line API] }"], |
| 567 ["unmonitorEvents", "function unmonitorEvents(object, [types]) { [Co
mmand Line API] }"], | 553 ["unmonitorEvents", "function unmonitorEvents(object, [types]) { [Co
mmand Line API] }"], |
| 568 ["getEventListeners", "function getEventListeners(node) { [Command L
ine API] }"] | 554 ["getEventListeners", "function getEventListeners(node) { [Command L
ine API] }"] |
| 569 ]); | 555 ]); |
| 570 for (let entry of functionToStringMap) | 556 for (let entry of functionToStringMap) |
| 571 nativeCommandLineAPI[entry[0]].toString = (() => entry[1]); | 557 nativeCommandLineAPI[entry[0]].toString = (() => entry[1]); |
| 572 return nativeCommandLineAPI; | 558 return nativeCommandLineAPI; |
| 573 }, | 559 }, |
| 574 | 560 |
| 575 /** | 561 /** |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 /** | 1243 /** |
| 1258 * @param {!Event} event | 1244 * @param {!Event} event |
| 1259 */ | 1245 */ |
| 1260 CommandLineAPIImpl._logEvent = function(event) | 1246 CommandLineAPIImpl._logEvent = function(event) |
| 1261 { | 1247 { |
| 1262 inspectedGlobalObject.console.log(event.type, event); | 1248 inspectedGlobalObject.console.log(event.type, event); |
| 1263 } | 1249 } |
| 1264 | 1250 |
| 1265 return injectedScript; | 1251 return injectedScript; |
| 1266 }) | 1252 }) |
| OLD | NEW |