Chromium Code Reviews| Index: Source/bindings/v8/ScriptDebugServer.cpp |
| diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp |
| index 34f6bc7cbe1b7586095a48f27a737441d5d07771..a15da89bc3ed6adad034e0e5308624f32971b551 100644 |
| --- a/Source/bindings/v8/ScriptDebugServer.cpp |
| +++ b/Source/bindings/v8/ScriptDebugServer.cpp |
| @@ -502,7 +502,16 @@ void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 |
| String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("id"))); |
| ScriptDebugListener::Script script; |
| - script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("name"))); |
| + |
| + String rawScriptURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("name"))); |
| + // Remove any fragment identifier. |
| + size_t hashCharPos = rawScriptURL.find("#"); |
|
abarth-chromium
2013/10/11 20:20:41
This seems like the wrong layer for this work. Th
johnjbarton
2013/10/11 21:31:16
The debugger layer (listener here) gets a const Sc
|
| + if (hashCharPos != kNotFound) { |
| + script.url = rawScriptURL.substring(0, hashCharPos); |
| + } else { |
| + script.url = rawScriptURL; |
| + } |
|
abarth-chromium
2013/10/11 20:20:41
This branch isn't needed. substring(0, kNotFound)
johnjbarton
2013/10/11 21:31:16
If I understand you, I could have written:
scri
|
| + |
| script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("source"))); |
| script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("sourceMappingURL"))); |
| script.startLine = object->Get(v8::String::NewSymbol("startLine"))->ToInteger()->Value(); |