1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 09:59:48 +02:00

Use optional argument in memoize-util benchmark

This commit is contained in:
Soreine
2016-11-02 17:23:30 +01:00
parent 85ebf7fffa
commit a4460354c6
2 changed files with 3 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ const { default: memoize } = require('../../../lib/utils/memoize')
module.exports = {
setup(state) {
let obj = {
fibonacci(n) {
fibonacci(n = 20) {
if (n === 0 || n === 1) {
return n
} else {
@@ -17,6 +17,6 @@ module.exports = {
},
run(obj) {
obj.fibonacci(20)
obj.fibonacci()
}
}

View File

@@ -179,6 +179,7 @@ const Node = {
/**
* Recursively filter all descendant nodes with `iterator`, depth-first.
* It is different from `filterDescendants` in regard of the order of results.
*
* @param {Function} iterator
* @return {List} nodes