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

Unified Diff: lib/json/json.dart

Issue 10391139: Add a check to JSON code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « no previous file | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/json/json.dart
===================================================================
--- lib/json/json.dart (revision 7658)
+++ lib/json/json.dart (working copy)
@@ -107,6 +107,10 @@
static objectLength(String str) {
var p = new _JsonParser._internal(str);
+ var firstToken = p._token();
+ if (firstToken != LBRACE) {
+ return 0;
+ }
try {
p._parseObject();
assert(p.position <= p.length);
« no previous file with comments | « no previous file | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698