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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected
, provided)); | 96 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected
, provided)); |
97 } | 97 } |
98 | 98 |
99 NodeFilter* toNodeFilter(v8::Local<v8::Value> callback, v8::Local<v8::Object> cr
eationContext, ScriptState* scriptState) | 99 NodeFilter* toNodeFilter(v8::Local<v8::Value> callback, v8::Local<v8::Object> cr
eationContext, ScriptState* scriptState) |
100 { | 100 { |
101 if (callback->IsNull()) | 101 if (callback->IsNull()) |
102 return nullptr; | 102 return nullptr; |
103 NodeFilter* filter = NodeFilter::create(); | 103 NodeFilter* filter = NodeFilter::create(); |
104 | 104 |
105 v8::Local<v8::Value> filterWrapper = toV8(filter, creationContext, scriptSta
te->isolate()); | 105 v8::Local<v8::Value> filterWrapper = toV8(filter, creationContext, scriptSta
te->isolate()); |
106 if (filterWrapper.IsEmpty()) | |
107 return nullptr; | |
108 | |
109 NodeFilterCondition* condition = V8NodeFilterCondition::create(callback, fil
terWrapper.As<v8::Object>(), scriptState); | 106 NodeFilterCondition* condition = V8NodeFilterCondition::create(callback, fil
terWrapper.As<v8::Object>(), scriptState); |
110 filter->setCondition(condition); | 107 filter->setCondition(condition); |
111 | 108 |
112 return filter; | 109 return filter; |
113 } | 110 } |
114 | 111 |
115 bool toBooleanSlow(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionSt
ate& exceptionState) | 112 bool toBooleanSlow(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionSt
ate& exceptionState) |
116 { | 113 { |
117 ASSERT(!value->IsBoolean()); | 114 ASSERT(!value->IsBoolean()); |
118 v8::TryCatch block(isolate); | 115 v8::TryCatch block(isolate); |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 return frame->script().isolate(); | 952 return frame->script().isolate(); |
956 } | 953 } |
957 | 954 |
958 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value> value, v8::Isolate* iso
late) | 955 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value> value, v8::Isolate* iso
late) |
959 { | 956 { |
960 value.As<v8::Object>()->SetIntegrityLevel(isolate->GetCurrentContext(), v8::
IntegrityLevel::kFrozen).ToChecked(); | 957 value.As<v8::Object>()->SetIntegrityLevel(isolate->GetCurrentContext(), v8::
IntegrityLevel::kFrozen).ToChecked(); |
961 return value; | 958 return value; |
962 } | 959 } |
963 | 960 |
964 } // namespace blink | 961 } // namespace blink |
OLD | NEW |