Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void stateAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
- {
- v8::Local<v8::Object> holder = info.Holder();
- v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "state");
- History* impl = V8History::toImpl(holder);
- if (!impl->stateChanged()) {
- v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName);
- if (!v8Value.IsEmpty()) {
- v8SetReturnValue(info, v8Value);
- return;
- }
- }
- RefPtr<SerializedScriptValue> cppValue(impl->state());
- v8::Local<v8::Value> v8Value(cppValue ? cppValue->deserialize() : v8::Local<v8::Value>(v8::Null(info.GetIsolate())));
- V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value);
- v8SetReturnValue(info, v8Value);
- }
Advertisement
Add Comment
Please, Sign In to add comment