From bbc9ae15d99863d0d55495fddbcf3709b8eb3ffb Mon Sep 17 00:00:00 2001 From: test262-automation Date: Fri, 12 Oct 2018 18:42:30 +0000 Subject: [PATCH 1/2] [javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha d44c4f5a10 on Fri Oct 12 2018 18:39:22 GMT+0000 (Coordinated Universal Time) --- ...tion-cache-with-parameters-end-position.js | 40 +++++++++++++++++++ .../stress/function-constructor-name.js | 36 +++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 implementation-contributed/javascriptcore/stress/function-cache-with-parameters-end-position.js create mode 100644 implementation-contributed/javascriptcore/stress/function-constructor-name.js diff --git a/implementation-contributed/javascriptcore/stress/function-cache-with-parameters-end-position.js b/implementation-contributed/javascriptcore/stress/function-cache-with-parameters-end-position.js new file mode 100644 index 0000000000..b0ff2214d0 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/function-cache-with-parameters-end-position.js @@ -0,0 +1,40 @@ +function shouldBe(actual, expected) { + if (actual !== expected) + throw new Error('bad value: ' + actual); +} + +function shouldThrow(func, errorMessage) { + var errorThrown = false; + var error = null; + try { + func(); + } catch (e) { + errorThrown = true; + error = e; + } + if (!errorThrown) + throw new Error('not thrown'); + if (String(error) !== errorMessage) + throw new Error(`bad error: ${String(error)}`); +} + +for (var i = 0; i < 10; ++i) { + var f = Function('/*) {\n*/', 'return 42'); + shouldBe(f.toString(), +`function anonymous(/*) { +*/) { +return 42 +}`); +} +shouldThrow(() => Function('/*', '*/){\nreturn 42'), `SyntaxError: Parameters should match arguments offered as parameters in Function constructor.`); + +shouldThrow(() => Function('/*', '*/){\nreturn 43'), `SyntaxError: Parameters should match arguments offered as parameters in Function constructor.`); +for (var i = 0; i < 10; ++i) { + var f = Function('/*) {\n*/', 'return 43'); + shouldBe(f.toString(), +`function anonymous(/*) { +*/) { +return 43 +}`); +} + diff --git a/implementation-contributed/javascriptcore/stress/function-constructor-name.js b/implementation-contributed/javascriptcore/stress/function-constructor-name.js new file mode 100644 index 0000000000..bf7e9459ca --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/function-constructor-name.js @@ -0,0 +1,36 @@ +function shouldBe(actual, expected) { + if (actual !== expected) + throw new Error('bad value: ' + actual); +} + +var GeneratorFunction = function*(){}.constructor; +var AsyncFunction = async function(){}.constructor; +var AsyncGeneratorFunction = async function*(){}.constructor; + +var f = Function(`return 42`); +shouldBe(typeof anonymous, `undefined`); +shouldBe(f.toString(), +`function anonymous() { +return 42 +}`); + +var gf = GeneratorFunction(`return 42`); +shouldBe(typeof anonymous, `undefined`); +shouldBe(gf.toString(), +`function* anonymous() { +return 42 +}`); + +var af = AsyncFunction(`return 42`); +shouldBe(typeof anonymous, `undefined`); +shouldBe(af.toString(), +`async function anonymous() { +return 42 +}`); + +var agf = AsyncGeneratorFunction(`return 42`); +shouldBe(typeof anonymous, `undefined`); +shouldBe(agf.toString(), +`async function* anonymous() { +return 42 +}`); From db33ff222588447bdc1912da90f2d9c0e0ac3b7c Mon Sep 17 00:00:00 2001 From: test262-automation Date: Fri, 12 Oct 2018 18:42:34 +0000 Subject: [PATCH 2/2] [javascriptcore-test262-automation] Updated curation log with latest revision sha's from export and changed files. sourceRevisionAtLastExport: d44c4f5a10 targetRevisionAtLastExport: f595c41625 --- implementation-contributed/curation_logs/javascriptcore.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-contributed/curation_logs/javascriptcore.json b/implementation-contributed/curation_logs/javascriptcore.json index 2dd339a807..32ba7dbf35 100644 --- a/implementation-contributed/curation_logs/javascriptcore.json +++ b/implementation-contributed/curation_logs/javascriptcore.json @@ -1,6 +1,6 @@ { - "sourceRevisionAtLastExport": "d44c4f5a10", - "targetRevisionAtLastExport": "f595c41625", + "sourceRevisionAtLastExport": "54374edc2b", + "targetRevisionAtLastExport": "bbc9ae15d9", "curatedFiles": { "/stress/Number-isNaN-basics.js": "DELETED_IN_TARGET", "/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js": "DELETED_IN_TARGET",