Disallow Optional::operator=(nullptr_t) unless T is a pointer

Summary: The old implementation of folly::none inadvertently allowed disengaging an optional by writing `op = nullptr`. Disallow that and require `op = folly::none`.

Reviewed By: yfeldblum

Differential Revision: D12884724

fbshipit-source-id: b17bcf00b245069d8ea2d9bc3703b0fdcaa85c07
This commit is contained in:
Chad Austin 2018-11-05 10:54:45 -08:00 committed by Facebook Github Bot
parent 3a98318c91
commit 79712c35cb

View File

@ -45,7 +45,7 @@ Value JSINativeModules::getModule(Runtime& rt, const PropNameID& name) {
}
void JSINativeModules::reset() {
m_genNativeModuleJS = nullptr;
m_genNativeModuleJS = folly::none;
m_objects.clear();
}