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

Unified Diff: pkg/js_ast/lib/src/builder.dart

Issue 1074043003: Compute default throws behavior from JavaScript. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | tests/compiler/dart2js/js_throw_behavior_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/js_ast/lib/src/builder.dart
diff --git a/pkg/js_ast/lib/src/builder.dart b/pkg/js_ast/lib/src/builder.dart
index 5d8da87f88b6f1de2f453fef6bdced2bf29cbec8..01532307bca541f7605166de7b8e7b96bf60344b 100644
--- a/pkg/js_ast/lib/src/builder.dart
+++ b/pkg/js_ast/lib/src/builder.dart
@@ -611,11 +611,14 @@ class MiniJsParser {
position++;
if (position == src.length) break;
int code = src.codeUnitAt(position);
- // Special code to disallow ! and / in non-first position in token, so
- // that !! parses as two tokens and != parses as one, while =/ parses
- // as a an equals token followed by a regexp literal start.
- newCat = (code == charCodes.$BANG || code == charCodes.$SLASH)
- ? NONE
+ // Special code to disallow !, ~ and / in non-first position in token,
+ // so that !! and ~~ parse as two tokens and != parses as one, while =/
+ // parses as a an equals token followed by a regexp literal start.
+ newCat =
+ (code == charCodes.$BANG ||
+ code == charCodes.$SLASH ||
+ code == charCodes.$TILDE)
+ ? NONE
: category(code);
} while (!singleCharCategory(cat) &&
(cat == newCat ||
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | tests/compiler/dart2js/js_throw_behavior_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698