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

Unified Diff: chrome/test/chromedriver/js/call_function.js

Issue 2620803002: [chromedriver] Use nodeType instead of instanceof. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/js/call_function.js
diff --git a/chrome/test/chromedriver/js/call_function.js b/chrome/test/chromedriver/js/call_function.js
index 6dee10578534cd64d5db4425d75241e6605d61ec..d79e70d8a8e578788dbf16ddea6363fc5d369bb1 100644
--- a/chrome/test/chromedriver/js/call_function.js
+++ b/chrome/test/chromedriver/js/call_function.js
@@ -260,7 +260,8 @@ function wrap(value) {
// frames[0].document.body instanceof Object == false even though
// typeof(frames[0].document.body) == 'object'.
if ((typeof(value) == 'object' && value != null) ||
- (typeof(value) == 'function' && value instanceof Element)) {
+ (typeof(value) == 'function' && value.nodeName &&
+ value.nodeType == Node.ELEMENT_NODE)) {
PhistucK 2017/01/13 09:15:40 For consistency, I think you should use the above
samuong 2017/01/13 18:26:42 Sounds reasonable, I've created https://codereview
var nodeType = value['nodeType'];
if (nodeType == NodeType.ELEMENT || nodeType == NodeType.DOCUMENT
|| (SHADOW_DOM_ENABLED && value instanceof ShadowRoot)) {
« no previous file with comments | « no previous file | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698