Skip to content

Instantly share code, notes, and snippets.

@ibolmo
Forked from subtleGradient/snippet.js
Created November 30, 2009 21:31
Show Gist options
  • Save ibolmo/245770 to your computer and use it in GitHub Desktop.
Save ibolmo/245770 to your computer and use it in GitHub Desktop.
/**
* Explanation: before compression, remove any first '/' for matched: ^[ \t]*\/\/\*\* *(Compat|Fix)\:?(\w)*
* That are not necessary for the build. E.g. if the build is for 1.3 with no compat, then all Compat
* matches will lose the first '/' and therefore all of that code becomes commented. Similarly for browser
* fixes.
*
* During compression, the user can optionally remove the comments and thereby removing the rest of the code.
*
* Otherwise, there is not JavaScript performance loss due to commenting. Parser will just skip.
*
* NOTE: Compat Source Code needs to be after the bleeding edge, since it must be overwrite.
*/
var MyClass = new Class({
initialize: function(){
this.foo = '123'; // <-- default, or rather bleeding edge
//** Compat: 1.2
this.foo = '123' && '345';
//**/
//this.foo = '123';/*<compat:1.2/>*/ <-- unsupported
//this.foo = '123';//<compat:1.2/> <-- unsupported
this.foo = '345';
},
//** Fix: IE6 // <-- this could use a little work
method: function(arg20){
},
//** Compat 1.2
method: function(arg12, arg20){
},
//**/
//**/
//* Fix: Safari2
method: function(){ // <- not sure what's this suppose to do.
}
//**/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment