Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 80 lines (73 sloc) 1.885 kB
2c97b1b @briancavalier Implemented useNew option for create factory to force the module to b…
authored
1 <!DOCTYPE HTML>
2 <html lang="en-US">
3 <head>
4 <meta charset="UTF-8">
5 <title>Launcher test</title>
6
7 <script type="text/javascript" src="util/doh/runner.js"></script>
8
9 <script>
10 require = { debug: true, baseUrl: '../', paths: { curl: 'curl/src/curl' } };
11 </script>
12 <script src="../curl/src/curl.js" type="text/javascript" charset="utf-8"></script>
13
14 <script type="text/javascript">
15 define('no-prototype-constructor', [], function() {
16 function Constructor(name) {
17 this.name = name;
18 this.foo = "bar";
19 }
20
21 return Constructor;
22 });
23
24 require(['wire'], function(wire) {
25 wire({
26 // test1 should should be called as a constructor using new
4535a02 @briancavalier Fixed listener proxy handling, all unit tests passing again
authored
27 test1: {
28 create: {
29 module: 'no-prototype-constructor',
30 isConstructor: true
31 }
32 },
33 // test2 should should be called as a constructor using new
34 test2: {
35 create: {
36 module: 'no-prototype-constructor',
37 args: 'test2',
38 isConstructor: true
39 }
40 },
2c97b1b @briancavalier Implemented useNew option for create factory to force the module to b…
authored
41 // test3 should be undefined, since wire.js will guess
42 // incorrectly that Constructor is supposed to be called
43 // as a regular function rather than with new.
44 test3: {
45 create: {
46 module: 'no-prototype-constructor',
7dea8ef @briancavalier Initial working version of aop weaving. Still need to consider anoth…
authored
47 args: 'test2'
2c97b1b @briancavalier Implemented useNew option for create factory to force the module to b…
authored
48 }
49 }
50
51 }).then(
52 function(context) {
53 var undef;
54
55 doh.register('create-constructor', [
4535a02 @briancavalier Fixed listener proxy handling, all unit tests passing again
authored
56 function(doh) {
57 doh.assertTrue(context.test1 !== undef);
58 doh.assertEqual(undef, context.test1.name);
59 doh.assertEqual('bar', context.test1.foo);
60 },
61 function(doh) {
62 doh.assertTrue(context.test2 !== undef);
63 doh.assertEqual('test2', context.test2.name);
64 doh.assertEqual('bar', context.test2.foo);
65 },
2c97b1b @briancavalier Implemented useNew option for create factory to force the module to b…
authored
66 function(doh) {
67 doh.assertEqual(undef, context.test3);
68 }
69 ]);
70 doh.run();
71 },
72 function(err) {
73 }
74 );
75 });
76 </script>
77 </head>
78 <body>
79 </body>
80 </html>
Something went wrong with that request. Please try again.