Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
reorder to put like vars together
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Aug 20, 2013
1 parent b9fcb88 commit e137e07
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions demos/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ define(['module'], function (module) {
args = moduleStr.split('!'),
name = args[0],
methodChecks = args.slice(1),
cfg = config.config,
polyfillCfg = cfg && cfg.polyfill,
polyfillConfig = polyfillCfg || {},
polyfillBaseUrl = (polyfillConfig.baseUrl || 'jam').replace(/([^\/])$/, '$1/'), // We want this relative to the main module path (todo: see if https://github.com/jrburke/requirejs/issues/844 prompts support for separating the plugin baseUrl and module baseUrl, in which case use the module one)
aliased = name.split('@'),
alias = aliased[1],
path = aliased[0],
polyfillPathHasProtocol = polyfillBaseUrl.indexOf(':') > -1,
polyfillAbsolutePath = polyfillBaseUrl.charAt() === '/',
variable = alias ?
path : // No need to split up the path if an alias file is being used as the "path" should really just be properties
path.split('/').slice(-1)[0],
props = variable.split('.');
props = variable.split('.'),
cfg = config.config,
polyfillCfg = cfg && cfg.polyfill,
polyfillConfig = polyfillCfg || {},
polyfillBaseUrl = (polyfillConfig.baseUrl || 'jam').replace(/([^\/])$/, '$1/'), // We want this relative to the main module path (todo: see if https://github.com/jrburke/requirejs/issues/844 prompts support for separating the plugin baseUrl and module baseUrl, in which case use the module one)
polyfillPathHasProtocol = polyfillBaseUrl.indexOf(':') > -1,
polyfillAbsolutePath = polyfillBaseUrl.charAt() === '/';
if (!alias) { // NOTE: If file size starts becoming a concern, we could scale back on the allowable values to just allow pathDepth of "one" + fileFormat of "full" (or revert back to a single autoNamespace variable); but this approach more flexibility to directory structure
// Using example, "polyfill!Array.prototype.map", transform later to the file path...
switch (polyfillConfig.pathDepth) {
Expand Down

0 comments on commit e137e07

Please sign in to comment.