From 8e3c0a5749feea962691577379ce6b64d0494d9e Mon Sep 17 00:00:00 2001 From: cpojer Date: Thu, 24 Oct 2013 10:10:53 -0700 Subject: [PATCH] Fixing some minor code style issues in the runtime. --- runtime/dev.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/dev.js b/runtime/dev.js index 4eb678ef069c..1b381ac721f9 100644 --- a/runtime/dev.js +++ b/runtime/dev.js @@ -34,13 +34,14 @@ function Generator(innerFn, self) { var generator = this; - var context = new Context; + var context = new Context(); var state = GenStateSuspendedStart; function invoke() { state = GenStateExecuting; - do var value = innerFn.call(self, context); - while (value === ContinueSentinel); + do { + var value = innerFn.call(self, context); + } while (value === ContinueSentinel); // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done @@ -126,8 +127,8 @@ // class optimizations for simple generators. var tempIndex = 0; var tempName; - while (tempName = "t" + tempIndex, // N.B. Comma operator! - tempIndex < 20 || hasOwn.call(this, tempName)) { + while ((tempName = "t" + tempIndex) && + (tempIndex < 20 || hasOwn.call(this, tempName))) { this[tempName] = null; ++tempIndex; }