Skip to content

Commit

Permalink
fix: require cache param
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 3, 2021
1 parent 8f4a87d commit 69c7354
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/dom-styles-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export default class DOMStylesReader {
* to build
* @param {string} property the name of the style property to compute
* @param {Node} targetNode
* @param {boolean} [cache=true] whether to cache the computed value or not
* @param {boolean} cache whether to cache the computed value or not
* @return {string} the computed property's value
* used in CanvasDrawer
*/
retrieveStyleFromDom (scopes, property, targetNode, cache = true) {
retrieveStyleFromDom (scopes, property, targetNode, cache) {
const key = scopes.join(' ')
let cachedData = this.domStylesCache.get(key)

Expand Down
4 changes: 2 additions & 2 deletions spec/minimap-element-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ describe('MinimapElement', () => {
})
runs(() => {
nextAnimationFrame()
expect(minimapElement.DOMStylesReader.retrieveStyleFromDom(['.editor'], 'color'), minimapElement.minimap.getTextEditorElement()).toEqual(`rgb(0, ${0x6d}, ${0x6d})`)
expect(minimapElement.DOMStylesReader.retrieveStyleFromDom(['.editor'], 'color', minimapElement.minimap.getTextEditorElement(), true)).toEqual(`rgb(0, ${0x6d}, ${0x6d})`)
})
})
})
Expand Down Expand Up @@ -261,7 +261,7 @@ describe('MinimapElement', () => {
})
runs(() => {
nextAnimationFrame()
expect(minimapElement.DOMStylesReader.retrieveStyleFromDom(['.editor'], 'color'), minimapElement.minimap.getTextEditorElement()).toEqual(`rgba(0, ${0x6d}, ${0x6d}, 0)`)
expect(minimapElement.DOMStylesReader.retrieveStyleFromDom(['.editor'], 'color', minimapElement.minimap.getTextEditorElement(), true)).toEqual(`rgba(0, ${0x6d}, ${0x6d}, 0)`)
})
})
})
Expand Down

0 comments on commit 69c7354

Please sign in to comment.