Index: Source/bindings/core/v8/V8Binding.cpp |
diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp |
index b288a2950186d5b88766aa9ae4837cccb0b2bdc9..54199fafee753d68d2e1309f2afbbb38e0258393 100644 |
--- a/Source/bindings/core/v8/V8Binding.cpp |
+++ b/Source/bindings/core/v8/V8Binding.cpp |
@@ -778,6 +778,24 @@ void crashIfV8IsDead() |
} |
} |
+bool isValidEnum(const String value, const char** validValues, size_t length) |
+{ |
+ for (size_t i = 0; i < length; ++i) { |
+ if (value == validValues[i]) |
+ return true; |
+ } |
+ return false; |
+} |
+ |
+bool isValidEnum(const Vector<String>& values, const char** validValues, size_t length) |
+{ |
+ for (auto value : values) { |
+ if (!isValidEnum(value, validValues, length)) |
+ return false; |
+ } |
+ return true; |
+} |
+ |
v8::Handle<v8::Function> getBoundFunction(v8::Handle<v8::Function> function) |
{ |
v8::Handle<v8::Value> boundFunction = function->GetBoundFunction(); |