I'm encountering the following crash when attempting to use the WebInspector in MiniBrowser: 'MiniBrowser.exe' (Win32): Loaded 'C:\Windows\System32\rasadhlp.dll'. Symbols loaded. Failed to parse/execute InjectedScriptSource.js! "//# sourceURL=__WebInspectorInjectedScript__" ?(function(InjectedScriptHost,inspectedGlobalObject,injectedScriptId){var Object={}.constructor;function toString(obj)?{return String(obj);}?function toStringDescription(obj)?{if(obj===0&&1/obj<0)?return"-0";return toString(obj);}?function isUInt32(obj)?{if(typeof obj==="number")?return obj>>>0===obj&&(obj>0||1/obj>0);return""+(obj>>>0)===obj;}?function isSymbol(obj)?{return typeof obj==="symbol";}?var InjectedScript=function()?{this._lastBoundObjectId=1;this._idToWrappedObject={};this._idToObjectGroupName={};this._objectGroups={};this._modules={};this._nextSavedResultIndex=1;this._savedResults=[];}?InjectedScript.primitiveTypes={undefined:true,boolean:true,number:true,string:true,}?InjectedScript.CollectionMode={OwnProperties:1<<0,NativeGetterProperties:1<<1,AllProperties:1<<2,}?InjectedScript.prototype={isPrimitiveValue:function(object)?{return InjectedScript.primitiveTypes[typeof object]&&!this._isHTMLAllCollection(object);},wrapObject:function(object,groupN1 00007FFC2880B2EF
<rdar://problem/23358514>
This is emitted by InjectedScriptManager::injectedScriptFor normally when InjectedScriptSource.js has a parse error. Here is one possible issue: JavaScriptCore's DerivedSource.make / CMakeLists.txt attempts to minify the InjectedScriptSource and in the process injects the sourceURL comment that would have been stripped: COMMAND echo "//# sourceURL=__WebInspectorInjectedScript__" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js Perhaps that is not doing what we expect on Windows? Did Windows just move to CMake?
(In reply to comment #2) > This is emitted by InjectedScriptManager::injectedScriptFor normally when > InjectedScriptSource.js has a parse error. > > Here is one possible issue: > > JavaScriptCore's DerivedSource.make / CMakeLists.txt attempts to minify the > InjectedScriptSource and in the process injects the sourceURL comment that > would have been stripped: > > COMMAND echo "//# sourceURL=__WebInspectorInjectedScript__" > > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js > > Perhaps that is not doing what we expect on Windows? Did Windows just move > to CMake? Yes it did! That may very well be the problem.
It looks like this problem was introduced right around the time we switched Windows over to CMake.
It looks like this command: COMMAND echo "//# sourceURL=__WebInspectorInjectedScript__" ... is inserting quotes into the JS file, which is causing a parse error.
Created attachment 264637 [details] Patch
Comment on attachment 264637 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=264637&action=review > Source/JavaScriptCore/CMakeLists.txt:1277 > - COMMAND echo "//# sourceURL=__WebInspectorInjectedScript__" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js > + COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__WebInspectorInjectedScript__" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js We should therefore do the same to WebCore: COMMAND echo "//# sourceURL=__WebInspectorCommandLineAPIModuleSource__" > ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.min.js
Committed r191917: <http://trac.webkit.org/changeset/191917>