Commit acddfb66 authored by Juan Corona's avatar Juan Corona

Fix the scoping of the initial value for the `plugins` property

This fixes the remaining failing tests.
When compiled from coffeescript the initial `{}` value was at the prototype level instead of scoped at the function level.
It looked like I was declaring it as an instance variable, but it was more like a class variable.. coffeescript is weird to me..
parent 77271a90
...@@ -48,6 +48,7 @@ module.exports = class Guest extends Delegator ...@@ -48,6 +48,7 @@ module.exports = class Guest extends Delegator
anchoring: require('./anchoring/html') anchoring: require('./anchoring/html')
# Internal state # Internal state
plugins: null
anchors: null anchors: null
visibleHighlights: false visibleHighlights: false
...@@ -55,8 +56,6 @@ module.exports = class Guest extends Delegator ...@@ -55,8 +56,6 @@ module.exports = class Guest extends Delegator
adder: '<hypothesis-adder></hypothesis-adder>' adder: '<hypothesis-adder></hypothesis-adder>'
wrapper: '<div class="annotator-wrapper"></div>' wrapper: '<div class="annotator-wrapper"></div>'
plugins: {}
addPlugin: (name, options) -> addPlugin: (name, options) ->
if @plugins[name] if @plugins[name]
console.error("You cannot have more than one instance of any plugin.") console.error("You cannot have more than one instance of any plugin.")
...@@ -92,6 +91,7 @@ module.exports = class Guest extends Delegator ...@@ -92,6 +91,7 @@ module.exports = class Guest extends Delegator
else else
self._onClearSelection() self._onClearSelection()
this.plugins = {}
this.anchors = [] this.anchors = []
cfOptions = cfOptions =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment