Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp |
| index 4e8dee3d101cbfcf60d257dac9f09673c53cba65..75f3d6dbe3fc7dfc89e76012d1bdf7042e274870 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp |
| @@ -84,13 +84,15 @@ void V8XMLHttpRequest::responseAttributeGetterCustom( |
| // Catch syntax error. Swallows an exception (when thrown) as the |
| // spec says. https://xhr.spec.whatwg.org/#response-body |
| - v8::TryCatch exceptionCatcher(isolate); |
| - v8::Local<v8::Value> json; |
| - if (v8Call(v8::JSON::Parse(isolate, jsonSource.v8Value()), json, |
| - exceptionCatcher)) |
| - v8SetReturnValue(info, json); |
| - else |
| + ExceptionState exceptionState(ExceptionState::GetterContext, |
| + "responseText", "XMLHttpRequest", |
| + info.Holder(), info.GetIsolate()); |
|
haraken
2016/11/03 14:26:38
Would you put this at line 69? I'd like to make th
|
| + v8::Local<v8::Value> json = fromJSONString( |
| + isolate, toCoreString(jsonSource.v8Value()), exceptionState); |
| + if (exceptionState.hadException()) |
| v8SetReturnValue(info, v8::Null(isolate)); |
| + else |
| + v8SetReturnValue(info, json); |
| return; |
| } |