Commit 8fd974c4 authored by yurys@chromium.org's avatar yurys@chromium.org

2011-05-10 Yury Semikhatsky <yurys@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: test that eval can access scoped variables in console
        https://bugs.webkit.org/show_bug.cgi?id=60547

        * inspector/console/console-eval-scoped-expected.txt: Added.
        * inspector/console/console-eval-scoped.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a5236926
2011-05-10 Yury Semikhatsky <yurys@chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: test that eval can access scoped variables in console
https://bugs.webkit.org/show_bug.cgi?id=60547
* inspector/console/console-eval-scoped-expected.txt: Added.
* inspector/console/console-eval-scoped.html: Added.
2011-05-12 Csaba Osztrogonác <ossy@webkit.org>
Add new expected files after r86313.
CONSOLE MESSAGE: line 4: with: Object property value
CONSOLE MESSAGE: line 1: eval in with: Object property value
CONSOLE MESSAGE: line 1: eval in function: Function parameter
Tests that evaluating 'console.log()' in the console will have access to its outer scope variables. Bug 60547.
with: Object property value
eval in with: Object property value
eval in function: Function parameter
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function test()
{
function snippet1() {
(function (obj) {
with (obj) {
console.log('with: ' + a);
eval("console.log('eval in with: ' + a)");
}
})({ a: "Object property value" })
}
function snippet2() {
(function (a) { eval("console.log('eval in function: ' + a)"); })("Function parameter")
}
function bodyText(f) {
var text = f.toString();
var begin = text.indexOf("{");
return text.substring(begin);
}
InspectorTest.evaluateInPage(bodyText(snippet1), step1);
function step1()
{
InspectorTest.runAfterPendingDispatches(step2);
}
function step2()
{
InspectorTest.evaluateInPage(bodyText(snippet2), step3);
}
function step3()
{
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that evaluating 'console.log()' in the console will have access to its outer scope variables.
<a href="https://bugs.webkit.org/show_bug.cgi?id=60547">Bug 60547.</a>
</p>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment