Skip to content

Commit

Permalink
Add VM experiment for Promise
Browse files Browse the repository at this point in the history
Summary:
This diff add a vm experiment flag for Promise and short circuit the
`hasES6Promise` to return true when flag is set.

Reviewed By: mhorowitz

Differential Revision: D24580968

fbshipit-source-id: bd2b0e96f1a6ccaf262dbe3f50193a4d1751da2a
  • Loading branch information
Huxpro authored and facebook-github-bot committed Oct 28, 2020
1 parent 3cbc541 commit 81a94ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/hermes/VM/Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ enum {
MAdviseStringsRandom = 1 << 5,
MAdviseStringsWillNeed = 1 << 6,
VerifyBytecodeChecksum = 1 << 7,
ES6Promise = 1 << 8,
};
/// Set of flags for active VM experiments.
using VMExperimentFlags = uint32_t;
Expand Down Expand Up @@ -748,6 +749,10 @@ class Runtime : public HandleRootOwner,
}

bool hasES6Promise() const {
// TODO(T78352970): clean up when QE finished.
if (getVMExperimentFlags() & experiments::ES6Promise) {
return true;
}
return hasES6Promise_;
}

Expand Down

0 comments on commit 81a94ae

Please sign in to comment.