Beispiel #1
0
static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TestSpecialOperations* impl = V8TestSpecialOperations::toNative(info.Holder());
    TOSTRING_VOID(V8StringResource<>, propertyName, name);
    TONATIVE_VOID(Node*, propertyValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
    bool result = impl->anonymousNamedSetter(propertyName, propertyValue);
    if (!result)
        return;
    v8SetReturnValue(info, v8Value);
}
static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
  TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());
  Node* propertyValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value);
  if (!propertyValue && !isUndefinedOrNull(v8Value)) {
    exceptionState.throwTypeError("The provided value is not of type 'Node'.");
    return;
  }

  bool result = impl->anonymousNamedSetter(name, propertyValue);
  if (!result)
    return;
  v8SetReturnValue(info, v8Value);
}