3.0 source code
This commit is contained in:
5
OfficeWeb/vendor/requirejs/tests/shim/a.js
vendored
Normal file
5
OfficeWeb/vendor/requirejs/tests/shim/a.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(function (root) {
|
||||
root.A = {
|
||||
name: 'a'
|
||||
};
|
||||
}(this));
|
||||
5
OfficeWeb/vendor/requirejs/tests/shim/b.js
vendored
Normal file
5
OfficeWeb/vendor/requirejs/tests/shim/b.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var B = {
|
||||
name: 'b',
|
||||
aValue: A.name,
|
||||
dValue: new D()
|
||||
};
|
||||
56
OfficeWeb/vendor/requirejs/tests/shim/basic-tests.js
vendored
Normal file
56
OfficeWeb/vendor/requirejs/tests/shim/basic-tests.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
require({
|
||||
baseUrl: './',
|
||||
shim: {
|
||||
a: {
|
||||
exports: 'A.name',
|
||||
init: function () {
|
||||
window.globalA = this.A.name;
|
||||
}
|
||||
},
|
||||
'b': ['a', 'd'],
|
||||
'c': {
|
||||
deps: ['a', 'b'],
|
||||
exports: 'C'
|
||||
},
|
||||
'e': {
|
||||
exports: 'e.nested.e',
|
||||
init: function () {
|
||||
return {
|
||||
name: e.nested.e.name + 'Modified'
|
||||
};
|
||||
}
|
||||
},
|
||||
'f': {
|
||||
deps: ['a'],
|
||||
init: function (a) {
|
||||
return {
|
||||
name: FCAP.name,
|
||||
globalA: FCAP.globalA,
|
||||
a: a
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'c', 'e', 'f'],
|
||||
function(a, c, e, f) {
|
||||
doh.register(
|
||||
'shimBasic',
|
||||
[
|
||||
function shimBasic(t){
|
||||
t.is('a', a);
|
||||
t.is('a', window.globalA);
|
||||
t.is('a', c.b.aValue);
|
||||
t.is('b', c.b.name);
|
||||
t.is('c', c.name);
|
||||
t.is('d', c.b.dValue.name);
|
||||
t.is('eModified', e.name);
|
||||
t.is('FCAP', f.name);
|
||||
t.is('a', f.globalA.name);
|
||||
t.is('a', f.a);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
15
OfficeWeb/vendor/requirejs/tests/shim/basic.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/shim/basic.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Basic Shim 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" src="basic-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Basic Shim Test</h1>
|
||||
<p>Basic test of the shim config support.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
16
OfficeWeb/vendor/requirejs/tests/shim/built/basic-built.html
vendored
Normal file
16
OfficeWeb/vendor/requirejs/tests/shim/built/basic-built.html
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Basic Built Shim 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" src="basic-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Basic Built Shim Test</h1>
|
||||
<p>Basic test of the shim config support in built form.</p>
|
||||
<p>Be sure to run the build via r.js to get the latest code in the test.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
144
OfficeWeb/vendor/requirejs/tests/shim/built/basic-tests.js
vendored
Normal file
144
OfficeWeb/vendor/requirejs/tests/shim/built/basic-tests.js
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
|
||||
(function (root) {
|
||||
root.A = {
|
||||
name: 'a'
|
||||
};
|
||||
}(this));
|
||||
|
||||
define("a", (function (global) {
|
||||
return function () {
|
||||
var ret, fn;
|
||||
fn = function () {
|
||||
window.globalA = this.A.name;
|
||||
};
|
||||
ret = fn.apply(global, arguments);
|
||||
return ret || global.A.name;
|
||||
};
|
||||
}(this)));
|
||||
|
||||
function D() {
|
||||
this.name = 'd';
|
||||
};
|
||||
|
||||
define("d", function(){});
|
||||
|
||||
var B = {
|
||||
name: 'b',
|
||||
aValue: A.name,
|
||||
dValue: new D()
|
||||
};
|
||||
|
||||
define("b", function(){});
|
||||
|
||||
var C = {
|
||||
name: 'c',
|
||||
a: A,
|
||||
b: B
|
||||
};
|
||||
|
||||
define("c", ["a","b"], (function (global) {
|
||||
return function () {
|
||||
var ret, fn;
|
||||
return ret || global.C;
|
||||
};
|
||||
}(this)));
|
||||
|
||||
var e = {
|
||||
nested: {
|
||||
e: {
|
||||
name: 'e'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
define("e", (function (global) {
|
||||
return function () {
|
||||
var ret, fn;
|
||||
fn = function () {
|
||||
return {
|
||||
name: e.nested.e.name + 'Modified'
|
||||
};
|
||||
};
|
||||
ret = fn.apply(global, arguments);
|
||||
return ret || global.e.nested.e;
|
||||
};
|
||||
}(this)));
|
||||
|
||||
var FCAP = {
|
||||
name: 'FCAP',
|
||||
globalA: A
|
||||
};
|
||||
|
||||
define("f", ["a"], (function (global) {
|
||||
return function () {
|
||||
var ret, fn;
|
||||
fn = function (a) {
|
||||
return {
|
||||
name: FCAP.name,
|
||||
globalA: FCAP.globalA,
|
||||
a: a
|
||||
};
|
||||
};
|
||||
ret = fn.apply(global, arguments);
|
||||
return ret;
|
||||
};
|
||||
}(this)));
|
||||
|
||||
require({
|
||||
baseUrl: './',
|
||||
shim: {
|
||||
a: {
|
||||
exports: 'A.name',
|
||||
init: function () {
|
||||
window.globalA = this.A.name;
|
||||
}
|
||||
},
|
||||
'b': ['a', 'd'],
|
||||
'c': {
|
||||
deps: ['a', 'b'],
|
||||
exports: 'C'
|
||||
},
|
||||
'e': {
|
||||
exports: 'e.nested.e',
|
||||
init: function () {
|
||||
return {
|
||||
name: e.nested.e.name + 'Modified'
|
||||
};
|
||||
}
|
||||
},
|
||||
'f': {
|
||||
deps: ['a'],
|
||||
init: function (a) {
|
||||
return {
|
||||
name: FCAP.name,
|
||||
globalA: FCAP.globalA,
|
||||
a: a
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'c', 'e', 'f'],
|
||||
function(a, c, e, f) {
|
||||
doh.register(
|
||||
'shimBasic',
|
||||
[
|
||||
function shimBasic(t){
|
||||
t.is('a', a);
|
||||
t.is('a', window.globalA);
|
||||
t.is('a', c.b.aValue);
|
||||
t.is('b', c.b.name);
|
||||
t.is('c', c.name);
|
||||
t.is('d', c.b.dValue.name);
|
||||
t.is('eModified', e.name);
|
||||
t.is('FCAP', f.name);
|
||||
t.is('a', f.globalA.name);
|
||||
t.is('a', f.a);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
|
||||
define("basic-tests", function(){});
|
||||
5
OfficeWeb/vendor/requirejs/tests/shim/c.js
vendored
Normal file
5
OfficeWeb/vendor/requirejs/tests/shim/c.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var C = {
|
||||
name: 'c',
|
||||
a: A,
|
||||
b: B
|
||||
};
|
||||
3
OfficeWeb/vendor/requirejs/tests/shim/d.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/shim/d.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
function D() {
|
||||
this.name = 'd';
|
||||
};
|
||||
7
OfficeWeb/vendor/requirejs/tests/shim/e.js
vendored
Normal file
7
OfficeWeb/vendor/requirejs/tests/shim/e.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
var e = {
|
||||
nested: {
|
||||
e: {
|
||||
name: 'e'
|
||||
}
|
||||
}
|
||||
};
|
||||
4
OfficeWeb/vendor/requirejs/tests/shim/f.js
vendored
Normal file
4
OfficeWeb/vendor/requirejs/tests/shim/f.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var FCAP = {
|
||||
name: 'FCAP',
|
||||
globalA: A
|
||||
};
|
||||
Reference in New Issue
Block a user