| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 void setMinimumArityTypeError(ExceptionState& exceptionState, unsigned expected,
unsigned provided) | 90 void setMinimumArityTypeError(ExceptionState& exceptionState, unsigned expected,
unsigned provided) |
| 91 { | 91 { |
| 92 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected
, provided)); | 92 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected
, provided)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 RawPtr<NodeFilter> toNodeFilter(v8::Local<v8::Value> callback, v8::Local<v8::Obj
ect> creationContext, ScriptState* scriptState) | 95 RawPtr<NodeFilter> toNodeFilter(v8::Local<v8::Value> callback, v8::Local<v8::Obj
ect> creationContext, ScriptState* scriptState) |
| 96 { | 96 { |
| 97 if (callback->IsNull()) | 97 if (callback->IsNull()) |
| 98 return nullptr; | 98 return nullptr; |
| 99 RawPtr<NodeFilter> filter = NodeFilter::create(); | 99 NodeFilter* filter = NodeFilter::create(); |
| 100 | 100 |
| 101 v8::Local<v8::Value> filterWrapper = toV8(filter.get(), creationContext, scr
iptState->isolate()); | 101 v8::Local<v8::Value> filterWrapper = toV8(filter, creationContext, scriptSta
te->isolate()); |
| 102 if (filterWrapper.IsEmpty()) | 102 if (filterWrapper.IsEmpty()) |
| 103 return nullptr; | 103 return nullptr; |
| 104 | 104 |
| 105 RawPtr<NodeFilterCondition> condition = V8NodeFilterCondition::create(callba
ck, filterWrapper.As<v8::Object>(), scriptState); | 105 NodeFilterCondition* condition = V8NodeFilterCondition::create(callback, fil
terWrapper.As<v8::Object>(), scriptState); |
| 106 filter->setCondition(condition.release()); | 106 filter->setCondition(condition); |
| 107 | 107 |
| 108 return filter.release(); | 108 return filter; |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool toBooleanSlow(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionSt
ate& exceptionState) | 111 bool toBooleanSlow(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionSt
ate& exceptionState) |
| 112 { | 112 { |
| 113 ASSERT(!value->IsBoolean()); | 113 ASSERT(!value->IsBoolean()); |
| 114 v8::TryCatch block(isolate); | 114 v8::TryCatch block(isolate); |
| 115 bool result = false; | 115 bool result = false; |
| 116 if (!v8Call(value->BooleanValue(isolate->GetCurrentContext()), result, block
)) | 116 if (!v8Call(value->BooleanValue(isolate->GetCurrentContext()), result, block
)) |
| 117 exceptionState.rethrowV8Exception(block.Exception()); | 117 exceptionState.rethrowV8Exception(block.Exception()); |
| 118 return result; | 118 return result; |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 { | 914 { |
| 915 v8::Local<v8::Value> data = info.Data(); | 915 v8::Local<v8::Value> data = info.Data(); |
| 916 ASSERT(data->IsExternal()); | 916 ASSERT(data->IsExternal()); |
| 917 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | 917 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); |
| 918 if (!perContextData) | 918 if (!perContextData) |
| 919 return; | 919 return; |
| 920 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | 920 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); |
| 921 } | 921 } |
| 922 | 922 |
| 923 } // namespace blink | 923 } // namespace blink |
| OLD | NEW |