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

Side by Side Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 10910142: Issue 4988. Fixe for 'assert' statement vs function resolving (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for artificial 'assert' function name Created 8 years, 3 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 | « no previous file | compiler/java/com/google/dart/compiler/resolver/Elements.java » ('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 package com.google.dart.compiler; 5 package com.google.dart.compiler;
6 6
7 import com.google.common.collect.Lists; 7 import com.google.common.collect.Lists;
8 import com.google.common.collect.Maps; 8 import com.google.common.collect.Maps;
9 import com.google.common.collect.Sets; 9 import com.google.common.collect.Sets;
10 import com.google.common.collect.Sets.SetView; 10 import com.google.common.collect.Sets.SetView;
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 String srcCode; 852 String srcCode;
853 boolean failed = true; 853 boolean failed = true;
854 try { 854 try {
855 try { 855 try {
856 srcCode = CharStreams.toString(r); 856 srcCode = CharStreams.toString(r);
857 failed = false; 857 failed = false;
858 } finally { 858 } finally {
859 Closeables.close(r, failed); 859 Closeables.close(r, failed);
860 } 860 }
861 861
862 // auto-magically define "assert" function 862 // auto-magically define function to use instead of "assert" statement
863 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) { 863 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) {
864 srcCode += "\nvoid assert(x) {}"; 864 srcCode += "\nvoid " + Elements.ASSERT_FUNCTION_NAME + "(x) {}";
865 } 865 }
866 866
867 // inject "Type" type from 1.0 M1 specification 867 // inject "Type" type from 1.0 M1 specification
868 // remove once it will be added into SDK 868 // remove once it will be added into SDK
869 // http://code.google.com/p/dart/issues/detail?id=3368 869 // http://code.google.com/p/dart/issues/detail?id=3368
870 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) { 870 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) {
871 srcCode += "\nclass Type {}"; 871 srcCode += "\nclass Type {}";
872 } 872 }
873 873
874 DartParser parser = new DartParser(dartSrc, srcCode, diet, libraryPrefix es, context, 874 DartParser parser = new DartParser(dartSrc, srcCode, diet, libraryPrefix es, context,
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 return br.readLine(); 1392 return br.readLine();
1393 } finally { 1393 } finally {
1394 br.close(); 1394 br.close();
1395 } 1395 }
1396 } 1396 }
1397 } catch (Throwable e) { 1397 } catch (Throwable e) {
1398 } 1398 }
1399 return null; 1399 return null;
1400 } 1400 }
1401 } 1401 }
OLDNEW
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Elements.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698