weimingtom / minijoe

Automatically exported from code.google.com/p/minijoe
1 stars 0 forks source link

String length property always return result as "9" rather than actual string length. #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Simple Javascript used to print given string length:
===========
var text = "hello";
var txtlen = text.length;
document.write(txtlen);
===========

What is the expected output? What do you see instead?
1. Expected output should be 5.
2. Actual result is 9. [ basically, it initialized obj with "undefined" and  
always return "undefined" length as 9.

What version of the product are you using? On what operating system?
1. initial version 1.0 from SVN.

Please provide any additional information below.

Original issue reported on code.google.com by bhupen...@gmail.com on 9 Jan 2009 at 6:08

GoogleCodeExporter commented 8 years ago
Please find the attached patch file for the above issue. 
just a small change was required.

Regards,
-Bhupender 

Original comment by bhupen...@gmail.com on 9 Jan 2009 at 10:04

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in SVN by applying length() to "this" instead of "something" that happens 
to be
on the stack

Original comment by stefan.haustein on 16 Mar 2009 at 12:03