Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12493 closed bug (wontfix)

null value in WebKit

Reported by: stefano@… Owned by: stefano@…
Priority: undecided Milestone: None
Component: attributes Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:

Description

In Chrome passing a null value to a $("div").text(null) method results in a "null" string printed inside the div.

http://jsbin.com/umihut/1/

Change History (4)

comment:1 Changed 7 years ago by dmethvin

Owner: set to stefano@…
Status: newpending

That's outside the valid inputs for the method, the docs clearly say it takes a string, and null is not a string. http://api.jquery.com/text/#text2

What result did you expect?

comment:2 Changed 7 years ago by anonymous

Is just a different behaviour. On the previous versions checking if the var is null was not necessary, now it prints out null.

comment:3 Changed 7 years ago by mikesherov

Resolution: wontfix
Status: pendingclosed

Thanks for contributing! However, unexpected inputs produce unexpected outputs! Unfortunately, we can't guarantee (and you shouldn't expect) that every invalid input to every function will behave the same way between versions. We only attempt to guarantee valid and consistent output for valid inputs.

For that reason, I'm going to close this bug as won't fix.

comment:4 Changed 7 years ago by mikesherov

Component: unfiledattributes
Note: See TracTickets for help on using tickets.