Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1577, plugin normalize called too many times
- Loading branch information
Showing
5 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>require.js: Remote URL Test</title> | ||
<script type="text/javascript" src="../../require.js"></script> | ||
<script type="text/javascript" src="../doh/runner.js"></script> | ||
<script type="text/javascript" src="../doh/_browserRunner.js"></script> | ||
<script type="text/javascript"> | ||
|
||
define("Plugin", function() { | ||
return { | ||
load: function(name, parentRequire, onload, config) { | ||
onload(name); | ||
}, | ||
normalize: function(name, normalize) { | ||
return name + '.xyz'; | ||
} | ||
} | ||
}); | ||
|
||
require({ | ||
baseUrl: "./" | ||
}, | ||
["Plugin!hello", "Plugin!world"], | ||
function(hello, world) { | ||
doh.register( | ||
"pluginNormalize", | ||
[ | ||
function pluginNormalize(t){ | ||
t.is("hello.xyz", hello); | ||
t.is("world.xyz", world); | ||
} | ||
] | ||
); | ||
|
||
doh.run(); | ||
} | ||
); | ||
|
||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>require.js: Plugin Normalize Test</h1> | ||
<p>Check console for messages</p> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
define(function() { | ||
return { | ||
load: function(name, parentRequire, onload, config) { | ||
onload(name); | ||
}, | ||
normalize: function(name, normalize) { | ||
return name + '.xyz'; | ||
} | ||
} | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>require.js: Remote URL Test</title> | ||
<script type="text/javascript" src="../../require.js"></script> | ||
<script type="text/javascript" src="../doh/runner.js"></script> | ||
<script type="text/javascript" src="../doh/_browserRunner.js"></script> | ||
<script type="text/javascript"> | ||
require({ | ||
baseUrl: "./" | ||
}, | ||
["Plugin!hello", "Plugin!world"], | ||
function(hello, world) { | ||
doh.register( | ||
"pluginNormalizeLoad", | ||
[ | ||
function pluginNormalizeLoad(t){ | ||
t.is("hello.xyz", hello); | ||
t.is("world.xyz", world); | ||
} | ||
] | ||
); | ||
|
||
doh.run(); | ||
} | ||
); | ||
|
||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>require.js: Plugin Normalize Test</h1> | ||
<p>Check console for messages</p> | ||
</body> | ||
</html> |