Improve tests

- split test_bigfloat.js from test_bignum.js
- make test_date() compatible with node
- document Date constructor string argument format:
  should add test cases for invalid strings
- test_argument_scope(): only test this syntax error in strict mode:
  `var f = function(a = eval("var arguments")) {};`
This commit is contained in:
Charlie Gordon
2024-02-17 21:54:19 +01:00
parent 85fb2caeae
commit 74bdb4967c
5 changed files with 310 additions and 226 deletions

View File

@@ -420,8 +420,12 @@ function test_argument_scope()
var f;
var c = "global";
f = function(a = eval("var arguments")) {};
assert_throws(SyntaxError, f);
(function() {
"use strict";
// XXX: node only throws in strict mode
f = function(a = eval("var arguments")) {};
assert_throws(SyntaxError, f);
})();
f = function(a = eval("1"), b = arguments[0]) { return b; };
assert(f(12), 12);