Code Monkey home page Code Monkey logo

minijoe's Introduction

minijoe's People

Contributors

stefanhaustein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

chendz dakics

minijoe's Issues

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

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 [email protected] on 9 Jan 2009 at 6:08

Images won't display.

What steps will reproduce the problem?
  1. Create a new .js file in the "javascript" directory.
  2. Include your .js file in the build script (to compile it) and in
    MjRuntime.java
  3. After adding the following code, try to run your javascript (using
    run-runtime):

var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var img = new Image();
img.src = 'images/star.png';
ctx.drawImage(img,0,0);

What is the expected output? What do you see instead?

The expected output, is that star.png shows in the upper-lefthand corner of
the canvas.  Instead, I get an exception.  Exception included below.  The
same javascript code works fine in a browser.


What version of the product are you using? On what operating system?

I've checked out the latest from the trunk. I am using windows XP, with
WTK 2.5.1.

Please provide any additional information below.

   [wtkrun] java.lang.NullPointerException
   [wtkrun]     at com.google.minijoe.sys.JsFunction.eval(+2248)
   [wtkrun]     at com.google.minijoe.sys.JsFunction.exec(+70)
   [wtkrun]     at com.google.minijoe.samples.runtime.MjRuntime.commandAction(+89)
   [wtkrun]     at javax.microedition.lcdui.List.callKeyPressed(+80)
   [wtkrun]     at javax.microedition.lcdui.Display$DisplayAccessor.keyEvent(+198)
   [wtkrun]     at
javax.microedition.lcdui.Display$DisplayManagerImpl.keyEvent(+11)
   [wtkrun]     at com.sun.midp.lcdui.DefaultEventHandler.keyEvent(+127)
   [wtkrun]     at com.sun.midp.lcdui.AutomatedEventHandler.keyEvent(+210)
   [wtkrun]     at
com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+114)
   [wtkrun]     at
com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)
   [wtkrun] com.google.minijoe.sys.JsException: Error at line 3 (pc:0x21):
ReferenceError: java.lang.NullPointerException
   [wtkrun]     at com.google.minijoe.sys.JsFunction.eval(+3009)
   [wtkrun]     at com.google.minijoe.sys.JsFunction.exec(+70)
   [wtkrun]     at com.google.minijoe.samples.runtime.MjRuntime.commandAction(+89)
   [wtkrun]     at javax.microedition.lcdui.List.callKeyPressed(+80)
   [wtkrun]     at javax.microedition.lcdui.Display$DisplayAccessor.keyEvent(+198)
   [wtkrun]     at
javax.microedition.lcdui.Display$DisplayManagerImpl.keyEvent(+11)
   [wtkrun]     at com.sun.midp.lcdui.DefaultEventHandler.keyEvent(+127)
   [wtkrun]     at com.sun.midp.lcdui.AutomatedEventHandler.keyEvent(+210)
   [wtkrun]     at
com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+114)
   [wtkrun]     at
com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)




Original issue reported on code.google.com by [email protected] on 13 Apr 2009 at 4:53

date.toTimeString does not work

There's a typo in JsDate.java when declaring the prototype for
"toTimeString." The prototype declares the method as "toTimeSring" (missing
't').

Original issue reported on code.google.com by [email protected] on 9 Jun 2009 at 3:57

date.toString should return local time and not UTC

JavaScript date.toString() should return a date/time string in local time
and not UTC. The bug is in JsDate.toString(), which should call the other
toString method with the "utc" parameter set to false.

Original issue reported on code.google.com by [email protected] on 9 Jun 2009 at 4:07

Element.getChildById(String id) is not correct

public Element getChildById(String id) {
     int childCount = this.getChildCount();
      Element currChild = null;
      for (int i=0; i < childCount; i++) {
          if (this.getChildType(i) == this.ELEMENT) {
              currChild = this.getElement(i);             
              if (currChild != null && 
                      id.equals(currChild.getAttributeValue("id"))
                      ) {
                  break;
              } else if (currChild.getChildCount() > 0) {
                  currChild.getChildById(id);
              }               
          }
      }
      return currChild;
  }

Above is the current implementation. If there is no child element with the 
specified id, the function will traverse through and return the last child. Am 
I right?

Original issue reported on code.google.com by [email protected] on 26 Dec 2010 at 12:35

For...In statement inside a function doesn't allow variable to be local.

What steps will reproduce the problem?
1. Run the following script:

works();
fails();

function fails() {
    var mychars = new Array("a","b");   
    var x;
    for (x in mychars) {
        print("x:"+x);
    }
}

