mirror of
https://github.com/wassname/CanvasTextWrapper.git
synced 2026-08-18 11:40:34 +08:00
v0.1.0
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
/*!
|
||||
* I am a comment
|
||||
*/
|
||||
function foo(){return 42}// @preserve preserve
|
||||
// @license license
|
||||
function bar(){return 2*foo()}/* @preserve
|
||||
* multiline preserve
|
||||
*/
|
||||
/* @license
|
||||
* multiline license
|
||||
*/
|
||||
function baz(){return bar()*bar()}
|
||||
+1
@@ -0,0 +1 @@
|
||||
function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}var longNameA=1,longNameB=2,result=longFunctionC(3,4);
|
||||
+1
@@ -0,0 +1 @@
|
||||
function longFunctionC(a,b){return longNameA+longNameB+a+b}var longNameA=1,longNameB=2,result=longFunctionC(3,4);
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// banner without sourcemap
|
||||
function longFunctionC(a,b){return longNameA+longNameB+a+b}var longNameA=1,longNameB=2,result=longFunctionC(3,4);
|
||||
Generated
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
function longFunctionC(a, b) {
|
||||
return longNameA + longNameB + a + b;
|
||||
}
|
||||
|
||||
var longNameA = 1, longNameB = 2, result = longFunctionC(3, 4);
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
function longFunctionC(argumentC,a){return longNameA+longNameB+argumentC+a}var longNameA=1,longNameB=2,result=longFunctionC(3,4);
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"/dev/null","sources":["test/fixtures/src/simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE"}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
(function(paramA, paramB) {
|
||||
var longNameA = 1;
|
||||
var longNameB = 2;
|
||||
function longFunctionC(argumentC, argumentD) {
|
||||
return longNameA + longNameB + argumentC + argumentD;
|
||||
}
|
||||
var result = longFunctionC(3, 4);
|
||||
})(window.argA, window.argB);
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(exports,global){function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}global.testExport=exports;var longNameA=1,longNameB=2,result=longFunctionC(3,4);exports.longNameA=longNameA,exports.longNameB=longNameB,exports.longFunctionC=longFunctionC,exports.result=result}({},function(){return this}());
|
||||
+1
@@ -0,0 +1 @@
|
||||
function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}function foo(){return 42}function bar(){return 2*foo()}function baz(){return bar()*bar()}var longNameA=1,longNameB=2,result=longFunctionC(3,4);
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
function longFunctionC(a,b){return longNameA+longNameB+a+b}var longNameA=1,longNameB=2,result=longFunctionC(3,4);
|
||||
//# sourceMappingURL=test/fixtures/expected/multiple_sourcemaps1.mapurl
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"test/fixtures/expected/multiple_sourcemaps1.js","sources":["test/fixtures/src/simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE"}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
function foo(){return 42}function bar(){return 2*foo()}function baz(){return bar()*bar()}
|
||||
//# sourceMappingURL=test/fixtures/expected/multiple_sourcemaps2.mapurl
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"test/fixtures/expected/multiple_sourcemaps2.js","sources":["test/fixtures/src/comments.js"],"names":["foo","bar","baz"],"mappings":"AAGA,QAASA,OACP,MAAO,IAIT,QAASC,OACP,MAAa,GAAND,MAQT,QAASE,OACP,MAAOD,OAAMA"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"/dev/null","sources":["simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"test/fixtures/expected/sourcemapin.js","sources":["test/fixtures/src/simple2.coffee"],"names":[],"mappings":";;IAAC,YAAA,GAAA,OAAA,KAAA,KAAA,OAAA,SAAA,KAAA,MACA,QAAW,GACX,UAAW,EAGK,WAAhB,OAAS,KAGT,OAAS,SAAA,GAAA,MAAO,GAAI,GAGpB,MAAQ,EAAG,EAAG,EAAG,EAAG,GAGpB,MACG,KAAQ,KAAI,KACb,OAAQ,OACR,KAAQ,SAAA,GAAA,MAAO,GAAI,OAAO,KAG1B,KAAO,SAAA,OAAA,SAAS,MAAA,SAAA,GAAA,UAAA,UAAA,MAAA,KAAA,UAAA,MACf,MAAM,OAAQ,UAGf,mBAAsB,QAAA,MAAA,OAAtB,MAAM,cAGR,MAAA,SAAA,QAAS,IAAA,GAAT,KAAS,GAAA,EAAA,QAAyB,KAAA,OAAzB,QAAA,KAAA,GAAkB,IAAO,KAAA,IAAA,OAAA,KAAzB,KAAI,KAAM,KAAV,OAAA,SAAA,KAAA,UAAA,KAAA","sourceRoot":"http://local.host/js/"}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// Hello World
|
||||
|
||||
void function(){var cubes,list,math,number,opposite,race,square;number=42,opposite=!0,opposite&&(number=-42),square=function(x){return x*x},list=[1,2,3,4,5],math={root:Math.sqrt,square:square,cube:function(x){return x*square(x)}},race=function(winner,runners){return runners=2<=arguments.length?[].slice.call(arguments,1):[],print(winner,runners)},"undefined"!=typeof elvis&&null!=elvis&&alert("I knew it!"),cubes=function(accum$){for(var num,i$=0,length$=list.length;length$>i$;++i$)num=list[i$],accum$.push(math.cube(num));return accum$}.call(this,[])}.call(this);
|
||||
//# sourceMappingURL=test/fixtures/expected/sourcemapin
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
function longFunctionC(a,b){return longNameA+longNameB+a+b}var longNameA=1,longNameB=2,result=longFunctionC(3,4);
|
||||
//# sourceMappingURL=js/sourcemapurl.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(exports,global){function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}global.testExport=exports;{var longNameA=1,longNameB=2;longFunctionC(3,4)}}({},function(){return this}());
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/*!
|
||||
* I am a comment
|
||||
*/
|
||||
function foo() {
|
||||
return 42;
|
||||
}
|
||||
// @preserve preserve
|
||||
// @license license
|
||||
function bar() {
|
||||
return foo()*2;
|
||||
}
|
||||
/* @preserve
|
||||
* multiline preserve
|
||||
*/
|
||||
/* @license
|
||||
* multiline license
|
||||
*/
|
||||
function baz() {
|
||||
return bar()*bar();
|
||||
}
|
||||
// end - not preserved
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
// Hello world, I'm a comment!
|
||||
|
||||
var longNameA = 1;
|
||||
|
||||
var longNameB = 2;
|
||||
|
||||
function longFunctionC(argumentC,argumentD) {
|
||||
return longNameA + longNameB + argumentC + argumentD;
|
||||
}
|
||||
|
||||
var result = longFunctionC(3,4);
|
||||
|
||||
/*! I might be preserved, yay! */
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
# Assignment:
|
||||
number = 42
|
||||
opposite = true
|
||||
|
||||
# Conditions:
|
||||
number = -42 if opposite
|
||||
|
||||
# Functions:
|
||||
square = (x) -> x * x
|
||||
|
||||
# Arrays:
|
||||
list = [1, 2, 3, 4, 5]
|
||||
|
||||
# Objects:
|
||||
math =
|
||||
root: Math.sqrt
|
||||
square: square
|
||||
cube: (x) -> x * square x
|
||||
|
||||
# Splats:
|
||||
race = (winner, runners...) ->
|
||||
print winner, runners
|
||||
|
||||
# Existence:
|
||||
alert "I knew it!" if elvis?
|
||||
|
||||
# Array comprehensions:
|
||||
cubes = (math.cube num for num in list)
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// Generated by CoffeeScript 2.0.0-dev
|
||||
void function () {
|
||||
var cubes, list, math, number, opposite, race, square;
|
||||
number = 42;
|
||||
opposite = true;
|
||||
if (opposite)
|
||||
number = -42;
|
||||
square = function (x) {
|
||||
return x * x;
|
||||
};
|
||||
list = [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5
|
||||
];
|
||||
math = {
|
||||
root: Math.sqrt,
|
||||
square: square,
|
||||
cube: function (x) {
|
||||
return x * square(x);
|
||||
}
|
||||
};
|
||||
race = function (winner, runners) {
|
||||
runners = 2 <= arguments.length ? [].slice.call(arguments, 1) : [];
|
||||
return print(winner, runners);
|
||||
};
|
||||
if ('undefined' !== typeof elvis && null != elvis)
|
||||
alert('I knew it!');
|
||||
cubes = function (accum$) {
|
||||
var num;
|
||||
for (var i$ = 0, length$ = list.length; i$ < length$; ++i$) {
|
||||
num = list[i$];
|
||||
accum$.push(math.cube(num));
|
||||
}
|
||||
return accum$;
|
||||
}.call(this, []);
|
||||
}.call(this);
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"test/fixtures/src/simple2.coffee","sources":["test/fixtures/src/simple2.coffee"],"names":[],"mappings":"AAAC;;;EACA,MAAA,GAAW;EACX,QAAA,GAAW;EAGX,IAAgB,QAAhB,CAAA;AAAA,IAAA,MAAA,GAAS,CAAC;EAGV,MAAA,GAAS,SAAA,CAAA,CAAA,CAAA;WAAO,CAAA,CAAA,CAAA,CAAI;;EAGpB,IAAA,GAAO,CAAA;AAAA,IAAC,CAAD;AAAA,IAAI,CAAJ;AAAA,IAAO,CAAP;AAAA,IAAU,CAAV;AAAA,IAAa,CAAb;AAAA,EAAA;EAGP,IAAA,GACG,CAAA;AAAA,IAAA,IAAA,EAAQ,IAAI,KAAZ;AAAA,IACD,MAAA,EAAQ,MADP;AAAA,IAED,IAAA,EAAQ,SAAA,CAAA,CAAA,CAAA;aAAO,CAAA,CAAA,CAAA,CAAI,MAAA,CAAO,CAAP;KAFlB;AAAA,EAAA;EAKD,IAAA,GAAO,SAAA,CAAA,MAAA,EAAA,OAAA,CAAA;IAAS;WACf,KAAA,CAAM,MAAN,EAAc,OAAd;;EAGD,2BAAsB,KAAA,CAAA,EAAA,SAAA,KAAtB,CAAA;AAAA,IAAA,KAAA,CAAM,YAAN;EAGF,KAAA;;IAAS,2BAAyB,YAAzB,aAAA,CAAA,KAAA,CAAA;MAAkB,MAAO;kBAAzB,IAAI,KAAJ,CAAU,GAAV"}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
'use strict';
|
||||
|
||||
var grunt = require('grunt');
|
||||
|
||||
var tmp = 'tmp/',
|
||||
fixtures = 'test/fixtures/expected/';
|
||||
|
||||
exports.contrib_uglify = {
|
||||
preuglified_files: function(test) {
|
||||
|
||||
var files = [
|
||||
'comments.js',
|
||||
'compress.js',
|
||||
'compress_mangle.js',
|
||||
'compress_mangle_banner.js',
|
||||
'compress_mangle_beautify.js',
|
||||
'compress_mangle_except.js',
|
||||
'compress_mangle_sourcemap',
|
||||
'enclose.js',
|
||||
'sourcemapurl.js',
|
||||
'multifile.js',
|
||||
'wrap.js',
|
||||
'exportAll.js',
|
||||
'sourcemap_prefix'
|
||||
];
|
||||
|
||||
test.expect(files.length);
|
||||
|
||||
files.forEach(function(file){
|
||||
var actual = grunt.file.read(tmp + file);
|
||||
var expected = grunt.file.read(fixtures + file);
|
||||
test.equal(actual, expected, 'task output should equal ' + file);
|
||||
});
|
||||
|
||||
test.done();
|
||||
},
|
||||
relative_test : function(test) {
|
||||
|
||||
var files = [
|
||||
'sourcemapin',
|
||||
'sourcemapin.js',
|
||||
'multiple_sourcemaps1.js',
|
||||
'multiple_sourcemaps1.map',
|
||||
'multiple_sourcemaps2.js',
|
||||
'multiple_sourcemaps2.map',
|
||||
];
|
||||
|
||||
test.expect(files.length);
|
||||
|
||||
files.forEach(function(file){
|
||||
var actual = grunt.file.read(tmp + file).replace(tmp,'REPLACED');
|
||||
var expected = grunt.file.read(fixtures + file).replace(fixtures,'REPLACED');
|
||||
test.equal(actual, expected, 'task output should equal ' + file);
|
||||
});
|
||||
|
||||
test.done();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user