Skip to content

Instantly share code, notes, and snippets.

@xiaotian
Created November 18, 2011 06:16
Show Gist options
  • Save xiaotian/1375748 to your computer and use it in GitHub Desktop.
Save xiaotian/1375748 to your computer and use it in GitHub Desktop.
Backbone module
(function(){
// Initial Setup
// -------------
// Save a reference to the global object.
var root = this;
// Save the previous value of the `Backbone` variable.
var previousBackbone = root.Backbone;
// Create a local reference to slice.
var slice = Array.prototype.slice;
// The top-level namespace. All public Backbone classes and modules will
// be attached to this. Exported for both CommonJS and the browser.
var Backbone;
if (typeof exports !== 'undefined') {
Backbone = exports;
} else {
Backbone = root.Backbone = {};
}
// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '0.5.3';
...
}).call(this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment