Skip to content

Commit

Permalink
optimize alias
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Sep 16, 2014
1 parent 3000268 commit 025e53c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
26 changes: 8 additions & 18 deletions meta/alias.js
@@ -1,18 +1,8 @@
(function () {
function init(UA, Feature) {
modulex.config('alias', {
'modulex-dom': 'dom',
'dom/selector': Feature.isQuerySelectorSupported() ? '' : 'query-selector',
dom: [
'dom/base',
UA.ieMode < 9 ? 'dom/ie' : ''
]
});
}

if (typeof UA !== 'undefined') {
init(UA, Feature);
} else {
modulex.use(['modulex-ua', 'modulex-feature'], init);
}
})();
modulex.config('alias', {
'modulex-dom': 'dom',
'dom/selector': Feature.isQuerySelectorSupported() ? '' : 'query-selector',
dom: [
'dom/base',
UA.ieMode < 9 ? 'dom/ie' : ''
]
});
8 changes: 7 additions & 1 deletion tests/runner.html
Expand Up @@ -32,7 +32,13 @@ <h1 style="text-align: center">dom tests</h1>
<script src="/bower_components/simulate-dom-event/index.js"></script>
<script src="/bower_components/querystring/build/querystring-debug.js"></script>
<script src="/bower_components/querystring/meta/alias.js"></script>

<script>
var UA, Feature;
modulex.use(['ua', 'feature'], function (UAx, Featurex) {
UA = UAx;
Feature = Featurex;
});
</script>
<script src="/meta/alias.js"></script>
<script src="/node_modules/node-jscover/lib/front-end/header.js"></script>
<script src="/node_modules/node-jscover/lib/front-end/jscoverage-branch.js"></script>
Expand Down

0 comments on commit 025e53c

Please sign in to comment.