Skip to content

Commit

Permalink
Fixing some minor code style issues in the runtime.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed Oct 24, 2013
1 parent e3c03a5 commit 8e3c0a5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions runtime/dev.js
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8e3c0a5

Please sign in to comment.