[inspector] little better injected-script-source

We can call less getters on node objects.

R=dgozman@chromium.org

Bug: chromium:799791
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iecfe76c2be6b6bed675013ac4aaa117b714d4ba5
Reviewed-on: https://chromium-review.googlesource.com/854623
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50420}
This commit is contained in:
Alexey Kozyatinskiy 2018-01-08 14:30:52 -08:00 committed by Commit Bot
parent 40d6a6cfa0
commit 784e2f5e00

View File

@ -599,7 +599,8 @@ InjectedScript.prototype = {
description = (InjectedScriptHost.getProperty(constructor, "name") || "").toLowerCase();
}
switch (obj.nodeType) {
var nodeType = InjectedScriptHost.getProperty(obj, "nodeType");
switch (nodeType) {
case 1 /* Node.ELEMENT_NODE */:
var id = InjectedScriptHost.getProperty(obj, "id");
description += id ? "#" + id : "";