Index: Source/bindings/v8/V8Binding.cpp |
diff --git a/Source/bindings/v8/V8Binding.cpp b/Source/bindings/v8/V8Binding.cpp |
index a03187eabab6280a96c799868359f8952fe9a002..61acaf5cd2c074300f0d579b442faf3125d9caf2 100644 |
--- a/Source/bindings/v8/V8Binding.cpp |
+++ b/Source/bindings/v8/V8Binding.cpp |
@@ -492,6 +492,16 @@ float toFloat(v8::Handle<v8::Value> value, ExceptionState& exceptionState) |
return numberObject->NumberValue(); |
} |
+String toByteString(v8::Handle<v8::Value> value, ExceptionState& exceptionState) |
+{ |
+ String string = toCoreString(value.As<v8::String>()); |
jsbell
2014/05/30 21:53:28
Yeah, this As<v8::String> is bogus if it's not a s
Nils Barth (inactive)
2014/06/02 03:20:16
Should it be ToString() instead then?
(JS values a
jsbell
2014/06/03 23:22:36
Yeah; handling should be identical to js->DOMStrin
|
+ if (!string.containsOnlyLatin1()) { |
+ exceptionState.throwTypeError("Value is not a valid ByteString."); |
+ return String(); |
+ } |
+ return string; |
+} |
+ |
PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value, v8::Isolate* isolate) |
{ |
RefPtrWillBeRawPtr<XPathNSResolver> resolver = nullptr; |