Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: frog/world.dart

Issue 9352016: Fix split with regexp for frog. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move regexp-split test into separate file. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/lib/string_implementation.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** The one true [World]. */ 5 /** The one true [World]. */
6 World world; 6 World world;
7 7
8 /** 8 /**
9 * Experimental phase to enable await, only set when using the 9 * Experimental phase to enable await, only set when using the
10 * await/awaitc.dart entrypoint. 10 * await/awaitc.dart entrypoint.
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 // TODO(jmesserly): this doesn't work if I write "new Set<String>.from" 323 // TODO(jmesserly): this doesn't work if I write "new Set<String>.from"
324 // List of JS reserved words. 324 // List of JS reserved words.
325 _jsKeywords = new Set.from([ 325 _jsKeywords = new Set.from([
326 'break', 'case', 'catch', 'continue', 'debugger', 'default', 326 'break', 'case', 'catch', 'continue', 'debugger', 'default',
327 'delete', 'do', 'else', 'finally', 'for', 'function', 'if', 327 'delete', 'do', 'else', 'finally', 'for', 'function', 'if',
328 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw', 328 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw',
329 'try', 'typeof', 'var', 'void', 'while', 'with', 329 'try', 'typeof', 'var', 'void', 'while', 'with',
330 'class', 'enum', 'export', 'extends', 'import', 'super', 330 'class', 'enum', 'export', 'extends', 'import', 'super',
331 'implements', 'interface', 'let', 'package', 'private', 331 'implements', 'interface', 'let', 'package', 'private',
332 'protected', 'public', 'static', 'yield', 332 'protected', 'public', 'static', 'yield',
333 // Hack: we don't want Dart's String.split to overwrite the existing
334 // JS String.split method. By adding 'split' to the keyword-set we
335 // ensure that frog will not use the 'split' name but mangle it, thus
336 // leaving the original JS String.split untouched.
337 'split',
333 'native']); 338 'native']);
334 } 339 }
335 if (_jsKeywords.contains(name)) { 340 if (_jsKeywords.contains(name)) {
336 return name + '_'; 341 return name + '_';
337 } else { 342 } else {
338 // regexs for better perf? 343 // regexs for better perf?
339 return name.replaceAll(@'$', @'$$').replaceAll(':', @'$'); 344 return name.replaceAll(@'$', @'$$').replaceAll(':', @'$');
340 } 345 }
341 } 346 }
342 347
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 624
620 withTiming(String name, f()) { 625 withTiming(String name, f()) {
621 final sw = new Stopwatch(); 626 final sw = new Stopwatch();
622 sw.start(); 627 sw.start();
623 var result = f(); 628 var result = f();
624 sw.stop(); 629 sw.stop();
625 info('$name in ${sw.elapsedInMs()}msec'); 630 info('$name in ${sw.elapsedInMs()}msec');
626 return result; 631 return result;
627 } 632 }
628 } 633 }
OLDNEW
« no previous file with comments | « frog/lib/string_implementation.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698