This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myString1 = require('commonjs_mod').myString; | |
| var myString2 = "app"; | |
| myString1.foo(); // no Fail. This string is an instance of a String whose prototype has a `foo` method | |
| myString2.foo(); // Fail. This string is an instance of the global String native |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String.prototype.foo = function(){ return "foo'd"; }; | |
| var myString1 = require('footools').myString; | |
| var myString2 = "app"; | |
| myString1.foo(); // Fail? | |
| myString2.foo(); // no Fail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "app".foo(); // Fail. The method `foo` doesn't exist | |
| require('commonjs_mod'); // Modifies the String native | |
| "app".foo(); // no Fail. The method `foo` was added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Moo = function(){ | |
| var context = this; | |
| var Class = this.Class = function(){}; | |
| this.String.prototype.foo = function(){ return "foo'd"; }; | |
| context.String.prototype.bar = function(){ return "bar'd"; }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Workaround for .NET breaking on `clientID.startsWith` | |
| // Name: MicrosoftAjaxWebForms.debug.js | |
| // Assembly: System.Web.Extensions | |
| // Line: 722 | |
| // Error: Object doesn't support this property or method | |
| /* | |
| function Sys$WebForms$PageRequestManager$_matchesParentIDInList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Wrap all of MooTools code in a function | |
| /*<b support="CommonJS Modules namespace">*/var MooTools = function(exports){/*</b>*/ | |
| // fallback exports to `this` so that it can be used as both: | |
| // `MooTools.apply(context)` | |
| // this is the only style that'll work in CommonJS since exports can't be a function | |
| // `MooTools(context)` | |
| // `MooTools()` | |
| if (typeof exports == 'undefined') exports = this; | |
| var context = exports; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*= | |
| name: Class | |
| description: Code with Class | |
| requires: Accessor | |
| =*/ | |
| MooTools.define(function(){ | |
| var Class = this.Class = new Type('Class', function(params){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('MooTools').apply(global); // extends natives; extends global | |
| require('Class').setup.apply(global); // extends global |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| --- | |
| provides : BuildSugar | |
| version : 0.1alpha1 | |
| description : Provides a bizarrely clean & simple syntax sugar for building HTML/XML strings | |
| source : http://gist.github.com/278016 | |
| git : git://gist.github.com/278016.git | |
| demo : http://jsfiddle.net/SubtleGradient/4W3RR/ | |
| author : Thomas Aylott |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function evalWith(namespaces, code){ | |
| if ({}.toString.call(namespaces) != '[object Array]') | |
| namespaces = [namespaces]; | |
| var imports = { | |
| require: function(){}, | |
| exports: {}, | |
| module: {} | |
| }; | |