mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-09-11 14:46:37 +03:00
Fix TextPrinter by exposing assumed path conditions
This wasn't working and was failing Flow.
This commit is contained in:
parent
1b06bcec08
commit
922d40c8bd
@ -381,6 +381,10 @@ export class PathConditions {
|
||||
return 0;
|
||||
}
|
||||
|
||||
getAssumedConditions(): Set<AbstractValue> {
|
||||
return new Set();
|
||||
}
|
||||
|
||||
refineBaseConditons(realm: Realm, depth?: number = 0): void {}
|
||||
}
|
||||
|
||||
|
@ -183,8 +183,10 @@ export class TextPrinter implements Printer {
|
||||
printGenerator(generator: Generator, label?: string = "(entry point)"): void {
|
||||
this._print(`${label}: ${JSON.stringify(generator.getName())}`);
|
||||
this._nest();
|
||||
if (generator.pathConditions.length > 0)
|
||||
this._print(`path conditions ${this.describeValues(generator.pathConditions)}`);
|
||||
if (generator.pathConditions.getLength() > 0)
|
||||
this._print(
|
||||
`path conditions ${this.describeValues(Array.from(generator.pathConditions.getAssumedConditions()))}`
|
||||
);
|
||||
generator.print(this);
|
||||
this._unnest();
|
||||
}
|
||||
|
@ -79,6 +79,10 @@ export class PathConditionsImplementation extends PathConditions {
|
||||
return this._assumedConditions.size;
|
||||
}
|
||||
|
||||
getAssumedConditions(): Set<AbstractValue> {
|
||||
return this._assumedConditions;
|
||||
}
|
||||
|
||||
refineBaseConditons(realm: Realm): void {
|
||||
if (realm.abstractValueImpliesMax > 0) return;
|
||||
let refine = (condition: AbstractValue) => {
|
||||
|
Loading…
Reference in New Issue
Block a user