#1678 JS issues

go4 Tue 25 Oct 2011

Func to Immutable

The Func.toImmutable is different between JS and Java. The JS implements do not follow the immutability rule.

Set Field complie

minX is a abstract field. the minX -= x be complied as:

this.minX() = fan.sys.Float.minus(this.minX(),x);

KeyChar

The Event.keyChar is not implemented. In the non-English countries, we need to use input method typing.

Call super field

class Base
{
  Str foo
}

class Sub
{
  Void main()
  {
    super.foo == this.foo
  }
}

In my experience, super.foo and this.foo is the same. But in Js, super.foo become .foo

CommandStack

The fwt::CommandStack miss the @Js facet.

UUID

Any way to support UUID API in javascript?

andy Tue 25 Oct 2011

Func to Immutable

Open ticket: #1144

Set Field compile

Can start a new topic with a short complete code sample that exhibits that issue?

The Event.keyChar is not implemented

Can you reliably get this information from the DOM APIs? A small patch for WidgetPeer.js would be best.

Call super field

Can you open that up in a new topic with code sample that shows issue (looks like Sub should extend Base there - otherwise should be enough)?

The fwt::CommandStack miss the @Js facet.

Pushed a fix to tip.

Any way to support UUID API in javascript?

Unless we change the API to work in 32-bit chunks, really can't make that work exactly like Java - though you could approximate behavior if you don't mind losing precision (106bits vs 128bits). Though thats probably not what we want todo.

go4 Wed 26 Oct 2011

Sorry. I start the new topic: `http://fantom.org/sidewalk/topic/1683` `http://fantom.org/sidewalk/topic/1684`.

UUID

Most of the time, I use the Uuid.toStr and don't care about the binary bit.

Event.keyChar

if(window.event) // IE
{
  keynum = e.keyCode
}
else if(e.which) // Netscape/Firefox/Opera
{
  keynum = e.which
}
keychar = String.fromCharCode(keynum)

Login or Signup to reply.