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

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: 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') | dart/frog/leg/lib/mockimpl.dart » ('J')
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) element = element.enclosingElement;
kasperl 2012/02/17 06:03:31 Maybe add a comment on when this happens? What kin
ahe 2012/02/17 07:40:47 I'm not sure this API is where I want it. For exam
ngeoffray 2012/02/17 10:03:50 The thing is, the backend should not cancel on ele
ahe 2012/02/17 16:26:46 Nicolas and I went back to the drawing board, and
111 withCurrentElement(element, 112 withCurrentElement(element,
112 () => cancel(reason: reason, token: element.position())); 113 () => cancel(reason: reason, token: element.position()));
113 } 114 }
114 if (throwOnError) { 115 if (throwOnError) {
115 throw new AbortLeg(reason); 116 throw new AbortLeg(reason);
116 } 117 }
117 super.cancel(reason, node, token, instruction); 118 super.cancel(reason, node, token, instruction);
118 } 119 }
119 } 120 }
120 121
121 class AbortLeg { 122 class AbortLeg {
122 final message; 123 final message;
123 AbortLeg(this.message); 124 AbortLeg(this.message);
124 toString() => 'Aborted due to --throw-on-error: $message'; 125 toString() => 'Aborted due to --throw-on-error: $message';
125 } 126 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/lib/core.dart » ('j') | dart/frog/leg/lib/mockimpl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698