CARVIEW |
rkatic
(Robert Katić)
- You’re not logged in!
- Login
- Pricing & Signup
- Name
- Robert Katić
- Website/Blog
- https://bender.fesb.hr/~robert/
- Member Since
- Dec 05, 2008 (about 1 year)
Following 2 coders and watching 7 repositories view all →
Public Repositories (4)
-
jquery
jQuery JavaScript Library
Forked from jquery/jquery Thu Dec 17 18:10:51 -0800 2009
Last updated Sat Jan 30 19:56:32 -0800 2010
-
class.js
JavaScript class and object inheritance.
Last updated Tue Jan 05 19:55:46 -0800 2010
-
jquery.ns.js
jQuery Namespaces
Last updated Thu Oct 01 06:39:59 -0700 2009
-
jquery.plugin.js
jQuery plugin system with inheritance features
Last updated Mon Sep 14 23:24:10 -0700 2009
Public Activity 

-
jeresig committed eed69ecc:
Make sure that jQuery.data( elem ) always returns a data object, fixes #5971. Improve the performance of .bind() and .unbind(), fixes #5972.
-
jeresig committed 942f8f7f:
No reason to limit the initial change data store to just radio elements. Fixes #5851.
-
rkatic committed edddcb3e:
Merge branch 'master' of git://github.com/jquery/jquery
-
jeresig committed 7a3afc31:
Updating the source version to 1.4.2pre.
-
jeresig committed a08ee9a9:
Tagging the 1.4.1 release.
-
jeresig committed 0b3165fd:
Make sure that the correct context is being passed in for replaceWith(fn). Fixes #5798.
-
jeresig committed 9f17e70a:
Make work wrapInner(fn) work consistently. Fixes #5799.
-
rkatic committed 55a64cf0:
Filtering elements only. Fixed #5920
-
malsup committed ca90ffb3:
Provided detailed message for JSON parse errors. Fixes #4435.
-
mmonteleone committed bed759c9:
Make sure that checked state is cloned properly. Based upon the patch by Michael, required better test cases and in doing so found more edge cases. Introduced a new check into jQuery.support as a result. Fixes #5929.
-
jeresig committed 390186b9:
Make sure that special.add actually copies over event namespaces and data. Fixes #5779 and #5834.
-
jeresig committed 0474917c:
Make sure multiple bound events have their namespaces and data maintained. Fixes #3549.
-
jeresig committed e01ff6cd:
Cleaned up divs that should've been removed after a test run.
-
jeresig committed d24443fb:
Make sure that it's possible to preventDefault natively-triggered (submit, focus, blur, click) events. Fixes #5695.
-
jeresig committed 323270f6:
Update the license URL in the header.
-
jeresig committed 1a14a38f:
Make sure original context is maintained and not the deep extended one. Fixes #5924.
-
jeresig committed f91b944c:
Objects with length properties weren't getting serialized properly by jQuery.param(). Fixes #5862.
-
jeresig committed 76236a15:
Use alternative technique for triggering an abort, preventing an exception from being thrown in Firefox. Fixes #5923.
-
jeresig committed c639405c:
Don't set the context in .load() as it stops the global ajax events from firing. Fixes #5922.
-
jeresig committed 6a3d0996:
Make sure that XHTML-style HTML is purified in .html(). Fixes #5845.
And 11 more commits...

