diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-04 22:04:54 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-04 22:04:54 +0100 |
commit | edc9454ddf9a0fc29a81713b98e15ddfded04bf4 (patch) | |
tree | 987002f50e52edef9e9ff66ddd1c8b41aba6e254 /src | |
parent | d654ab010adf42aab757529b6c09f27215740b27 (diff) | |
download | svg.js-edc9454ddf9a0fc29a81713b98e15ddfded04bf4.tar.gz svg.js-edc9454ddf9a0fc29a81713b98e15ddfded04bf4.zip |
forgot about memory tests
Diffstat (limited to 'src')
-rw-r--r-- | src/PathArray.js | 4 | ||||
-rw-r--r-- | src/PointArray.js | 4 | ||||
-rw-r--r-- | src/SVGArray.js | 4 | ||||
-rw-r--r-- | src/memory.js | 14 | ||||
-rw-r--r-- | src/svg.js | 2 | ||||
-rw-r--r-- | src/tools.js | 12 |
6 files changed, 14 insertions, 26 deletions
diff --git a/src/PathArray.js b/src/PathArray.js index b05bd92..8529bf9 100644 --- a/src/PathArray.js +++ b/src/PathArray.js @@ -4,7 +4,7 @@ import {numbersWithDots, pathLetters, hyphen, delimiter, isPathLetter} from './r import Point from './Point.js' import SVGArray from './SVGArray.js' import {subClassArray} from './ArrayPolyfill.js' -import {extend2} from './tools.js' +import {extend} from './tools.js' const PathArray = subClassArray('PathArray', SVGArray) @@ -84,7 +84,7 @@ for (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) { } -extend2(PathArray, { +extend(PathArray, { // Convert array to string toString () { return arrayToString(this) diff --git a/src/PointArray.js b/src/PointArray.js index a291054..1bf5460 100644 --- a/src/PointArray.js +++ b/src/PointArray.js @@ -1,13 +1,13 @@ import SVGArray from './SVGArray.js' import {delimiter} from './regex.js' import {subClassArray} from './ArrayPolyfill.js' -import {extend2} from './tools.js' +import {extend} from './tools.js' const PointArray = subClassArray('PointArray', SVGArray) export default PointArray -extend2(PointArray, { +extend(PointArray, { // Convert array to string toString () { // convert to a poly point string diff --git a/src/SVGArray.js b/src/SVGArray.js index 5927945..a442aad 100644 --- a/src/SVGArray.js +++ b/src/SVGArray.js @@ -1,7 +1,7 @@ /* global arrayClone */ import {delimiter} from './regex.js' import {subClassArray} from './ArrayPolyfill.js' -import {extend2} from './tools.js' +import {extend} from './tools.js' const SVGArray = subClassArray('SVGArray', Array, function (...args) { this.init(...args) @@ -9,7 +9,7 @@ const SVGArray = subClassArray('SVGArray', Array, function (...args) { export default SVGArray -extend2(SVGArray, { +extend(SVGArray, { init (...args) { //this.splice(0, this.length) this.length = 0 diff --git a/src/memory.js b/src/memory.js index 9850881..77d3518 100644 --- a/src/memory.js +++ b/src/memory.js @@ -1,11 +1,11 @@ import {registerMethods} from './methods.js' import {registerConstructor} from './methods.js' -export const name = 'Memory' - -export function setup (node) { - this._memory = {} -} +// export const name = 'Memory' +// +// export function setup (node) { +// this._memory = {} +// } // Remember arbitrary data export function remember (k, v) { @@ -39,8 +39,8 @@ export function forget () { // return local memory object export function memory () { - return this._memory + return (this._memory = this._memory || {}) } registerMethods('Element', {remember, forget, memory}) -registerConstructor('Memory', setup) +//registerConstructor('Memory', setup) @@ -61,7 +61,7 @@ extend([ extend(Classes.EventTarget, getMethodsFor('EventTarget')) extend(Classes.Element, getMethodsFor('Element')) extend(Classes.Element, getMethodsFor('Parent')) -extend(Classes.Element, getConstructor('Memory')) +//extend(Classes.Element, getConstructor('Memory')) extend(Classes.Container, getMethodsFor('Container')) registerMorphableType([ diff --git a/src/tools.js b/src/tools.js index d33566a..898f016 100644 --- a/src/tools.js +++ b/src/tools.js @@ -24,18 +24,6 @@ export function extend (modules, methods) { } } -export function extend2 (modules, methods) { - var key, i - - modules = Array.isArray(modules) ? modules : [modules] - - for (i = modules.length - 1; i >= 0; i--) { - for (key in methods) { - modules[i].prototype[key] = methods[key] - } - } -} - // FIXME: enhanced constructors here export function addFactory (modules, methods) { extend(modules, methods) |