Bug 37391 - native runtime.js:392 Uncaught TypeError: object is not a function
Summary: native runtime.js:392 Uncaught TypeError: object is not a function
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-10 14:20 PDT by JTBrinkmann
Modified: 2010-04-10 23:27 PDT (History)
1 user (show)

See Also:


Attachments
HTML including the JS-code + Button that starts the methode (1.37 KB, text/html)
2010-04-10 14:20 PDT, JTBrinkmann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description JTBrinkmann 2010-04-10 14:20:04 PDT
Created attachment 53053 [details]
HTML including the JS-code + Button that starts the methode

after I tried to write a funtion to draw any (konvex) form (using rotation of divs with overflow: hidden), I got the error-message (in the error-console)you can find in the summary of this post. I used Google Chrome 4.1.249.1045 (carn't find the WebKit version it uses). The nighly build r57179 with safari returns the error saying my methode (called "form()") doesn't even is a function ("forms.html:32 TypeError: Result of expression 'form' [null] is not a function.") o.O
I don't get any other errors, that could let me know, my function is invalid (JSLint validates it (exept of telling me document.write() can be a form of eval <.<))
I don't say that my function is perfect and SHOULD work, but it doesn't work and tells me, that the JSCore of the WebKit used in Chrome has a bug (I guess).
If this infact is a bug only in Google Chrome, and not WebKit (while safari also don't tell me the real reason why it don't works), I'm sorry I wasted you your time (if I did)
For the html-file including the JS-code that caused the error see the attachment.
Comment 1 Alexey Proskuryakov 2010-04-10 23:27:29 PDT
There are two mistakes here that prevent the code from running:
1) script type="text/js" is not a registered type, so browsers don't think it's JavaScript, and simply ignore the content.
2) "form" in onclick handler means a property of the element - and HTMLInputElement.form refers to a form that contains it. Since there is no form around it, the property is null.

It works (fails) in exactly the same way in Firefox.

Please don't file bugs about code that doesn't work in any browser. There are better places to ask for general help with web development.