Permalink
Browse files

Switch to Closure Compiler, using advanced optimizations mode. Lots o…

…f source format tweaks to allow this while preventing things from breaking due to property renaming, object flattening, etc.
  • Loading branch information...
Jason Johnston
Jason Johnston committed Apr 17, 2010
1 parent beaaae3 commit f83e0b19f382e17b0c850b987fce4b54cb177243
View
@@ -38,11 +38,23 @@
</target>
<target name="package-compressed" depends="package-uncompressed">
- <!--<copy file="${build_dir}/script_uncompressed.js" tofile="${build_dir}/script_compressed.js" overwrite="true" />-->
+ <exec executable="java">
+ <arg line='-jar tools/compiler.jar
+ --js ${build_dir}/script_uncompressed.js
+ --js ${src_dir}/closure_preservefunctions.js
+ --module "script_compressed:1"
+ --module "temp:1"
+ --module_output_path_prefix ${build_dir}/
+ --compilation_level ADVANCED_OPTIMIZATIONS
+ --externs ${src_dir}/closure_externs.js' />
+ </exec>
+ <delete file="${build_dir}/temp.js" />
+ <!--
<exec executable="yuicompressor">
<arg line="${build_dir}/script_uncompressed.js -o ${build_dir}/script_compressed.js" />
</exec>
+ -->
<concat destfile="${build_dir}/PIE.htc">
<fileset file="${src_dir}/htc_open.txt" />
View
@@ -3,30 +3,34 @@
* @constructor
* @param {string} val The raw CSS value for the angle. It is assumed it has been pre-validated.
*/
-PIE.Angle = function( val ) {
- this.val = val;
-};
-PIE.Angle.prototype = {
- unitRE: /(deg|rad|grad|turn)$/,
+PIE.Angle = (function() {
+ function Angle( val ) {
+ this.val = val;
+ }
+ Angle.prototype = {
+ unitRE: /(deg|rad|grad|turn)$/,
- /**
- * @return {string} The unit of the angle value
- */
- getUnit: function() {
- return this._unit || ( this._unit = this.val.match( this.unitRE )[1] );
- },
+ /**
+ * @return {string} The unit of the angle value
+ */
+ getUnit: function() {
+ return this._unit || ( this._unit = this.val.match( this.unitRE )[1] );
+ },
- /**
- * Get the numeric value of the angle in degrees.
- * @return {number} The degrees value
- */
- degrees: function() {
- var deg = this._deg, u, n;
- if( !deg ) {
- u = this.getUnit();
- n = parseFloat( this.val, 10 );
- deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 );
+ /**
+ * Get the numeric value of the angle in degrees.
+ * @return {number} The degrees value
+ */
+ degrees: function() {
+ var deg = this._deg, u, n;
+ if( !deg ) {
+ u = this.getUnit();
+ n = parseFloat( this.val, 10 );
+ deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 );
+ }
+ return deg;
}
- return deg;
- }
-};
+ };
+
+ return Angle;
+})();
Oops, something went wrong.

0 comments on commit f83e0b1

Please sign in to comment.