From 052383c74ee67ae630a8cce105f620683cc41daa Mon Sep 17 00:00:00 2001 From: i10416 Date: Mon, 28 Feb 2022 23:18:38 +0900 Subject: [PATCH] chore --- lib/src/lambda_context.dart | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/src/lambda_context.dart b/lib/src/lambda_context.dart index c9eb418..2caf177 100644 --- a/lib/src/lambda_context.dart +++ b/lib/src/lambda_context.dart @@ -66,9 +66,7 @@ class LambdaContext extends m.LambdaContext with HasSource,LambdaCtxWritable { } @internal - void checkClosedOrThrow() { - if (_closed) throw _error('LambdaContext accessed outside of callback.'); - } + void checkClosedOrThrow() => _checkClosed(); @override String get source { @@ -96,11 +94,7 @@ class LambdaContext extends m.LambdaContext with HasSource,LambdaCtxWritable { final sink = StringBuffer(); // Lambdas used for sections should parse with the current delimiters. - var delimiters = '{{ }}'; - if (_node is SectionNode) { - final node = _node as SectionNode; - delimiters = node.delimiters; - } + final delimiters = _node is SectionNode ? (_node as SectionNode).delimiters : '{{ }}'; final nodes = parser.parse( source, _renderer.lenient, _renderer.templateName, delimiters);