Commit d0e8a245 authored by John Resig's avatar John Resig

Fixed a bug in the jQuery.prop() addition and fixed the test cases to...

Fixed a bug in the jQuery.prop() addition and fixed the test cases to represent the current set of features.
parent b603ca03
...@@ -67,13 +67,9 @@ test("attr(String)", function() { ...@@ -67,13 +67,9 @@ test("attr(String)", function() {
ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' ); ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );
}); });
test("attr(String, Function|String)", function() { test("attr(String, Function)", function() {
expect(1);
ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" ); ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );
ok( $('#text2').attr('value', "${this.id}")[0].value == "text2", "Set value from id" );
reset();
$('#text1, #text2').attr({value: "${this.id + 'foobar'}"});
ok( $('#text1')[0].value == "text1foobar", "Set value from id" );
ok( $('#text2')[0].value == "text2foobar", "Set value from id" );
}); });
test("attr(Hash)", function() { test("attr(Hash)", function() {
......
...@@ -1235,7 +1235,7 @@ jQuery.extend({ ...@@ -1235,7 +1235,7 @@ jQuery.extend({
prop: function(elem, key, value){ prop: function(elem, key, value){
// Handle executable functions // Handle executable functions
return value.constructor == Function && return value.constructor == Function &&
value.call( elem, val ) || value; value.call( elem ) || value;
}, },
className: { className: {
......
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