function works() {
    var mychars = new Array("a","b");   
    //var x;                          <----- local variable commented
    for (x in mychars) {
        print("x:"+x);
    }
}

What is the expected output? What do you see instead?
Both For...In statements should produce valid print results.

works() emits:
x:0
x:1

fails() emits:
x:java.util.Vector$1@1ffb8dc
x:java.util.Vector$1@1ffb8dc

What version of the product are you using? On what operating system?
minijoe-1.0.zip
Windows XP

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Mar 2009 at 9:47

JsArray's bug

What steps will reproduce the problem?
Try to execute the script code as below:
  var array = new Array();
  array.push("a");
  array.push("b");
  var len = array.length;

What is the expected output? What do you see instead?
The value of "len" must be 2,but actually it is 6.

What version of the product are you using? On what operating system?
1.0, windows xp sp2

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 24 Jul 2009 at 6:18

Try/Catch causes an "Unresolved Jump Label" exception

What steps will reproduce the problem?
1. In JavaScript use a try/catch around the entire code in a file
2. compile

What is the expected output? What do you see instead?

Any errors through should be caught.

What version of the product are you using? On what operating system?

Minijoe v1.0 + Windoze X-peeper

Please provide any additional information below.

CODE:

try {
  .... any code here
} catch (e) {
  print(e);
}

STACKTRACE:

com.google.minijoe.compiler.CompilerException: Unresolved Jump Label:
finally=481523300 at line: 0
    at
com.google.minijoe.compiler.visitor.CodeGenerationVisitor.writeCodeBlock(+126)
    at com.google.minijoe.compiler.visitor.CodeGenerationVisitor.visit(+90)
    at com.google.minijoe.compiler.Eval.compile(+61)
    at net.xxx.j2me.xxx.xxxEnvironment.compile(+82)
    at net.xxx.j2me.xxx.xxxEnvironment.runScript(+4)
    at net.xxx.j2me.xxx.xxxEnvironment.<init>(+467)
    at net.xxx.j2me.xxx.xxx.startApp(+116)
    at javax.microedition.midlet.MIDletProxy.startApp(+7)
    at com.sun.midp.midlet.Scheduler.schedule(+270)
    at com.sun.midp.main.Main.runLocalClass(+28)
    at com.sun.midp.main.Main.main(+80)

** package/product names and domain changed for privacy.

Original issue reported on code.google.com by [email protected] on 24 Apr 2009 at 2:01

Length of String is bad implemented

I found this bug on JsObject method evalNative line 874.

stack.setInt(sp, stack.getString(sp).length());

stack is empty. I solved it by replace this line by:

stack.setInt(sp, ((String)this.value).length());

Original issue reported on code.google.com by [email protected] on 11 May 2014 at 4:15

Character literals give incorrect comparisons

What steps will reproduce the problem?
1. eg. Given the following two statements both will print but only the
second should print. 
    if ('a' >= 'b') { print(">="); }
    if ('a' <= 'b') { print("<="); }
2.  < and > comparisons are also incorrect.
3.

What is the expected output? What do you see instead?
I expect 'a' to be <= to 'b' and not >=.

What version of the product are you using? On what operating system?
minijoe-1.0.zip Windows XP.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 11 Feb 2009 at 6:20

toUpperCase & toLowerCase not working.

What steps will reproduce the problem?
1. 'LOWER'.toLowerCase() 
2.
3.

What is the expected output? What do you see instead?
expected:lower
actual:tolowercase

What version of the product are you using? On what operating system?
JsObject R41

Please provide any additional information below.
I think it should be:
  stack.setObject(sp, stack.getString(sp).toLowerCase());
Was changed to:
  stack.setObject(sp, stack.getString(sp + 2).toLowerCase());
Same for toUppercase.

Original issue reported on code.google.com by [email protected] on 16 Mar 2009 at 11:04

HTML Canvas Support

Not quite an issue, but, is HTML Canvas support planned?

Can we add support, and if so, what's the preferred Graphics API?
... and that being said, would the rasterization be done entirely
in minijoe, not using a parent API.

I'd imagine we'd want to use a parent API, as compiling to an API would
likely target native hardware on a device.

Original issue reported on code.google.com by [email protected] on 31 Mar 2009 at 7:24

Array length is wrong

What steps will reproduce the problem?
1.
var times = [];
times[0] = 5;
times[1] = 8;
times[2] = 15;
print("times.length " + times.length) ;

> displays : "times.length 1"

