Changeset 248434 in webkit
- Timestamp:
- Aug 8, 2019 11:59:04 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 11 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r248433 r248434 1 2019-08-08 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: rename `queryObjects` to `queryInstances` for clarity 4 https://bugs.webkit.org/show_bug.cgi?id=200520 5 6 Reviewed by Brian Burg. 7 8 * inspector/console/queryInstances.html: Renamed from LayoutTests/inspector/console/queryObjects.html. 9 * inspector/console/queryInstances-expected.txt: Renamed from LayoutTests/inspector/console/queryObjects-expected.txt. 10 11 * http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt: 12 1 13 2019-08-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/LayoutTests/http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt
r248287 r248434 1 CONSOLE MESSAGE: line 49: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.2 CONSOLE MESSAGE: line 49: Blocked a frame with origin "http://localhost:8000" from accessing a frame with origin "http://127.0.0.1:8000". Protocols, domains, and ports must match.1 CONSOLE MESSAGE: line 50: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match. 2 CONSOLE MESSAGE: line 50: Blocked a frame with origin "http://localhost:8000" from accessing a frame with origin "http://127.0.0.1:8000". Protocols, domains, and ports must match. 3 3 Test that code evaluated in the main frame cannot access $0 that resolves to a node in a frame from a different domain. Bug 105423. 4 4 -
trunk/LayoutTests/inspector/console/queryInstances.html
r248433 r248434 1 <! doctypehtml>1 <!DOCTYPE html> 2 2 <html> 3 3 <head> … … 61 61 62 62 function test() { 63 function query Objects(prototypeOrConstructor, callback) {64 WI.runtimeManager.evaluateInInspectedWindow(`query Objects(${prototypeOrConstructor})`, {objectGroup: "test", includeCommandLineAPI: true, generatePreview: true}, callback);65 } 66 67 let suite = InspectorTest.createAsyncSuite("CommandLineAPI.query Objects");63 function queryInstances(prototypeOrConstructor, callback) { 64 WI.runtimeManager.evaluateInInspectedWindow(`queryInstances(${prototypeOrConstructor})`, {objectGroup: "test", includeCommandLineAPI: true, generatePreview: true}, callback); 65 } 66 67 let suite = InspectorTest.createAsyncSuite("CommandLineAPI.queryInstances"); 68 68 69 69 let cases = [ … … 124 124 for (let {prototypeOrConstructor, resultCount, shouldThrow} of cases) { 125 125 suite.addTestCase({ 126 name: `CommandLineAPI.query Objects.${prototypeOrConstructor}`,126 name: `CommandLineAPI.queryInstances.${prototypeOrConstructor}`, 127 127 test(resolve, reject) { 128 query Objects(prototypeOrConstructor, (remoteObject, wasThrown, savedResultIndex) => {128 queryInstances(prototypeOrConstructor, (remoteObject, wasThrown, savedResultIndex) => { 129 129 if (shouldThrow) { 130 InspectorTest.expectThat(wasThrown, `Calling "query Objects" with "${prototypeOrConstructor}" should throw an exception.`);130 InspectorTest.expectThat(wasThrown, `Calling "queryInstances" with "${prototypeOrConstructor}" should throw an exception.`); 131 131 InspectorTest.log(remoteObject.description); 132 132 if (wasThrown) { … … 162 162 163 163 suite.addTestCase({ 164 name: "CommandLineAPI.query Objects.GC",164 name: "CommandLineAPI.queryInstances.GC", 165 165 test(resolve, reject) { 166 query Objects(`ClassC`, (remoteObject, wasThrown, savedResultIndex) => {166 queryInstances(`ClassC`, (remoteObject, wasThrown, savedResultIndex) => { 167 167 InspectorTest.assert(!wasThrown); 168 168 if (wasThrown) … … 176 176 InspectorTest.evaluateInPage(`clearInstances()`); 177 177 178 query Objects(`ClassC`, (remoteObject, wasThrown, savedResultIndex) => {178 queryInstances(`ClassC`, (remoteObject, wasThrown, savedResultIndex) => { 179 179 InspectorTest.assert(!wasThrown); 180 180 if (wasThrown) … … 189 189 190 190 suite.addTestCase({ 191 name: "CommandLineAPI.query Objects.NoParameter",191 name: "CommandLineAPI.queryInstances.NoParameter", 192 192 test(resolve, reject) { 193 193 const prototypeOrConstructor = ""; 194 query Objects(prototypeOrConstructor, (remoteObject, wasThrown, savedResultIndex) => {194 queryInstances(prototypeOrConstructor, (remoteObject, wasThrown, savedResultIndex) => { 195 195 if (wasThrown) { 196 196 InspectorTest.fail("An exception was thrown."); … … 211 211 </head> 212 212 <body onload="runTest()"> 213 <p>Tests for the `queryObjects` function in the Command Line API.</p>213 <p>Tests for the `queryInstances` function in the Command Line API.</p> 214 214 </body> 215 215 </html> -
trunk/Source/JavaScriptCore/ChangeLog
r248426 r248434 1 2019-08-08 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: rename `queryObjects` to `queryInstances` for clarity 4 https://bugs.webkit.org/show_bug.cgi?id=200520 5 6 Reviewed by Brian Burg. 7 8 * inspector/InjectedScriptSource.js: 9 (queryInstances): Added. 10 (queryObjects): 11 * inspector/JSInjectedScriptHost.h: 12 * inspector/JSInjectedScriptHost.cpp: 13 (Inspector::JSInjectedScriptHost::queryInstances): Added. 14 (Inspector::JSInjectedScriptHost::queryObjects): Deleted. 15 * inspector/JSInjectedScriptHostPrototype.cpp: 16 (Inspector::JSInjectedScriptHostPrototype::finishCreation): 17 (Inspector::jsInjectedScriptHostPrototypeFunctionQueryInstances): Added. 18 (Inspector::jsInjectedScriptHostPrototypeFunctionQueryObjects): Deleted. 19 1 20 2019-08-08 Ross Kirsling <ross.kirsling@sony.com> 2 21 -
trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js
r248287 r248434 1503 1503 }, 1504 1504 1505 function queryInstances() { 1506 return InjectedScriptHost.queryInstances(...arguments); 1507 }, 1508 1505 1509 function queryObjects() { 1506 return InjectedScriptHost.query Objects(...arguments);1510 return InjectedScriptHost.queryInstances(...arguments); 1507 1511 }, 1508 1512 ]; -
trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp
r248287 r248434 662 662 } 663 663 664 JSValue JSInjectedScriptHost::query Objects(ExecState* exec)664 JSValue JSInjectedScriptHost::queryInstances(ExecState* exec) 665 665 { 666 666 if (exec->argumentCount() < 1) … … 672 672 JSValue prototypeOrConstructor = exec->uncheckedArgument(0); 673 673 if (!prototypeOrConstructor.isObject()) 674 return throwTypeError(exec, scope, "query Objects first argument must be an object."_s);674 return throwTypeError(exec, scope, "queryInstances first argument must be an object."_s); 675 675 676 676 JSObject* object = asObject(prototypeOrConstructor); 677 677 if (object->inherits<ProxyObject>(vm)) 678 return throwTypeError(exec, scope, "query Objects cannot be called with a Proxy."_s);678 return throwTypeError(exec, scope, "queryInstances cannot be called with a Proxy."_s); 679 679 680 680 JSValue prototype = object; … … 693 693 694 694 if (object->inherits<ProxyObject>(vm) || prototype.inherits<ProxyObject>(vm)) 695 return throwTypeError(exec, scope, "query Objects cannot be called with a Proxy."_s);695 return throwTypeError(exec, scope, "queryInstances cannot be called with a Proxy."_s); 696 696 697 697 // FIXME: implement a way of distinguishing between internal and user-created objects. 698 698 JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject(); 699 699 if (checkForbiddenPrototype(exec, object, lexicalGlobalObject->objectPrototype())) 700 return throwTypeError(exec, scope, "query Objects cannot be called with Object."_s);700 return throwTypeError(exec, scope, "queryInstances cannot be called with Object."_s); 701 701 if (checkForbiddenPrototype(exec, object, lexicalGlobalObject->functionPrototype())) 702 return throwTypeError(exec, scope, "query Objects cannot be called with Function."_s);702 return throwTypeError(exec, scope, "queryInstances cannot be called with Function."_s); 703 703 if (checkForbiddenPrototype(exec, object, lexicalGlobalObject->arrayPrototype())) 704 return throwTypeError(exec, scope, "query Objects cannot be called with Array."_s);704 return throwTypeError(exec, scope, "queryInstances cannot be called with Array."_s); 705 705 if (checkForbiddenPrototype(exec, object, lexicalGlobalObject->mapPrototype())) 706 return throwTypeError(exec, scope, "query Objects cannot be called with Map."_s);706 return throwTypeError(exec, scope, "queryInstances cannot be called with Map."_s); 707 707 if (checkForbiddenPrototype(exec, object, lexicalGlobalObject->jsSetPrototype())) 708 return throwTypeError(exec, scope, "query Objects cannot be called with Set."_s);708 return throwTypeError(exec, scope, "queryInstances cannot be called with Set."_s); 709 709 if (checkForbiddenPrototype(exec, object, lexicalGlobalObject->promisePrototype())) 710 return throwTypeError(exec, scope, "query Objects cannot be called with Promise."_s);710 return throwTypeError(exec, scope, "queryInstances cannot be called with Promise."_s); 711 711 712 712 sanitizeStackForVM(&vm); -
trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h
r248287 r248434 74 74 JSC::JSValue weakSetEntries(JSC::ExecState*); 75 75 JSC::JSValue iteratorEntries(JSC::ExecState*); 76 JSC::JSValue query Objects(JSC::ExecState*);76 JSC::JSValue queryInstances(JSC::ExecState*); 77 77 78 78 protected: -
trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp
r248287 r248434 51 51 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakSetEntries(ExecState*); 52 52 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIteratorEntries(ExecState*); 53 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionQuery Objects(ExecState*);53 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionQueryInstances(ExecState*); 54 54 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionEvaluateWithScopeExtension(ExecState*); 55 55 … … 76 76 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("weakSetEntries", jsInjectedScriptHostPrototypeFunctionWeakSetEntries, static_cast<unsigned>(PropertyAttribute::DontEnum), 1); 77 77 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("iteratorEntries", jsInjectedScriptHostPrototypeFunctionIteratorEntries, static_cast<unsigned>(PropertyAttribute::DontEnum), 1); 78 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("query Objects", jsInjectedScriptHostPrototypeFunctionQueryObjects, static_cast<unsigned>(PropertyAttribute::DontEnum), 1);78 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("queryInstances", jsInjectedScriptHostPrototypeFunctionQueryInstances, static_cast<unsigned>(PropertyAttribute::DontEnum), 1); 79 79 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("evaluateWithScopeExtension", jsInjectedScriptHostPrototypeFunctionEvaluateWithScopeExtension, static_cast<unsigned>(PropertyAttribute::DontEnum), 1); 80 80 … … 226 226 } 227 227 228 EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionQuery Objects(ExecState* exec)229 { 230 VM& vm = exec->vm(); 231 auto scope = DECLARE_THROW_SCOPE(vm); 232 233 JSValue thisValue = exec->thisValue(); 234 JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(vm, thisValue); 235 if (!castedThis) 236 return throwVMTypeError(exec, scope); 237 238 return JSValue::encode(castedThis->query Objects(exec));228 EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionQueryInstances(ExecState* exec) 229 { 230 VM& vm = exec->vm(); 231 auto scope = DECLARE_THROW_SCOPE(vm); 232 233 JSValue thisValue = exec->thisValue(); 234 JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(vm, thisValue); 235 if (!castedThis) 236 return throwVMTypeError(exec, scope); 237 238 return JSValue::encode(castedThis->queryInstances(exec)); 239 239 } 240 240 -
trunk/Source/WebCore/ChangeLog
r248432 r248434 1 2019-08-08 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: rename `queryObjects` to `queryInstances` for clarity 4 https://bugs.webkit.org/show_bug.cgi?id=200520 5 6 Reviewed by Brian Burg. 7 8 Test: inspector/console/queryInstances.html 9 10 * inspector/CommandLineAPIModuleSource.js: 11 (CommandLineAPIImpl.prototype.queryInstances): Added. 12 (CommandLineAPIImpl.prototype.queryObjects): 13 1 14 2019-08-08 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js
r248287 r248434 102 102 "profile", 103 103 "profileEnd", 104 "queryInstances", 104 105 "queryObjects", 105 106 "screenshot", … … 263 264 }, 264 265 266 queryInstances() 267 { 268 return InjectedScriptHost.queryInstances(...arguments); 269 }, 270 265 271 queryObjects() 266 272 { 267 return InjectedScriptHost.query Objects(...arguments);273 return InjectedScriptHost.queryInstances(...arguments); 268 274 }, 269 275 -
trunk/Source/WebInspectorUI/ChangeLog
r248400 r248434 1 2019-08-08 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: rename `queryObjects` to `queryInstances` for clarity 4 https://bugs.webkit.org/show_bug.cgi?id=200520 5 6 Reviewed by Brian Burg. 7 8 * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js: 9 1 10 2019-08-07 Devin Rousso <drousso@apple.com> 2 11 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js
r248287 r248434 331 331 "profile", 332 332 "profileEnd", 333 "queryInstances", 333 334 "queryObjects", 334 335 "screenshot",
Note: See TracChangeset
for help on using the changeset viewer.