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

Side by Side Diff: dart/frog/leg/frog_leg.dart

Issue 9417031: Mock up all remaining core library implementation classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments 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 | « no previous file | dart/frog/leg/lib/core.dart » ('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 #library('frog_leg'); 5 #library('frog_leg');
6 6
7 #import('../../lib/uri/uri.dart'); 7 #import('../../lib/uri/uri.dart');
8 #import('../lang.dart', prefix: 'frog'); 8 #import('../lang.dart', prefix: 'frog');
9 #import('elements/elements.dart'); 9 #import('elements/elements.dart');
10 #import('io/io.dart', prefix: 'io'); 10 #import('io/io.dart', prefix: 'io');
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 Script script = currentScript(); 101 Script script = currentScript();
102 if (node !== null) { 102 if (node !== null) {
103 print(spanFromNode(node, script).toMessageString("cancel leg: $reason")); 103 print(spanFromNode(node, script).toMessageString("cancel leg: $reason"));
104 } else if (token !== null) { 104 } else if (token !== null) {
105 String tokenString = token.toString(); 105 String tokenString = token.toString();
106 int begin = token.charOffset; 106 int begin = token.charOffset;
107 int end = begin + tokenString.length; 107 int end = begin + tokenString.length;
108 print(script.file.getLocationMessage("cancel leg: $reason", 108 print(script.file.getLocationMessage("cancel leg: $reason",
109 begin, end, true)); 109 begin, end, true));
110 } else if (element !== null) { 110 } else if (element !== null) {
111 if (element.position() === null) {
112 // Sometimes, the backend fakes up elements that have no
113 // position. So we use the enclosing element instead. It is
114 // not a good error location, but cancel really is "internal
115 // error" or "not implemented yet", so the vicinity is good
116 // enough for now.
117 element = element.enclosingElement;
118 // TODO(ahe): I plan to overhaul this infrastructure anyways.
119 }
111 withCurrentElement(element, 120 withCurrentElement(element,
112 () => cancel(reason: reason, token: element.position())); 121 () => cancel(reason: reason, token: element.position()));
113 } 122 }
114 if (throwOnError) { 123 if (throwOnError) {
115 throw new AbortLeg(reason); 124 throw new AbortLeg(reason);
116 } 125 }
117 super.cancel(reason, node, token, instruction); 126 super.cancel(reason, node, token, instruction);
118 } 127 }
119 } 128 }
120 129
121 class AbortLeg { 130 class AbortLeg {
122 final message; 131 final message;
123 AbortLeg(this.message); 132 AbortLeg(this.message);
124 toString() => 'Aborted due to --throw-on-error: $message'; 133 toString() => 'Aborted due to --throw-on-error: $message';
125 } 134 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/lib/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698