What is the expected output? What do you see instead?
displays : "times.length 3"

What version of the product are you using? On what operating system?
Minijoe-1.0.zip, same behaviour with latest svn version.

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 22 Jan 2010 at 3:57

Unreferenced variable in canvasoids.js

What steps will reproduce the problem?
1. Open /javascript/canvasoids.html from Chrome
2. Go to developer tools/Java Script console
3. Open "Scripts" and error would show

What is the expected output? What do you see instead?
At line #63 variable "lives" is set to 0.
In lines 277,304,306,322,324 variable "lifes" is used instead.

What version of the product are you using? On what operating system?
SVN Revision 52, Windows XP

Please provide any additional information below.
Replacing all lifes->lives fixes the error.
Also, canvasoids.html has minor typing error in the <title> tag.

Original issue reported on code.google.com by [email protected] on 30 Sep 2009 at 8:23

Runtime debugging

It is not a issues but should be an enhancement. Will minijoe plan to add
debug support? 

Original issue reported on code.google.com by [email protected] on 5 Aug 2009 at 7:19

date.toLocaleDateString does not work

The method date.toLocaleDateString returns the time portion of the date
instead of the date portion. The bug is in the prototype declaration in
JsDate.java. That method should reference ID_TO_LOCALE_DATE_STRING instead
of ID_TO_TIME_STRING. Also, date.toLocaleTimeString should probably
reference ID_TO_LOCALE_TIME_STRING instead of ID_TO_TIME_STRING.

Original issue reported on code.google.com by [email protected] on 9 Jun 2009 at 4:01

Application crshes when runs on N79

What steps will reproduce the problem?
1.
Run my own javascript code that have a lot of functions calls on Nokia N79
device


What is the expected output? What do you see instead?
The application should work properly but the application crashed.
I think it's stack overflow that happens in JsFunction eval function.

What version of the product are you using? On what operating system?
Everything works fine in other device and OS. Just not N79 and E55

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 18 Nov 2009 at 4:41

String.split doesn't work

String.split doesn't work. In JsObject, the STRING_PROTOTYPE does not
define the method name and parameter count.

In the actual implementation in evalNative, there's also a bug if the
caller doesn't not specify the "limit." In that case, an empty JsArray is
returned and instead it should split the whole string.

Original issue reported on code.google.com by [email protected] on 29 Jul 2009 at 8:37

date.toDateString does not work

date.toDateString returns the time portion instead of the date portion. The
bug is in the prototype in JsDate.java. The "toDateString" method should
reference ID_TO_DATE_STRING and not ID_TO_TIME_STRING.

Original issue reported on code.google.com by [email protected] on 9 Jun 2009 at 3:58

Prototyping not working within script.

What steps will reproduce the problem?

var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");

var y = 10;
var x = 50;


function A() {
    this.text = "Hello";
    this.drawText = function() {
        context.fillStyle='black';
        context.translate(this.x+5,this.y+15);
        context.mozTextStyle="9pt bold Verdana";
        context.mozDrawText(this.text);
        context.translate(-1 * (this.x+5),-1 * (this.y+15));
    }

}

function B() {
}
B.prototype = new A();


b = new B();
b.drawText();

What is the expected output? What do you see instead?
Hello

What version of the product are you using? On what operating system?
Code from SVN

Please provide any additional information below.
Prototyping not working within script.

Original issue reported on code.google.com by [email protected] on 6 Sep 2009 at 5:35

com.google.minijoe.samples.runtime.Context2D.split can not surprisingly.

What steps will reproduce the problem?
1. class: com.google.minijoe.samples.runtime.Context2D
2. Method:  static String[] split(String s, char c)
3. LineNmuber: 174
4. Version: r23

What is the expected output? What do you see instead?

input: split("0,0,0",',');
expected output: String[]{"0", "0", "0"};
actually output: String[]{"0",null,null};

What version of the product are you using? On what operating system?

minijoe:minijoe-1.0.zip
OS:windows-xp-sp3 + Java-6-u17

Please provide any additional information below.

the split() method maybe:

static String[] split(String s, char c) {
    int count = 1;
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) == c) {
        count++;
      }
    }
    String[] parts = new String[count];
    int lastCut = 0;
    int n = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) == c) {
        parts[n++] = s.substring(lastCut, i);
        lastCut = i + 1;
      }
    }
    parts[n] = s.substring(lastCut, s.length());
    return parts;
  }


Original issue reported on code.google.com by [email protected] on 29 Jun 2010 at 2:59

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.