#include "WeakRef.h" #include "Helpers.h" using namespace v8; namespace tns { void WeakRef::Init(Local context) { Isolate* isolate = context->GetIsolate(); std::string source = R"( global.WeakRef.prototype.get = global.WeakRef.prototype.deref; global.WeakRef.prototype.__hasWarnedAboutClear = false; global.WeakRef.prototype.clear = () => { if(global.WeakRef.prototype.__hasWarnedAboutClear) { return; } global.WeakRef.prototype.__hasWarnedAboutClear = true; console.warn('WeakRef.clear() is non-standard and has been deprecated. It does nothing and the call can be safely removed.'); } )"; Local