OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 toV8(document, info.Holder(), info.GetIsolate()); | 93 toV8(document, info.Holder(), info.GetIsolate()); |
94 | 94 |
95 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceNamedConstructor", info.Holder(), info.GetIsolate()); | 95 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceNamedConstructor", info.Holder(), info.GetIsolate()); |
96 if (UNLIKELY(info.Length() < 1)) { | 96 if (UNLIKELY(info.Length() < 1)) { |
97 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 97 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
98 exceptionState.throwIfNeeded(); | 98 exceptionState.throwIfNeeded(); |
99 return; | 99 return; |
100 } | 100 } |
101 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[0])
; | 101 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[0])
; |
102 V8TRYCATCH_VOID(bool, defaultUndefinedOptionalBooleanArg, info[1]->BooleanVa
lue()); | 102 V8TRYCATCH_VOID(bool, defaultUndefinedOptionalBooleanArg, info[1]->BooleanVa
lue()); |
103 V8TRYCATCH_VOID(int, defaultUndefinedOptionalLongArg, toInt32(info[2])); | 103 V8TRYCATCH_EXCEPTION_VOID(int, defaultUndefinedOptionalLongArg, toInt32(info
[2], exceptionState), exceptionState); |
104 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt
ionalStringArg, info[3]); | 104 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt
ionalStringArg, info[3]); |
105 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultNullStringOp
tionalstringArg, argumentOrNull(info, 4)); | 105 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultNullStringOp
tionalstringArg, argumentOrNull(info, 4)); |
106 RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor::
createForJSConstructor(*document, stringArg, defaultUndefinedOptionalBooleanArg,
defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNull
StringOptionalstringArg, exceptionState); | 106 RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor::
createForJSConstructor(*document, stringArg, defaultUndefinedOptionalBooleanArg,
defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNull
StringOptionalstringArg, exceptionState); |
107 v8::Handle<v8::Object> wrapper = info.Holder(); | 107 v8::Handle<v8::Object> wrapper = info.Holder(); |
108 if (exceptionState.throwIfNeeded()) | 108 if (exceptionState.throwIfNeeded()) |
109 return; | 109 return; |
110 | 110 |
111 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(im
pl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrap
per, info.GetIsolate(), WrapperConfiguration::Dependent); | 111 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(im
pl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrap
per, info.GetIsolate(), WrapperConfiguration::Dependent); |
112 v8SetReturnValue(info, wrapper); | 112 v8SetReturnValue(info, wrapper); |
113 } | 113 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 fromInternalPointer(object)->deref(); | 208 fromInternalPointer(object)->deref(); |
209 } | 209 } |
210 | 210 |
211 template<> | 211 template<> |
212 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) | 212 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) |
213 { | 213 { |
214 return toV8(impl, creationContext, isolate); | 214 return toV8(impl, creationContext, isolate); |
215 } | 215 } |
216 | 216 |
217 } // namespace WebCore | 217 } // namespace WebCore |
OLD | NEW |