| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 ASSERT(document); | 91 ASSERT(document); |
| 92 | 92 |
| 93 // Make sure the document is added to the DOM Node map. Otherwise, the TestN
amedConstructor instance | 93 // Make sure the document is added to the DOM Node map. Otherwise, the TestN
amedConstructor instance |
| 94 // may end up being the only node in the map and get garbage-collected prema
turely. | 94 // may end up being the only node in the map and get garbage-collected prema
turely. |
| 95 toV8(document, info.Holder(), info.GetIsolate()); | 95 toV8(document, info.Holder(), info.GetIsolate()); |
| 96 | 96 |
| 97 if (UNLIKELY(info.Length() < 1)) { | 97 if (UNLIKELY(info.Length() < 1)) { |
| 98 throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "T
estNamedConstructor", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 98 throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "T
estNamedConstructor", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
| 99 return; | 99 return; |
| 100 } | 100 } |
| 101 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 101 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestName
dConstructor", info.Holder(), info.GetIsolate()); |
| 102 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); | 102 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); |
| 103 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); | 103 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); |
| 104 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul
l(info, 2)); | 104 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul
l(info, 2)); |
| 105 | 105 |
| 106 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru
ctor(*document, str1, str2, str3, exceptionState); | 106 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru
ctor(*document, str1, str2, str3, 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<V8TestNamedConstructor>(impl.releas
e(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsola
te(), WrapperConfiguration::Dependent); | 111 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl.releas
e(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsola
te(), WrapperConfiguration::Dependent); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 fromInternalPointer(object)->deref(); | 209 fromInternalPointer(object)->deref(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 template<> | 212 template<> |
| 213 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 213 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
| 214 { | 214 { |
| 215 return toV8(impl, creationContext, isolate); | 215 return toV8(impl, creationContext, isolate); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace WebCore | 218 } // namespace WebCore |
| OLD | NEW |