zephyr.js icon indicating copy to clipboard operation
zephyr.js copied to clipboard

Math.pow() not support in A101 and K64F

Open qiaojingx opened this issue 8 years ago • 7 comments

Description

Math.pow() not support in A101 and K64F

Test Code

test-buffer.js;

Steps to Reproduction

  1. create a simple test case as below: selection_004
  2. Build this simple test case and flash to A101.
  3. Thrown error. selection_005

Actual Result

  1. Run test code test-buffer.js on Arduino 101, FRDM-K64F: selection_001

Expected Result

No error thrown

Test Builds

Branch Commit Id Target Device Test Date Result
master 02d9471 Arduino 101 Mar 21, 2017 Fail
master 02d9471 FRDM-K64F Mar 21, 2017 Fail
master 02d9471 Linux Mar 21, 2017 Pass

Additional Information

qiaojingx avatar Mar 21 '17 09:03 qiaojingx

@grgustaf I don't think we support this do we? I don't recall us having any of the Math functions.

brianjjones avatar Mar 24 '17 14:03 brianjjones

We have always left out the Math library from JS to save space. However, we do have enough room these days that we could enable it, although it is large and would limit what other modules could be used. So this is basically a feature request, not a bug.

grgustaf avatar Mar 24 '17 22:03 grgustaf

We do have an easy-ish way to enable it. You can edit jerry_feature.profile and comment out the CONFIG_DISABLE_MATH_BUILTIN line. Then if you rebuild it will include the Math object. Eventually we may want to generate this file based on command line flags but there are quite a few of these features, so a config file makes the most sense IMO. Plus, its jerryscript that parses this file, so it takes out any makefile work we have to do.

jprestwo avatar Mar 24 '17 22:03 jprestwo

In ES2017, ** is a default operator for Math.pow, so at some point is should be supported even if the Math functions aren't

kenchris avatar Apr 14 '17 12:04 kenchris

@kenchris 7th Edition: ES2016* ;) I'm curious though—what is JerryScript's roadmap? I can't find anything anywhere. I'm going to file an issue over there to see what we can learn.

rwaldron avatar Apr 14 '17 18:04 rwaldron

Right, I meant ES2016, the release with only two new features ;)

kenchris avatar Apr 14 '17 19:04 kenchris

Lol, that was the best release ever :)

rwaldron avatar Apr 17 '17 17:04 rwaldron