Fix new ArrayBuffer(length) for variaous input (#1959)

Currently new ArrayBuffer(length) does not conform to ES2017.
Major JS implementations follow ES2017 for ArrayBuffer(length).

For example, new ArrayBuffer(length) should not throw RangeError
for length = NaN, undefined, negative number, floating point, and so on.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
This commit is contained in:
Sanggyu Lee
2017-08-16 19:20:41 +09:00
committed by Zidong Jiang
parent af16a3ae1a
commit c1cff3f961
12 changed files with 128 additions and 43 deletions
@@ -13,15 +13,5 @@
* limitations under the License.
*/
var name = "";
try
{
var a = new ArrayBuffer("string");
}
catch (e)
{
name = e.name;
}
assert(name === "RangeError");
var a = new ArrayBuffer("string");
assert(a.byteLength === 0);