diff options
| author | mrmr1993 | 2017-10-29 12:51:53 +0000 |
|---|---|---|
| committer | mrmr1993 | 2017-10-29 12:51:53 +0000 |
| commit | 24148c709806d1631f35cd8efd3fdec4f2376f92 (patch) | |
| tree | fd96638b8be4c57b25ebabfe35214fcb7f379b5b | |
| parent | 3abee4d80699c1fade78af951efd23c1297d0be3 (diff) | |
| download | vimium-24148c709806d1631f35cd8efd3fdec4f2376f92.tar.bz2 | |
Guard against undefined DomUtils, instead of stubbing in tests
| -rw-r--r-- | content_scripts/mode_normal.coffee | 2 | ||||
| -rw-r--r-- | tests/unit_tests/commands_test.coffee | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/content_scripts/mode_normal.coffee b/content_scripts/mode_normal.coffee index 8dad4b63..ee05f4b0 100644 --- a/content_scripts/mode_normal.coffee +++ b/content_scripts/mode_normal.coffee @@ -214,7 +214,7 @@ textInputXPath = (-> "(" + textInputTypes.map((type) -> '@type="' + type + '"').join(" or ") + "or not(@type))" + " and not(@disabled or @readonly)]", "textarea", "*[@contenteditable='' or translate(@contenteditable, 'TRUE', 'true')='true']"] - DomUtils.makeXPath(inputElements) + DomUtils?.makeXPath(inputElements) )() # used by the findAndFollow* functions. diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee index fcc7b821..49dd2570 100644 --- a/tests/unit_tests/commands_test.coffee +++ b/tests/unit_tests/commands_test.coffee @@ -6,7 +6,6 @@ global.Settings = {postUpdateHooks: {}, get: (-> ""), set: ->} # Include mode_normal to check that all commands have been implemented. global.KeyHandlerMode = global.Mode = {} -global.DomUtils = {makeXPath: ->} global.KeyboardUtils = {platform: ""} extend global, require "../../content_scripts/link_hints.js" extend global, require "../../content_scripts/marks.js" |