-
jeresig committed d7a00234:
Make sure we use instead of in the delegate test.
-
jeresig committed 0d5bd174:
Moved logic for handling .animate({}), doesn't queue anymore. Fixes #5459.
-
rkatic committed d9872742:
Merge branch 'master' of git://github.com/jquery/jquery
-
jeresig committed f0505c6d:
Bringing Sizzle test suite changes back in.
-
jeresig committed 1feb92af:
Make sure that we don't bind the onunload event in Opera.
-
jeresig committed 3fd62eae:
Switched from using YUI Compressor to Google Compiler. Minified and Gzipped filesize reduced to 22,839 bytes from 26,169 bytes (13% decrease in filesize). Sizzle copyright was merged into the main header (since it's removed automatically). Still passes all unit tests.
-
jeresig committed 42f8c3ad:
No need to use the conditional comment for binding the onunload event in IE.
-
jeresig committed 0d06f399:
Updating the source version to 1.4b1pre.
-
jeresig committed f745357b:
Tagging the 1.4a2 release.
-
jeresig committed a0af1a8f:
Updating the source version to 1.4b1pre.
-
jeresig committed 92d6ce5a:
Tagging the 1.4a2 release.
-
jeresig committed 1c7d3155:
Move the test results list above the test HTML to avoid test suite layout weirdness.
-
jeresig committed 298bfb79:
The constructor check for isPlainObject was redundant, everything still passes without it.
-
jeresig committed 67b3be24:
Added additional checks for DOM nodes and window to isPlainObject, IE 8 was still letting those pass through. Fixes #5669.
-
jeresig committed 5e811146:
Temporarily disabling test for bug #4299.
-
jeresig committed c05712f0:
Fixed the spacing from the last commit.
-
jeresig committed d40083c8:
Disabled the passthrough .attr(method_name) functionality. You can now use it if you do: .attr({method_name: value}, true) OR as an easy initialization method: jQuery('<div/>', {html: '...', id: 'test'}).
-
rkatic committed 148fb7ba:
Made isPlainObject() supporting null, undefined, and window values on IE too. Also added some related tests. Fixes #5669.
-
jeresig committed 27d65b59:
Backing out the change from 841f9ff7a1815b521044aeeb39ccbe70fa688201, it was ineffectual in Internet Explorer. Keeping the broken test case, for now, so that we can check into the issue some more.
-
jeresig committed f0366306:
Brought the attributes module more inline with the jQuery style guidelines.
And 124 more commits...
Am I the only one perceiving problems here?
I am confused by the intention/implementation of this commit.
1) Iterating Arrays with for-in loops can produce different behaviors in older browsers. Is really
length
not-enumerable in every supported browser?.2) If
src
is an array, andcopy
is a plain object, then the current implementation will doextend(true, src, copy)
instead ofextend(true, {}, copy)
.
Vice versa, ifsrc
is a plain object, andcopy
is an array, then the current implementation will doextend(true, src, copy)
instead ofextend(true, [], copy)
3) The test case at line 673 have no much sense - it do not evolving any deep extending.
kangax, thanks for clarifying which objects are "native" and which are "host". Finally it is obvious that "plain objects" are native, not built-in, objects.
When I said that "plain objects" are DEFINABLE with the literal
{...}
notation, then I intend that all "plain objects" can be described with a{...}
notation.
Created objects with thenew Object()
notation can be entirely described with the{}
notation.I am conscious that an ideal implementation of
isPlainObject
is impossible in ES3 (probably even in ES5...), but the current one is a good compromise between accuracy and complexity. I can write several test cases that would makeisPlainObject
to fail, but that cases would be really unusual in real world. Currently the most slack part of the implementation is probablyobj.nodeType || obj.setInterval
and maybe I have a more robust (still not ideal) solution for it, but have to make some additional investigations...And if that's the only goal, why is there a [[Class]] check in current implementation? Does it mean that besides [[Prototype]] == Object.prototype, "plain object" should also have [[Class]] == "Object"?
Well, yes.
It's still hard to explain what "plain object" really is. And the reason I'm bringing this up is that when it's hard to explain what method really does, it usually means that something went wrong and probably needs to be rethought.
Well, maybe someone can explain it better than me. John?
Even if it is not simple to explain, it is still needed to distinguish "option hashes" from other objects.
I AM of idea that it was better to avoid any need of such hard-to-define functionalities, but John probably was of idea that it is worthwhile.
Host objects can have characteristics of native objects such as Object.getPrototypeOf(obj) === Object.prototype but that is not consistent or guaranteed across browsers/environments.
Of course. It is why I used host/native as an condition of the definition.
To be more clearer, we can say that "plain objects" are all "user" objects definable with the literal{...}
notation. In fact, first version of the function was namedisLiteralObject
. Later it was renamed toisPlainObject
.
Well, we can't easily (with no surplus costs) make additionally check on
obj.setInterval
. Neithertypeof
nor isFunction() would be enough.
Is there a more robus,t but still light, way to check if an object is a Window?Eventually we can do
typeof obj.nodeType === "number"
, but according to the jQuery core conventions, nodes are tested with a simpleobj.nodeType
.
Aaaaaaaah, you and the specification have confused me. I haven't switched native/host definitions. Am I?
My English is not too good, and the ECMA specification is not always clear to me. Maybe I am not the only one...If the whole point is that negated plain-objects are not always negative, then a simple replacement of
!obj
withobj == null
would be enough...
1) ECMA section 4.3.8: host object - object supplied by the host environment to complete the execution environment of ECMAScript. NOTE Any object that is not native is a host object.
Seems that I switched the two definitions. Sorry guys.
However, I am not absolutely sure that native/host distinction is exact the same for all browsers. For that reason I used quotes.So the corrected definition of "plain object" would be: Any NATIVE object
obj
that satisfiesObject.getPrototypeOf(obj) === Object.prototype
whereObject
is from the same window ofobj
.2) I believe kangax is saying because host objects are implementation dependent, they may/may not internally provide the same GetValue(expr) results, when evaluating the not (!) operator, as that of a native object.
Since we need NATIVE objects only, I think that the not-operator is quite safe here.
3) Simple truthy checks are pretty weak, you might additionally check for the expected types of each.
IF truthy checks are still weak to you, than we can simply replace
!obj
withobj == null
.
In theory, plain objects are all "host" objects
obj
that satisfiesObject.getPrototypeOf(obj) === Object.prototype
whereObject
is from the same window ofobj
.1) if object type converts to false, it's not a plain object (fwiw, all native Object objects should type convert to true, but host objects can easily type convert to false);
Can you give an example?
2) if object's [[Class]] is not "Object", it's not a plain object;
Of course. Instances of other "classes" will not be considered plain objects.
3) if there's no constructor property anywhere in object or its prototype chain, it's not a plain object.
Of course. Also in IE "native" objects have not
constructor
property which was helpful to detect strange behavior in IE wheretoString.call(aNative) === [object Object]
. Unfortunately it seams it was not working in the test suite, so!("constructor" in obj)
was replaced withobj.nodeType || obj.setInterval
.

-
rkatic committed 937036f5:
Made isPlainObject() supporting null, undefined, and window values on IE too. Also added some related tests. Fixes #5669.
-
jeresig committed 99d83fbd:
Bringing the effects module closer to being inline with the style guideline.
-
jeresig committed b70872f7:
Renamed the 'fx' module to 'effects'. Should've been done a long time ago.
-
jeresig committed 9368b188:
Removed jQuery.fn.contains - didn't match the :contains() selector and confused things. Thanks ajpiano for the tip.
Well, your version is faster only in the special (very rare) case of overwritted length property. In all other cases, my one was little faster.
Also you are not considering the case obj.length = new Number(N) - but yeah it is not so relevant I suppose.
Why the ^ is removed from the rtrim?