Changeset 25535 in webkit
- Timestamp:
- Sep 13, 2007, 7:50:22 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r25534 r25535 1 2007-09-13 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Maciej. 4 5 Small addition to previous path to cover 6 http://bugs.webkit.org/show_bug.cgi?id=11399 7 window.eval runs in the global scope of the calling window 8 9 Switch variable scope as well. 10 11 * kjs/function.cpp: 12 (KJS::GlobalFuncImp::callAsFunction): 13 1 14 2007-09-12 Antti Koivisto <antti@apple.com> 2 15 -
trunk/JavaScriptCore/kjs/function.cpp
r25534 r25535 834 834 ctx.setExecState(&newExec); 835 835 836 if (switchGlobal) 836 if (switchGlobal) { 837 837 ctx.pushScope(thisObj); 838 ctx.setVariableObject(thisObj); 839 } 838 840 839 841 // execute the code -
trunk/LayoutTests/ChangeLog
r25534 r25535 1 2007-09-13 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Maciej. 4 5 Change test case to cover 6 http://bugs.webkit.org/show_bug.cgi?id=11399 7 too. 8 9 * fast/js/window-eval-context-expected.txt: 10 * fast/js/window-eval-context.html: 11 1 12 2007-09-12 Antti Koivisto <antti@apple.com> 2 13 -
trunk/LayoutTests/fast/js/window-eval-context-expected.txt
r25534 r25535 1 1 2 2 Test that otherWindow.eval() keeps variables of calling context visible: PASS 3 Test that otherWindow.eval() is executed with otherWindow in scope PASS4 Test that otherWindow.eval() has otherWindow as the window object 3 Test that otherWindow.eval() is executed with otherWindow in scope: PASS 4 Test that otherWindow.eval() has otherWindow as the window object: PASS 5 5 Test that otherWindow.eval() does not change 'this': PASS 6 Test that otherWindow.eval() changes variable context: PASS -
trunk/LayoutTests/fast/js/window-eval-context.html
r25534 r25535 27 27 otherWindow.localVar = 2; 28 28 res = otherWindow.eval('localVar == 2'); 29 print("Test that otherWindow.eval() is executed with otherWindow in scope " + (res ? "PASS" : "FAIL")) ;29 print("Test that otherWindow.eval() is executed with otherWindow in scope: " + (res ? "PASS" : "FAIL")) ; 30 30 31 31 res = otherWindow.eval('window == otherWindow'); 32 print("Test that otherWindow.eval() has otherWindow as the window object 32 print("Test that otherWindow.eval() has otherWindow as the window object: " + (res ? "PASS" : "FAIL")) ; 33 33 34 34 var savedThis = this; 35 35 res = otherWindow.eval('this == savedThis'); 36 36 print("Test that otherWindow.eval() does not change 'this': " + (res ? "PASS" : "FAIL")) ; 37 38 otherWindow.eval('var myObject = new Object()'); 39 res = (typeof myObject == "undefined"); 40 print("Test that otherWindow.eval() changes variable context: " + (res ? "PASS" : "FAIL")) ; 37 41 </script>
Note:
See TracChangeset
for help on using the changeset viewer.