Fixed a bug in the jQuery.prop() addition and fixed the test cases to represent the...
authorJohn Resig <jeresig@gmail.com>
Mon, 8 Jan 2007 01:17:28 +0000 (01:17 +0000)
committerJohn Resig <jeresig@gmail.com>
Mon, 8 Jan 2007 01:17:28 +0000 (01:17 +0000)
src/jquery/coreTest.js
src/jquery/jquery.js

index 4b29c8f..73621cd 100644 (file)
@@ -67,13 +67,9 @@ test("attr(String)", function() {
        ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );\r
 });\r
 \r
-test("attr(String, Function|String)", function() {\r
+test("attr(String, Function)", function() {\r
+       expect(1);\r
        ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );\r
-       ok( $('#text2').attr('value', "${this.id}")[0].value == "text2", "Set value from id" );\r
-       reset();\r
-       $('#text1, #text2').attr({value: "${this.id + 'foobar'}"});\r
-       ok( $('#text1')[0].value == "text1foobar", "Set value from id" );\r
-       ok( $('#text2')[0].value == "text2foobar", "Set value from id" );\r
 });\r
 \r
 test("attr(Hash)", function() {\r
@@ -440,4 +436,4 @@ test("removeAttr(String", function() {
 test("text(String, Boolean)", function() {\r
        ok( $("#foo").text("<div><b>Hello</b> cruel world!</div>")[0].innerHTML == "&lt;div&gt;&lt;b&gt;Hello&lt;/b&gt; cruel world!&lt;/div&gt;", "Check escaped text" );\r
        ok( $("#foo").text("<div><b>Hello</b> cruel world!</div>", true)[0].innerHTML == "Hello cruel world!", "Check stripped text" );\r
-});
\ No newline at end of file
+});\r
index 50549bb..4f1306a 100644 (file)
@@ -1235,7 +1235,7 @@ jQuery.extend({
        prop: function(elem, key, value){
                // Handle executable functions
                return value.constructor == Function &&
-                       value.call( elem, val ) || value;
+                       value.call( elem ) || value;
        },
 
        className: {