|
11 | 11 |
|
12 | 12 | namespace dart { |
13 | 13 |
|
| 14 | +#if !defined(DART_PRECOMPILED_RUNTIME) |
14 | 15 | // Scan the stack until we hit the first function in the _AssertionError |
15 | 16 | // class. We then return the next frame's script taking inlining into account. |
16 | 17 | static ScriptPtr FindScript(DartFrameIterator* iterator) { |
17 | | -#if defined(DART_PRECOMPILED_RUNTIME) |
18 | | - // The precompiled runtime faces two issues in recovering the correct |
19 | | - // assertion text. First, the precompiled runtime does not include |
20 | | - // the inlining meta-data so we cannot walk the inline-aware stack trace. |
21 | | - // Second, the script text itself is missing so whatever script is returned |
22 | | - // from here will be missing the assertion expression text. |
23 | | - iterator->NextFrame(); // Skip _AssertionError._evaluateAssertion frame |
24 | | - return Exceptions::GetCallerScript(iterator); |
25 | | -#else |
26 | 18 | StackFrame* stack_frame = iterator->NextFrame(); |
27 | 19 | Code& code = Code::Handle(); |
28 | 20 | Function& func = Function::Handle(); |
@@ -60,15 +52,18 @@ static ScriptPtr FindScript(DartFrameIterator* iterator) { |
60 | 52 | } |
61 | 53 | UNREACHABLE(); |
62 | 54 | return Script::null(); |
63 | | -#endif // defined(DART_PRECOMPILED_RUNTIME) |
64 | 55 | } |
| 56 | +#endif // !defined(DART_PRECOMPILED_RUNTIME) |
65 | 57 |
|
66 | 58 | // Allocate and throw a new AssertionError. |
67 | 59 | // Arg0: index of the first token of the failed assertion. |
68 | 60 | // Arg1: index of the first token after the failed assertion. |
69 | 61 | // Arg2: Message object or null. |
70 | 62 | // Return value: none, throws an exception. |
71 | 63 | DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 0, 3) { |
| 64 | +#if defined(DART_PRECOMPILED_RUNTIME) |
| 65 | + UNREACHABLE(); |
| 66 | +#else |
72 | 67 | // No need to type check the arguments. This function can only be called |
73 | 68 | // internally from the VM. |
74 | 69 | const TokenPosition assertion_start = TokenPosition::Deserialize( |
@@ -114,6 +109,7 @@ DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 0, 3) { |
114 | 109 | Exceptions::ThrowByType(Exceptions::kAssertion, args); |
115 | 110 | UNREACHABLE(); |
116 | 111 | return Object::null(); |
| 112 | +#endif |
117 | 113 | } |
118 | 114 |
|
119 | 115 | // Allocate and throw a new AssertionError. |
|
0 commit comments