Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement teeing, plus a bunch of stage-setting tweaks #311

Merged
merged 7 commits into from
Apr 6, 2015
378 changes: 290 additions & 88 deletions index.bs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions reference-implementation/lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ export function toInteger(v) {
return Math.floor(Math.abs(v));
}

export function createDataProperty(o, p, v) {
assert(typeIsObject(o));
Object.defineProperty(o, p, { value: v, writable: true, enumerable: true, configurable: true });
}

export function createArrayFromList(elements) {
// We use arrays to represent lists, so this is basically a no-op.
// Do a slice though just in case we happen to depend on the unique-ness.
return elements.slice();
}

export function CreateIterResultObject(value, done) {
assert(typeof done === 'boolean');
const obj = {};
Expand Down