Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 /// ----------------------------------------------------------------------- | 5 /// ----------------------------------------------------------------------- |
| 6 /// ERROR HANDLING | 6 /// ERROR HANDLING |
| 7 /// ----------------------------------------------------------------------- | 7 /// ----------------------------------------------------------------------- |
| 8 /// | 8 /// |
| 9 /// As a rule of thumb, errors that can be detected statically are handled by | 9 /// As a rule of thumb, errors that can be detected statically are handled by |
| 10 /// the frontend, typically by translating the erroneous code into a 'throw' or | 10 /// the frontend, typically by translating the erroneous code into a 'throw' or |
| (...skipping 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3154 accept(StatementVisitor v) => v.visitEmptyStatement(this); | 3154 accept(StatementVisitor v) => v.visitEmptyStatement(this); |
| 3155 accept1(StatementVisitor1 v, arg) => v.visitEmptyStatement(this, arg); | 3155 accept1(StatementVisitor1 v, arg) => v.visitEmptyStatement(this, arg); |
| 3156 | 3156 |
| 3157 visitChildren(Visitor v) {} | 3157 visitChildren(Visitor v) {} |
| 3158 transformChildren(Transformer v) {} | 3158 transformChildren(Transformer v) {} |
| 3159 } | 3159 } |
| 3160 | 3160 |
| 3161 class AssertStatement extends Statement { | 3161 class AssertStatement extends Statement { |
| 3162 Expression condition; | 3162 Expression condition; |
| 3163 Expression message; // May be null. | 3163 Expression message; // May be null. |
| 3164 int conditionStartOffset; | |
| 3165 int conditionEndOffset; | |
| 3164 | 3166 |
| 3165 AssertStatement(this.condition, [this.message]) { | 3167 AssertStatement(this.condition, [this.message]) { |
|
ahe
2017/06/16 07:41:51
Make message a named argument and the offsets as n
jensj
2017/06/16 07:43:29
Will do.
| |
| 3166 condition?.parent = this; | 3168 condition?.parent = this; |
| 3167 message?.parent = this; | 3169 message?.parent = this; |
| 3168 } | 3170 } |
| 3169 | 3171 |
| 3170 accept(StatementVisitor v) => v.visitAssertStatement(this); | 3172 accept(StatementVisitor v) => v.visitAssertStatement(this); |
| 3171 accept1(StatementVisitor1 v, arg) => v.visitAssertStatement(this, arg); | 3173 accept1(StatementVisitor1 v, arg) => v.visitAssertStatement(this, arg); |
| 3172 | 3174 |
| 3173 visitChildren(Visitor v) { | 3175 visitChildren(Visitor v) { |
| 3174 condition?.accept(v); | 3176 condition?.accept(v); |
| 3175 message?.accept(v); | 3177 message?.accept(v); |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4613 /// typedef has not been assigned a canonical name yet. | 4615 /// typedef has not been assigned a canonical name yet. |
| 4614 /// | 4616 /// |
| 4615 /// Returns `null` if the typedef is `null`. | 4617 /// Returns `null` if the typedef is `null`. |
| 4616 CanonicalName getCanonicalNameOfTypedef(Typedef typedef_) { | 4618 CanonicalName getCanonicalNameOfTypedef(Typedef typedef_) { |
| 4617 if (typedef_ == null) return null; | 4619 if (typedef_ == null) return null; |
| 4618 if (typedef_.canonicalName == null) { | 4620 if (typedef_.canonicalName == null) { |
| 4619 throw '$typedef_ has no canonical name'; | 4621 throw '$typedef_ has no canonical name'; |
| 4620 } | 4622 } |
| 4621 return typedef_.canonicalName; | 4623 return typedef_.canonicalName; |
| 4622 } | 4624 } |
| OLD | NEW |