Cross Reference: /yui3/src/oop/tests/clone.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore<!DOCTYPE html>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore<html>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore<head>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore <title>YUI 3.2.0 Cloning Event kills window.undefined</title>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore</head>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore<body lang="en-US" class="yui3-skin-sam">
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore <h1>Y.clone bug w/ events</h1>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore<!--
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore <script type="text/javascript" src="http://yui.yahooapis.com/combo?3.1.1/build/yui/yui-min.js"></script>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore -->
162f907b0bc058a5ddc4abb9d96487a7e8054234Adam Moore <script type="text/javascript" src="/build/yui/yui-min.js"></script>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore <script type="text/javascript">
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore YUI({
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore combine: false,
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore filter: "raw"
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore }).use("dump", "test", "node", "event", "console", function(Y) {
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore var ev = Y.on("click", function(e) {
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore //no-op
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore }, "#h1");
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore // var ev = Y.on('fooboo', function(e) { });
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore var r = new Y.Console({
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore verbose : true,
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore newestOnTop : false,
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore height: '600px',
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore width: "500px"
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore }).render();
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore Y.Test.Runner.add(new Y.Test.Case({
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore "window.undefined should start out undefined" : function() {
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore Y.assert(typeof window.undefined === "undefined");
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore },
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore "window.undefined should still be undefined after cloning an event" : function() {
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore Y.clone(ev);
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore
162f907b0bc058a5ddc4abb9d96487a7e8054234Adam Moore Y.log(window.undefined);
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore Y.assert(typeof window.undefined === "undefined");
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore }
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore })).run();
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore });
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore </script>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore</body>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore</html>
8937a951a5b33866be1a34bb88e53f030c880468Adam Moore