]>
Commit | Line | Data |
---|---|---|
c6060300 MT |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.256 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.256 | |
11 | Problem: Javascript indenting not sufficiently tested. | |
12 | Solution: Add more tests. (Luc Deschenaux) Mark the lines that are indented | |
13 | wrong. | |
14 | Files: src/testdir/test3.in, src/testdir/test3.ok | |
15 | ||
16 | ||
17 | *** ../vim-7.3.255/src/testdir/test3.in 2011-07-15 14:12:25.000000000 +0200 | |
18 | --- src/testdir/test3.in 2011-07-15 21:05:49.000000000 +0200 | |
19 | *************** | |
20 | *** 1592,1598 **** | |
21 | ||
22 | ||
23 | STARTTEST | |
24 | ! :set cino=J1 | |
25 | /^JSSTART | |
26 | =/^JSEND | |
27 | ENDTEST | |
28 | --- 1592,1598 ---- | |
29 | ||
30 | ||
31 | STARTTEST | |
32 | ! :set cino=j1,J1 | |
33 | /^JSSTART | |
34 | =/^JSEND | |
35 | ENDTEST | |
36 | *************** | |
37 | *** 1613,1618 **** | |
38 | --- 1613,1757 ---- | |
39 | JSEND | |
40 | ||
41 | STARTTEST | |
42 | + :set cino=j1,J1 | |
43 | + /^JSSTART | |
44 | + =/^JSEND | |
45 | + ENDTEST | |
46 | + | |
47 | + JSSTART | |
48 | + var foo = [ | |
49 | + 1, // indent 8 more | |
50 | + 2, | |
51 | + 3 | |
52 | + ]; // indent 8 less | |
53 | + JSEND | |
54 | + | |
55 | + STARTTEST | |
56 | + :set cino=j1,J1 | |
57 | + /^JSSTART | |
58 | + =/^JSEND | |
59 | + ENDTEST | |
60 | + | |
61 | + JSSTART | |
62 | + function bar() { | |
63 | + var foo = [ | |
64 | + 1, | |
65 | + 2, | |
66 | + 3 | |
67 | + ]; // indent 16 less | |
68 | + } | |
69 | + JSEND | |
70 | + | |
71 | + STARTTEST | |
72 | + :set cino=j1,J1 | |
73 | + /^JSSTART | |
74 | + =/^JSEND | |
75 | + ENDTEST | |
76 | + | |
77 | + JSSTART | |
78 | + (function($){ | |
79 | + | |
80 | + var class_name='myclass'; | |
81 | + | |
82 | + function private_method() { | |
83 | + } | |
84 | + | |
85 | + var public_method={ | |
86 | + method: function(options,args){ | |
87 | + private_method(); | |
88 | + } | |
89 | + } | |
90 | + | |
91 | + function init(options) { | |
92 | + | |
93 | + $(this).data(class_name+'_public',$.extend({},{ | |
94 | + foo: 'bar', | |
95 | + bar: 2, // indent 8 more | |
96 | + foobar: [ // indent 8 more | |
97 | + 1, // indent 8 more | |
98 | + 2, // indent 16 more | |
99 | + 3 // indent 16 more | |
100 | + ], | |
101 | + callback: function(){ // indent 8 more | |
102 | + return true; // indent 8 more | |
103 | + } // indent 8 more | |
104 | + }, options||{})); | |
105 | + } | |
106 | + | |
107 | + $.fn[class_name]=function() { | |
108 | + | |
109 | + var _arguments=arguments; | |
110 | + return this.each(function(){ | |
111 | + | |
112 | + var options=$(this).data(class_name+'_public'); | |
113 | + if (!options) { | |
114 | + init.apply(this,_arguments); | |
115 | + | |
116 | + } else { | |
117 | + var method=public_method[_arguments[0]]; | |
118 | + | |
119 | + if (typeof(method)!='function') { | |
120 | + console.log(class_name+' has no method "'+_arguments[0]+'"'); | |
121 | + return false; | |
122 | + } | |
123 | + _arguments[0]=options; | |
124 | + method.apply(this,_arguments); | |
125 | + } | |
126 | + }); | |
127 | + } | |
128 | + | |
129 | + })(jQuery); | |
130 | + JSEND | |
131 | + | |
132 | + STARTTEST | |
133 | + :set cino=j1,J1 | |
134 | + /^JSSTART | |
135 | + =/^JSEND | |
136 | + ENDTEST | |
137 | + | |
138 | + JSSTART | |
139 | + function init(options) { | |
140 | + $(this).data(class_name+'_public',$.extend({},{ | |
141 | + foo: 'bar', | |
142 | + bar: 2, | |
143 | + foobar: [ | |
144 | + 1, // indent 8 more | |
145 | + 2, // indent 8 more | |
146 | + 3 // indent 8 more | |
147 | + ], | |
148 | + callback: function(){ | |
149 | + return true; | |
150 | + } | |
151 | + }, options||{})); | |
152 | + } | |
153 | + JSEND | |
154 | + | |
155 | + STARTTEST | |
156 | + :set cino=j1,J1 | |
157 | + /^JSSTART | |
158 | + =/^JSEND | |
159 | + ENDTEST | |
160 | + | |
161 | + JSSTART | |
162 | + (function($){ | |
163 | + function init(options) { | |
164 | + $(this).data(class_name+'_public',$.extend({},{ | |
165 | + foo: 'bar', | |
166 | + bar: 2, // indent 8 more | |
167 | + foobar: [ // indent 8 more | |
168 | + 1, // indent 8 more | |
169 | + 2, // indent 16 more | |
170 | + 3 // indent 16 more | |
171 | + ], | |
172 | + callback: function(){ // indent 8 more | |
173 | + return true; // indent 8 more | |
174 | + } // indent 8 more | |
175 | + }, options||{})); | |
176 | + } | |
177 | + })(jQuery); | |
178 | + JSEND | |
179 | + | |
180 | + STARTTEST | |
181 | :g/^STARTTEST/.,/^ENDTEST/d | |
182 | :1;/start of AUTO/,$wq! test.out | |
183 | ENDTEST | |
184 | *** ../vim-7.3.255/src/testdir/test3.ok 2011-07-15 14:12:25.000000000 +0200 | |
185 | --- src/testdir/test3.ok 2011-07-15 21:06:38.000000000 +0200 | |
186 | *************** | |
187 | *** 1443,1445 **** | |
188 | --- 1443,1559 ---- | |
189 | } | |
190 | JSEND | |
191 | ||
192 | + | |
193 | + JSSTART | |
194 | + var foo = [ | |
195 | + 1, // indent 8 more | |
196 | + 2, | |
197 | + 3 | |
198 | + ]; // indent 8 less | |
199 | + JSEND | |
200 | + | |
201 | + | |
202 | + JSSTART | |
203 | + function bar() { | |
204 | + var foo = [ | |
205 | + 1, | |
206 | + 2, | |
207 | + 3 | |
208 | + ]; // indent 16 less | |
209 | + } | |
210 | + JSEND | |
211 | + | |
212 | + | |
213 | + JSSTART | |
214 | + (function($){ | |
215 | + | |
216 | + var class_name='myclass'; | |
217 | + | |
218 | + function private_method() { | |
219 | + } | |
220 | + | |
221 | + var public_method={ | |
222 | + method: function(options,args){ | |
223 | + private_method(); | |
224 | + } | |
225 | + } | |
226 | + | |
227 | + function init(options) { | |
228 | + | |
229 | + $(this).data(class_name+'_public',$.extend({},{ | |
230 | + foo: 'bar', | |
231 | + bar: 2, // indent 8 more | |
232 | + foobar: [ // indent 8 more | |
233 | + 1, // indent 8 more | |
234 | + 2, // indent 16 more | |
235 | + 3 // indent 16 more | |
236 | + ], | |
237 | + callback: function(){ // indent 8 more | |
238 | + return true; // indent 8 more | |
239 | + } // indent 8 more | |
240 | + }, options||{})); | |
241 | + } | |
242 | + | |
243 | + $.fn[class_name]=function() { | |
244 | + | |
245 | + var _arguments=arguments; | |
246 | + return this.each(function(){ | |
247 | + | |
248 | + var options=$(this).data(class_name+'_public'); | |
249 | + if (!options) { | |
250 | + init.apply(this,_arguments); | |
251 | + | |
252 | + } else { | |
253 | + var method=public_method[_arguments[0]]; | |
254 | + | |
255 | + if (typeof(method)!='function') { | |
256 | + console.log(class_name+' has no method "'+_arguments[0]+'"'); | |
257 | + return false; | |
258 | + } | |
259 | + _arguments[0]=options; | |
260 | + method.apply(this,_arguments); | |
261 | + } | |
262 | + }); | |
263 | + } | |
264 | + | |
265 | + })(jQuery); | |
266 | + JSEND | |
267 | + | |
268 | + | |
269 | + JSSTART | |
270 | + function init(options) { | |
271 | + $(this).data(class_name+'_public',$.extend({},{ | |
272 | + foo: 'bar', | |
273 | + bar: 2, | |
274 | + foobar: [ | |
275 | + 1, // indent 8 more | |
276 | + 2, // indent 8 more | |
277 | + 3 // indent 8 more | |
278 | + ], | |
279 | + callback: function(){ | |
280 | + return true; | |
281 | + } | |
282 | + }, options||{})); | |
283 | + } | |
284 | + JSEND | |
285 | + | |
286 | + | |
287 | + JSSTART | |
288 | + (function($){ | |
289 | + function init(options) { | |
290 | + $(this).data(class_name+'_public',$.extend({},{ | |
291 | + foo: 'bar', | |
292 | + bar: 2, // indent 8 more | |
293 | + foobar: [ // indent 8 more | |
294 | + 1, // indent 8 more | |
295 | + 2, // indent 16 more | |
296 | + 3 // indent 16 more | |
297 | + ], | |
298 | + callback: function(){ // indent 8 more | |
299 | + return true; // indent 8 more | |
300 | + } // indent 8 more | |
301 | + }, options||{})); | |
302 | + } | |
303 | + })(jQuery); | |
304 | + JSEND | |
305 | + | |
306 | *** ../vim-7.3.255/src/version.c 2011-07-20 15:04:52.000000000 +0200 | |
307 | --- src/version.c 2011-07-20 15:08:13.000000000 +0200 | |
308 | *************** | |
309 | *** 711,712 **** | |
310 | --- 711,714 ---- | |
311 | { /* Add new patch number below this line */ | |
312 | + /**/ | |
313 | + 256, | |
314 | /**/ | |
315 | ||
316 | -- | |
317 | Not too long ago, a keyboard was something to make music with... | |
318 | ||
319 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
320 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
321 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
322 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |