Permalink
Browse files

Relates to requirejs/requirejs#333 and requirejs/requirejs#420: make …

…sure to normalize plugin ids, and update shim test to match latest 420 output
  • Loading branch information...
1 parent f7a0ee1 commit fbddfe2d5af0728fa820c4beb20b31ab71dce8a1 @jrburke jrburke committed Sep 26, 2012
Showing with 28 additions and 19 deletions.
  1. +1 −0 almond.js
  2. +3 −14 tests/shim/shim.html
  3. +24 −5 tests/shim/shim.js
View
@@ -189,6 +189,7 @@ var requirejs, require, define;
name = parts[1];
if (prefix) {
+ prefix = normalize(prefix, relName);
plugin = callDep(prefix);
}
View
@@ -10,21 +10,9 @@
require({
baseUrl: './',
- shim: {
- a: {
- exports: function () {
- return this.A.name;
- }
- },
- 'b': ['a', 'd'],
- 'c': {
- deps: ['a', 'b'],
- exports: 'C'
- }
- }
},
- ['a', 'c'],
- function(a, c) {
+ ['a', 'c', 'e'],
+ function(a, c, e) {
doh.register(
'shimBasic',
[
@@ -34,6 +22,7 @@
t.is('b', c.b.name);
t.is('c', c.name);
t.is('d', c.b.dValue.name);
+ t.is('e', e.name);
}
]
);
View
@@ -8,9 +8,13 @@
define("a", (function (global) {
return function () {
- var func = function (){return this.A.name};
- return func.apply(global, arguments);
- }
+ var ret = global.A.name;
+ var fn = function () {
+ window.globalA = this.A.name;
+ };
+ fn.apply(global, arguments);
+ return ret;
+ };
}(this)));
function D() {
@@ -35,7 +39,22 @@ var C = {
define("c", ["a","b"], (function (global) {
return function () {
- return global["C"];
- }
+ var ret = global.C;
+ return ret;
+ };
}(this)));
+var e = {
+ nested: {
+ e: {
+ name: 'e'
+ }
+ }
+};
+
+define("e", (function (global) {
+ return function () {
+ var ret = global.e.nested.e;
+ return ret;
+ };
+}(this)));

0 comments on commit fbddfe2

Please sign in to comment.