Comparing version 1.7.2 to 1.7.3
@@ -17,2 +17,3 @@ { | ||
"rules": { | ||
"semi": 2, | ||
"eqeqeq": 2, | ||
@@ -19,0 +20,0 @@ "no-eq-null": 2, |
@@ -148,3 +148,3 @@ var fs = require('fs'), | ||
'src/mixins/collection.mixin.js', | ||
'src/mixins/shared_methods.mixin.js', | ||
'src/util/misc.js', | ||
@@ -151,0 +151,0 @@ 'src/util/arc.js', |
@@ -0,1 +1,13 @@ | ||
**Version 1.7.3** | ||
- Improvement: mousewheel event is handled with target and fired also from objects. [#3612](https://github.com/kangax/fabric.js/pull/3612) | ||
- Improvement: Pattern loads for canvas background and overlay, corrected svg pattern export [#3601](https://github.com/kangax/fabric.js/pull/3601) | ||
- Fix: Wait for pattern loading before calling callback [#3598](https://github.com/kangax/fabric.js/pull/3598) | ||
- Fix: add 2 extra pixels to cache canvases to avoid aliasing cut [#3596](https://github.com/kangax/fabric.js/pull/3596) | ||
- Fix: Rerender when deselect an itext editing object [#3594](https://github.com/kangax/fabric.js/pull/3594) | ||
- Fix: save new state of dimensionProperties at every cache clear [#3595](https://github.com/kangax/fabric.js/pull/3595) | ||
- Improvement: Better error managment in loadFromJSON [#3586](https://github.com/kangax/fabric.js/pull/3586) | ||
- Improvement: do not reload backgroundImage as an image if is different type [#3550](https://github.com/kangax/fabric.js/pull/3550) | ||
- Improvement: if a children element is set dirty, set the parent dirty as well. [#3564](https://github.com/kangax/fabric.js/pull/3564) | ||
**Version 1.7.2** | ||
@@ -2,0 +14,0 @@ |
@@ -28,3 +28,3 @@ <!-- | ||
## Version | ||
1.7.2 | ||
1.7.3 | ||
@@ -31,0 +31,0 @@ ## Test Case |
@@ -5,3 +5,3 @@ { | ||
"homepage": "http://fabricjs.com/", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"author": "Juriy Zaytsev <kangax@gmail.com>", | ||
@@ -8,0 +8,0 @@ "contributors": [ |
@@ -6,6 +6,6 @@ (function() { | ||
var CANVAS_SVG = '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' + | ||
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="600" height="600" viewBox="0 0 600 600" xml:space="preserve">\n<desc>Created with Fabric.js ' + fabric.version + '</desc>\n<defs></defs>\n</svg>'; | ||
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="600" height="600" viewBox="0 0 600 600" xml:space="preserve">\n<desc>Created with Fabric.js ' + fabric.version + '</desc>\n<defs>\n</defs>\n</svg>'; | ||
var CANVAS_SVG_VIEWBOX = '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' + | ||
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="600" height="600" viewBox="100 100 300 300" xml:space="preserve">\n<desc>Created with Fabric.js ' + fabric.version + '</desc>\n<defs></defs>\n</svg>'; | ||
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="600" height="600" viewBox="100 100 300 300" xml:space="preserve">\n<desc>Created with Fabric.js ' + fabric.version + '</desc>\n<defs>\n</defs>\n</svg>'; | ||
@@ -46,3 +46,3 @@ var PATH_JSON = '{"objects": [{"type": "path", "originX": "left", "originY": "top", "left": 268, "top": 266, "width": 51, "height": 49,' + | ||
var isAbsolute = /^https?:/.test(path); | ||
if (isAbsolute) { return path }; | ||
if (isAbsolute) { return path; }; | ||
var imgEl = _createImageElement(); | ||
@@ -55,3 +55,3 @@ imgEl.src = path; | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('test/fixtures/test_image.gif'), | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('../fixtures/test_image.gif'), | ||
IMG_WIDTH = 276, | ||
@@ -119,3 +119,3 @@ IMG_HEIGHT = 110; | ||
require('fs').readFile(src, function(err, imgData) { | ||
if (err) { throw err }; | ||
if (err) { throw err; }; | ||
img.src = imgData; | ||
@@ -930,3 +930,3 @@ img._src = src; | ||
test('loadFromJSON with json string', function() { | ||
asyncTest('loadFromJSON with json string staticCanvas', function() { | ||
ok(typeof canvas.loadFromJSON == 'function'); | ||
@@ -954,8 +954,8 @@ | ||
equal(obj.get('opacity'), 1); | ||
ok(obj.get('path').length > 0); | ||
start(); | ||
}); | ||
}); | ||
test('loadFromJSON with json object', function() { | ||
asyncTest('loadFromJSON with json object', function() { | ||
ok(typeof canvas.loadFromJSON == 'function'); | ||
@@ -986,2 +986,3 @@ | ||
ok(obj.get('path').length > 0); | ||
start(); | ||
}); | ||
@@ -1002,3 +1003,3 @@ }); | ||
test('loadFromJSON custom properties', function() { | ||
asyncTest('loadFromJSON custom properties', function() { | ||
var rect = new fabric.Rect({ width: 10, height: 20 }); | ||
@@ -1022,2 +1023,3 @@ rect.padding = 123; | ||
equal(obj.foo, 'bar', '"foo" property on object is set properly'); | ||
start(); | ||
}); | ||
@@ -1024,0 +1026,0 @@ }); |
@@ -530,6 +530,26 @@ (function() { | ||
test('dirty flag propagation from children up', function() { | ||
var g1 = makeGroupWith4Objects(); | ||
var obj = g1.item(0); | ||
g1.dirty = false; | ||
obj.dirty = false; | ||
equal(g1.dirty, false, 'Group has no dirty flag set'); | ||
obj.set('fill', 'red'); | ||
equal(obj.dirty, true, 'Obj has dirty flag set'); | ||
equal(g1.dirty, true, 'Group has dirty flag set'); | ||
}); | ||
test('_getCacheCanvasDimensions returns dimensions and zoom for cache canvas are influenced by group', function() { | ||
var g1 = makeGroupWith4Objects(); | ||
var obj = g1.item(0); | ||
var dims = obj._getCacheCanvasDimensions(); | ||
g1.scaleX = 2; | ||
var dims2 = obj._getCacheCanvasDimensions(); | ||
equal((dims2.width - 2), (dims.width - 2) * g1.scaleX, 'width of cache has increased with group scale'); | ||
}); | ||
test('test group transformMatrix', function() { | ||
var rect1 = new fabric.Rect({ top: 1, left: 1, width: 2, height: 2, strokeWidth: 0, fill: 'red', opacity: 1}), | ||
rect2 = new fabric.Rect({ top: 5, left: 5, width: 2, height: 2, strokeWidth: 0, fill: 'red', opacity: 1}), | ||
group = new fabric.Group([rect1, rect2], {opacity: 1, fill: 'blue', strokeWidth: 0}), | ||
var rect1 = new fabric.Rect({ top: 1, left: 1, width: 2, height: 2, strokeWidth: 0, fill: 'red', opacity: 1, objectCaching: false}), | ||
rect2 = new fabric.Rect({ top: 5, left: 5, width: 2, height: 2, strokeWidth: 0, fill: 'red', opacity: 1, objectCaching: false}), | ||
group = new fabric.Group([rect1, rect2], {opacity: 1, fill: 'blue', strokeWidth: 0, objectCaching: false}), | ||
isTransparent = fabric.util.isTransparent, | ||
@@ -536,0 +556,0 @@ ctx = canvas.contextContainer; |
@@ -5,3 +5,3 @@ (function() { | ||
var isAbsolute = /^https?:/.test(path); | ||
if (isAbsolute) { return path }; | ||
if (isAbsolute) { return path; }; | ||
var imgEl = _createImageElement(); | ||
@@ -14,3 +14,3 @@ imgEl.src = path; | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('test/fixtures/test_image.gif'), | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('../fixtures/test_image.gif'), | ||
IMG_WIDTH = 276, | ||
@@ -73,3 +73,3 @@ IMG_HEIGHT = 110; | ||
require('fs').readFile(src, function(err, imgData) { | ||
if (err) { throw err }; | ||
if (err) { throw err; }; | ||
img.src = imgData; | ||
@@ -76,0 +76,0 @@ callback && callback(); |
@@ -5,3 +5,3 @@ (function() { | ||
var isAbsolute = /^https?:/.test(path); | ||
if (isAbsolute) { return path }; | ||
if (isAbsolute) { return path; }; | ||
var imgEl = _createImageElement(); | ||
@@ -14,3 +14,3 @@ imgEl.src = path; | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('test/fixtures/test_image.gif'), | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('../fixtures/test_image.gif'), | ||
IMG_WIDTH = 276, | ||
@@ -96,3 +96,3 @@ IMG_HEIGHT = 110; | ||
require('fs').readFile(src, function(err, imgData) { | ||
if (err) { throw err }; | ||
if (err) { throw err; }; | ||
img.src = imgData; | ||
@@ -164,3 +164,2 @@ img._src = src; | ||
ok(image.resizeFilters[0] instanceof fabric.Image.filters.Resize, 'should inherit from fabric.Image.filters.Resize'); | ||
var toObject = image.toObject(); | ||
@@ -167,0 +166,0 @@ deepEqual(toObject.resizeFilters[0], filter.toObject()); |
@@ -157,3 +157,3 @@ (function() { | ||
equal(iText.width, iText.cursorWidth); | ||
}) | ||
}); | ||
@@ -749,17 +749,19 @@ test('setSelectionEnd', function() { | ||
test('toSVG', function() { | ||
var iText = new fabric.IText('test', { | ||
styles: { | ||
0: { | ||
0: { fill: '#112233' }, | ||
2: { stroke: '#223344' } | ||
} | ||
} | ||
}); | ||
equal(typeof iText.toSVG, 'function'); | ||
if (!fabric.isLikelyNode) { | ||
equal(iText.toSVG(), '\t<g transform=\"translate(27.77 22.6)\">\n\t\t<text font-family=\"Times New Roman\" font-size=\"40\" font-weight=\"normal\" style=\"stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;\" >\n\t\t\t<tspan x=\"-27.77\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(17,34,51); fill-rule: ; opacity: 1;\">t</tspan>\n\t\t\t<tspan x=\"-16.66\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">e</tspan>\n\t\t\t<tspan x=\"1.09\" y=\"12.6\" style=\"stroke: rgb(34,51,68); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">s</tspan>\n\t\t\t<tspan x=\"16.66\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">t</tspan>\n\t\t</text>\n\t</g>\n'); | ||
} | ||
// TODO: more SVG tests here? | ||
}); | ||
// test('toSVG', function() { | ||
// var iText = new fabric.IText('test', { | ||
// styles: { | ||
// 0: { | ||
// 0: { fill: '#112233' }, | ||
// 2: { stroke: '#223344' } | ||
// } | ||
// } | ||
// }); | ||
// equal(typeof iText.toSVG, 'function'); | ||
// if (fabric.isLikelyNode) { | ||
// equal(iText.toSVG(), '\t<g transform=\"translate(28.27 23.1)\">\n\t\t<text font-family=\"Times New Roman\" font-size=\"40\" font-weight=\"normal\" style=\"stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;\" >\n\t\t\t<tspan x=\"-27.77\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(17,34,51); fill-rule: ; opacity: 1;\">t</tspan>\n\t\t\t<tspan x=\"-16.66\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">e</tspan>\n\t\t\t<tspan x=\"1.09\" y=\"12.6\" style=\"stroke: rgb(34,51,68); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">s</tspan>\n\t\t\t<tspan x=\"16.66\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">t</tspan>\n\t\t</text>\n\t</g>\n'); | ||
// } | ||
// else { | ||
// equal(iText.toSVG(), '\t<g transform=\"translate(28.27 23.1)\">\n\t\t<text font-family=\"Times New Roman\" font-size=\"40\" font-weight=\"normal\" style=\"stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;\" >\n\t\t\t<tspan x=\"-27.77\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(17,34,51); fill-rule: ; opacity: 1;\">t</tspan>\n\t\t\t<tspan x=\"-16.66\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">e</tspan>\n\t\t\t<tspan x=\"1.09\" y=\"12.6\" style=\"stroke: rgb(34,51,68); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">s</tspan>\n\t\t\t<tspan x=\"16.66\" y=\"12.6\" style=\"stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: ; opacity: 1;\">t</tspan>\n\t\t</text>\n\t</g>\n'); | ||
// } | ||
// }); | ||
@@ -766,0 +768,0 @@ test('toSVGWithFonts', function() { |
@@ -17,3 +17,3 @@ (function(){ | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('test/fixtures/test_image.gif'), | ||
var IMG_SRC = fabric.isLikelyNode ? (__dirname + '/../fixtures/test_image.gif') : getAbsolutePath('../fixtures/test_image.gif'), | ||
IMG_WIDTH = 276, | ||
@@ -759,7 +759,5 @@ IMG_HEIGHT = 110; | ||
ok(typeof object._setLineDash === 'function'); | ||
canvas.add(object); | ||
object.strokeDashArray = [3, 2, 1]; | ||
equal(object.strokeDashArray.length, 3, 'strokeDash array is odd'); | ||
canvas.renderAll(); | ||
object._setLineDash(canvas.contextContainer, object.strokeDashArray, null); | ||
equal(object.strokeDashArray.length, 6, 'strokeDash array now is even'); | ||
@@ -1444,3 +1442,3 @@ }); | ||
height: 50, | ||
clipTo: function(ctx) { ctx.arc(10, 10, 10, 0, Math.PI * 2, false) } | ||
clipTo: function(ctx) { ctx.arc(10, 10, 10, 0, Math.PI * 2, false); } | ||
}); | ||
@@ -1473,2 +1471,67 @@ | ||
test('dirty flag on set property', function() { | ||
var object = new fabric.Object({ scaleX: 3, scaleY: 2}); | ||
object.cacheProperties = ['propA', 'propB']; | ||
object.dirty = false; | ||
equal(object.dirty, false, 'object starts with dirty flag disabled'); | ||
object.set('propC', '3'); | ||
equal(object.dirty, false, 'after setting a property out of cache, dirty flag is still false'); | ||
object.set('propA', '2'); | ||
equal(object.dirty, true, 'after setting a property from cache, dirty flag is true'); | ||
}); | ||
test('isCacheDirty statefullCache disabled', function() { | ||
var object = new fabric.Object({ scaleX: 3, scaleY: 2}); | ||
object.cacheProperties = ['propA', 'propB']; | ||
object.dirty = false; | ||
object.statefullCache = false; | ||
object._createCacheCanvas(); | ||
equal(object.isCacheDirty(), false, 'object is not dirty if dirty flag is false'); | ||
object.dirty = true; | ||
equal(object.isCacheDirty(), true, 'object is dirty if dirty flag is true'); | ||
}); | ||
test('isCacheDirty statefullCache enabled', function() { | ||
var object = new fabric.Object({ scaleX: 3, scaleY: 2}); | ||
object.cacheProperties = ['propA', 'propB']; | ||
object.dirty = false; | ||
object.statefullCache = true; | ||
object.propA = 'A'; | ||
object.setupState({ propertySet: 'cacheProperties' }); | ||
object._createCacheCanvas(); | ||
equal(object.isCacheDirty(), false, 'object is not dirty'); | ||
object.propA = 'B'; | ||
equal(object.isCacheDirty(), true, 'object is dirty because change in propA is detected by statefullCache'); | ||
}); | ||
test('_getCacheCanvasDimensions returns dimensions and zoom for cache canvas', function() { | ||
var object = new fabric.Object({ width: 10, height: 10, strokeWidth: 0 }); | ||
var dims = object._getCacheCanvasDimensions(); | ||
deepEqual(dims, { width: 12, height: 12, zoomX: 1, zoomY: 1 }, 'if no scaling is applied cache is as big as object'); | ||
object.strokeWidth = 2; | ||
dims = object._getCacheCanvasDimensions(); | ||
deepEqual(dims, { width: 14, height: 14, zoomX: 1, zoomY: 1 }, 'cache contains the stroke'); | ||
object.scaleX = 2; | ||
object.scaleY = 3; | ||
dims = object._getCacheCanvasDimensions(); | ||
deepEqual(dims, { width: 26, height: 38, zoomX: 2, zoomY: 3 }, 'cache is as big as the scaled object'); | ||
}); | ||
test('_updateCacheCanvas check if cache canvas should be updated', function() { | ||
var object = new fabric.Object({ width: 10, height: 10, strokeWidth: 0 }); | ||
object._createCacheCanvas(); | ||
equal(object.cacheWidth, 12, 'current cache dimensions are saved'); | ||
equal(object.cacheHeight, 12, 'current cache dimensions are saved'); | ||
equal(object._updateCacheCanvas(), false, 'second execution of cache canvas return false'); | ||
object.scaleX = 2; | ||
equal(object._updateCacheCanvas(), true, 'if scale change, it returns true'); | ||
equal(object.cacheWidth, 22, 'current cache dimensions is updated'); | ||
equal(object.zoomX, 2, 'current scale level is saved'); | ||
object.width = 2; | ||
equal(object._updateCacheCanvas(), true, 'if dimension change, it returns true'); | ||
equal(object.cacheWidth, 6, 'current cache dimensions is updated'); | ||
object.strokeWidth = 2; | ||
equal(object._updateCacheCanvas(), true, 'if strokeWidth change, it returns true'); | ||
}); | ||
test('_setShadow', function(){ | ||
@@ -1475,0 +1538,0 @@ var el = fabric.document.createElement('canvas'); |
@@ -12,3 +12,3 @@ (function() { | ||
require('fs').readFile(src, function(err, imgData) { | ||
if (err) { throw err }; | ||
if (err) { throw err; }; | ||
img.src = imgData; | ||
@@ -38,3 +38,2 @@ img._src = src; | ||
ok(fabric.Pattern); | ||
var pattern = createPattern(); | ||
@@ -44,2 +43,17 @@ ok(pattern instanceof fabric.Pattern, 'should inherit from fabric.Pattern'); | ||
asyncTest('constructor with source string and with callback', function() { | ||
function callback(pattern) { | ||
if (fabric.isLikelyNode) { | ||
equal(pattern.source._src, IMG_SRC, 'pattern source has been loaded'); | ||
} | ||
else { | ||
equal(pattern.source.complete, true, 'pattern source has been loaded'); | ||
} | ||
start(); | ||
} | ||
new fabric.Pattern({ | ||
source: IMG_SRC | ||
}, callback); | ||
}); | ||
test('properties', function() { | ||
@@ -70,7 +84,7 @@ var pattern = createPattern(); | ||
var patternWithGetSource = new fabric.Pattern({ | ||
source: function() {return fabric.document.createElement('canvas')} | ||
source: function() {return fabric.document.createElement('canvas');} | ||
}); | ||
var object2 = patternWithGetSource.toObject(); | ||
equal(object2.source, 'function () {return fabric.document.createElement(\'canvas\')}'); | ||
equal(object2.source, 'function () {return fabric.document.createElement(\'canvas\');}'); | ||
equal(object2.repeat, 'repeat'); | ||
@@ -77,0 +91,0 @@ }); |
@@ -5,3 +5,3 @@ (function() { | ||
function K (x) { return x } | ||
function K (x) { return x; } | ||
@@ -16,3 +16,3 @@ function _createImageElement() { | ||
var isAbsolute = /^https?:/.test(path); | ||
if (isAbsolute) { return path }; | ||
if (isAbsolute) { return path; }; | ||
var imgEl = _createImageElement(); | ||
@@ -27,3 +27,3 @@ imgEl.src = path; | ||
? require('path').join(__dirname, '../fixtures/', 'very_large_image.jpg') | ||
: getAbsolutePath('test/fixtures/very_large_image.jpg'); | ||
: getAbsolutePath('../fixtures/very_large_image.jpg'); | ||
@@ -273,3 +273,3 @@ var IMG_URL_NON_EXISTING = 'http://www.google.com/non-existing'; | ||
deepEqual(['x', 'y'], fabric.util.toArray({ 0: 'x', 1: 'y', length: 2 })); | ||
deepEqual([1, 3], fabric.util.toArray((function(){ return arguments })(1, 3))); | ||
deepEqual([1, 3], fabric.util.toArray((function(){ return arguments; })(1, 3))); | ||
@@ -657,5 +657,5 @@ var nodelist = fabric.document.getElementsByTagName('div'), | ||
var arr = [1,2,3,4,5]; | ||
deepEqual([3,4,5], arr.filter(function(val){ return val > 2 })); | ||
deepEqual([], arr.filter(function(val){ return val > 5 })); | ||
deepEqual([1,2], arr.filter(function(val){ return val <= 2 })); | ||
deepEqual([3,4,5], arr.filter(function(val){ return val > 2; })); | ||
deepEqual([], arr.filter(function(val){ return val > 5; })); | ||
deepEqual([1,2], arr.filter(function(val){ return val <= 2; })); | ||
}); | ||
@@ -668,10 +668,10 @@ | ||
equal(15, | ||
arr.reduce(function(memo, val) { return memo + val }), 0); | ||
arr.reduce(function(memo, val) { return memo + val; }), 0); | ||
deepEqual(['1!', '2!', '3!', '4!', '5!'], | ||
arr.reduce(function(memo, val) { memo.push(val + '!'); return memo }, [])); | ||
arr.reduce(function(memo, val) { memo.push(val + '!'); return memo; }, [])); | ||
arr = 'foobar'.split(''); | ||
equal('f0o1o2b3a4r5', | ||
arr.reduce(function(memo, val, index) { return memo + val + index }, '')); | ||
arr.reduce(function(memo, val, index) { return memo + val + index; }, '')); | ||
}); | ||
@@ -769,5 +769,5 @@ | ||
var obj1 = { toString: function(){ return 'obj1' } }; | ||
var obj2 = { toString: function(){ return 'obj2' } }; | ||
var obj3 = { toString: function(){ return 'obj3' } }; | ||
var obj1 = { toString: function(){ return 'obj1'; } }; | ||
var obj2 = { toString: function(){ return 'obj2'; } }; | ||
var obj3 = { toString: function(){ return 'obj3'; } }; | ||
@@ -792,5 +792,5 @@ deepEqual(['obj1', 'obj2', 'obj3'], | ||
var obj1 = { valueOf: function(){ return 1 } }; | ||
var obj2 = { valueOf: function(){ return 2 } }; | ||
var obj3 = { valueOf: function(){ return 3 } }; | ||
var obj1 = { valueOf: function(){ return 1; } }; | ||
var obj2 = { valueOf: function(){ return 2; } }; | ||
var obj3 = { valueOf: function(){ return 3; } }; | ||
@@ -808,5 +808,5 @@ equal(obj1, fabric.util.array.min([obj1, obj3, obj2])); | ||
var obj1 = { valueOf: function(){ return 1 } }; | ||
var obj2 = { valueOf: function(){ return 2 } }; | ||
var obj3 = { valueOf: function(){ return 3 } }; | ||
var obj1 = { valueOf: function(){ return 1; } }; | ||
var obj2 = { valueOf: function(){ return 2; } }; | ||
var obj3 = { valueOf: function(){ return 3; } }; | ||
@@ -813,0 +813,0 @@ equal(obj3, fabric.util.array.max([obj1, obj3, obj2])); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
11252877
55672
8