Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

If a function is referenced before it's natural insertion point, #465

Merged
merged 1 commit into from
Apr 26, 2017

Conversation

NTillmann
Copy link
Contributor

we cannot apply the optimization that emits "var f = ...bind(...); " calls.
Added positive and negative test.
This addresses #449.

While at it, reviewed some places where code emission was delayed for no reason and turned potential delaying to checking invariants.

this._delay(delayReason, [descValue], serializeFunc, mightHaveBeenDeleted);
invariant(!this._shouldDelayValues([descValue, val]), "precondition of _emitProperty");
if (mightHaveBeenDeleted) {
this._delay(true, [], serializeFunc, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This last argument does not correspond to a parameter of _delay.

// does not contain: bind
(function() {
function f() {
return function() { /* This comment makes this funciton too big to be inlined */ return 42; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funciton

@NTillmann NTillmann force-pushed the Issue449 branch 2 times, most recently from 58e0937 to c6b4f50 Compare April 26, 2017 20:18
we cannot apply the optimization that emits "var f = ...bind(...); " calls.
Added positive and negative test.

While at it, reviewed some places where code emission was delayed for no reason.
@NTillmann NTillmann merged commit 918f78c into master Apr 26, 2017
@NTillmann NTillmann deleted the Issue449 branch April 26, 2017 23:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants