From c644ede43027d4b9437bf084923d99aa4c4905e6 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 2 Oct 2020 09:35:56 -0400 Subject: [PATCH] Built-in function objects that are not identified as constructors must throw a TypeError exception when new'ed. Fixes gh-1739 --- .../prototype/getYear/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setYear/not-a-constructor.js | 27 +++++++++++++++++++ .../toGMTString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/anchor/not-a-constructor.js | 27 +++++++++++++++++++ .../String/prototype/big/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/blink/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/bold/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/fixed/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/fontcolor/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/fontsize/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/italics/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/link/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/small/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/strike/not-a-constructor.js | 27 +++++++++++++++++++ .../String/prototype/sub/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/substr/not-a-constructor.js | 27 +++++++++++++++++++ .../String/prototype/sup/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/escape/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/unescape/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Array/from/not-a-constructor.js | 23 ++++++++++++++++ .../Array/isArray/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Array/of/not-a-constructor.js | 24 ++++++++++++----- .../Symbol.iterator/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/concat/not-a-constructor.js | 25 ++++++++++------- .../prototype/copyWithin/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/entries/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/every/not-a-constructor.js | 27 +++++++++++++++++++ .../Array/prototype/fill/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/filter/not-a-constructor.js | 27 +++++++++++++++++++ .../Array/prototype/find/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/findIndex/not-a-constructor.js | 27 +++++++++++++++++++ .../Array/prototype/flat/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/flatMap/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/forEach/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/includes/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/indexOf/not-a-constructor.js | 27 +++++++++++++++++++ .../Array/prototype/join/not-a-constructor.js | 23 ++++++++++++++++ .../Array/prototype/keys/not-a-constructor.js | 23 ++++++++++++++++ .../lastIndexOf/not-a-constructor.js | 27 +++++++++++++++++++ .../Array/prototype/map/not-a-constructor.js | 23 ++++++++++++++++ .../Array/prototype/pop/not-a-constructor.js | 23 ++++++++++++++++ .../Array/prototype/push/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/reduce/not-a-constructor.js | 27 +++++++++++++++++++ .../reduceRight/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/reverse/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/shift/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/slice/not-a-constructor.js | 27 +++++++++++++++++++ .../Array/prototype/some/not-a-constructor.js | 23 ++++++++++++++++ .../Array/prototype/sort/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/splice/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/unshift/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/values/not-a-constructor.js | 27 +++++++++++++++++++ .../ArrayBuffer/isView/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/slice/not-a-constructor.js | 27 +++++++++++++++++++ .../Atomics/add/not-a-constructor.js | 23 ++++++++++++++++ .../Atomics/and/not-a-constructor.js | 23 ++++++++++++++++ .../compareExchange/not-a-constructor.js | 27 +++++++++++++++++++ .../Atomics/exchange/not-a-constructor.js | 23 ++++++++++++++++ .../Atomics/isLockFree/not-a-constructor.js | 23 ++++++++++++++++ .../Atomics/load/not-a-constructor.js | 23 ++++++++++++++++ .../Atomics/notify/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Atomics/or/not-a-constructor.js | 23 ++++++++++++++++ .../Atomics/store/not-a-constructor.js | 23 ++++++++++++++++ .../Atomics/sub/not-a-constructor.js | 23 ++++++++++++++++ .../Atomics/xor/not-a-constructor.js | 23 ++++++++++++++++ .../BigInt/asIntN/not-a-constructor.js | 20 ++++++++++++++ .../BigInt/asUintN/not-a-constructor.js | 20 ++++++++++++++ .../toLocaleString/not-a-constructor.js | 25 +++++++++++++++++ .../prototype/toString/not-a-constructor.js | 25 +++++++++++++++++ .../prototype/valueOf/not-a-constructor.js | 25 +++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/valueOf/not-a-constructor.js | 27 +++++++++++++++++++ .../getBigInt64/not-a-constructor.js | 27 +++++++++++++++++++ .../getBigUint64/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getFloat32/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getFloat64/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getInt16/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getInt32/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getInt8/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getUint16/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getUint32/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getUint8/not-a-constructor.js | 27 +++++++++++++++++++ .../setBigInt64/not-a-constructor.js | 27 +++++++++++++++++++ .../setBigUint64/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setFloat32/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setFloat64/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setInt16/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setInt32/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setInt8/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setUint16/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setUint32/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setUint8/not-a-constructor.js | 27 +++++++++++++++++++ test/built-ins/Date/UTC/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Date/now/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Date/parse/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/getDate/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getDay/not-a-constructor.js | 27 +++++++++++++++++++ .../getFullYear/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getHours/not-a-constructor.js | 27 +++++++++++++++++++ .../getMilliseconds/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getMinutes/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getMonth/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getSeconds/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getTime/not-a-constructor.js | 27 +++++++++++++++++++ .../getTimezoneOffset/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getUTCDate/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/getUTCDay/not-a-constructor.js | 27 +++++++++++++++++++ .../getUTCFullYear/not-a-constructor.js | 27 +++++++++++++++++++ .../getUTCHours/not-a-constructor.js | 27 +++++++++++++++++++ .../getUTCMilliseconds/not-a-constructor.js | 27 +++++++++++++++++++ .../getUTCMinutes/not-a-constructor.js | 27 +++++++++++++++++++ .../getUTCMonth/not-a-constructor.js | 27 +++++++++++++++++++ .../getUTCSeconds/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setDate/not-a-constructor.js | 27 +++++++++++++++++++ .../setFullYear/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setHours/not-a-constructor.js | 27 +++++++++++++++++++ .../setMilliseconds/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setMinutes/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setMonth/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setSeconds/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setTime/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/setUTCDate/not-a-constructor.js | 27 +++++++++++++++++++ .../setUTCFullYear/not-a-constructor.js | 27 +++++++++++++++++++ .../setUTCHours/not-a-constructor.js | 27 +++++++++++++++++++ .../setUTCMilliseconds/not-a-constructor.js | 27 +++++++++++++++++++ .../setUTCMinutes/not-a-constructor.js | 27 +++++++++++++++++++ .../setUTCMonth/not-a-constructor.js | 27 +++++++++++++++++++ .../setUTCSeconds/not-a-constructor.js | 27 +++++++++++++++++++ .../toDateString/not-a-constructor.js | 27 +++++++++++++++++++ .../toISOString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toJSON/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleDateString/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleString/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleTimeString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../toTimeString/not-a-constructor.js | 27 +++++++++++++++++++ .../toUTCString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/valueOf/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../cleanupSome/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/register/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/unregister/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/apply/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/bind/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/call/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../next/not-a-constructor.js | 27 +++++++++++++++++++ .../return/not-a-constructor.js | 27 +++++++++++++++++++ .../throw/not-a-constructor.js | 27 +++++++++++++++++++ .../built-ins/JSON/parse/not-a-constructor.js | 23 ++++++++++++++++ .../JSON/stringify/not-a-constructor.js | 23 ++++++++++++++++ .../Symbol.iterator/not-a-constructor.js | 27 +++++++++++++++++++ .../Map/prototype/clear/not-a-constructor.js | 23 ++++++++++++++++ .../Map/prototype/delete/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/entries/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/forEach/not-a-constructor.js | 27 +++++++++++++++++++ .../Map/prototype/get/not-a-constructor.js | 23 ++++++++++++++++ .../Map/prototype/has/not-a-constructor.js | 23 ++++++++++++++++ .../Map/prototype/keys/not-a-constructor.js | 23 ++++++++++++++++ .../Map/prototype/set/not-a-constructor.js | 23 ++++++++++++++++ .../Map/prototype/values/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/abs/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/acos/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/acosh/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/asin/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/asinh/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/atan/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/atan2/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/atanh/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/cbrt/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/ceil/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/clz32/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/cos/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/cosh/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/exp/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/expm1/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/floor/not-a-constructor.js | 23 ++++++++++++++++ .../Math/fround/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/hypot/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/imul/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/log/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/log10/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/log1p/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/log2/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/max/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/min/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/pow/not-a-constructor.js | 23 ++++++++++++++++ .../Math/random/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/round/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/sign/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/sin/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/sinh/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/sqrt/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/tan/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/Math/tanh/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Math/trunc/not-a-constructor.js | 23 ++++++++++++++++ .../Number/isFinite/not-a-constructor.js | 23 ++++++++++++++++ .../Number/isInteger/not-a-constructor.js | 23 ++++++++++++++++ .../Number/isNaN/not-a-constructor.js | 23 ++++++++++++++++ .../Number/isSafeInteger/not-a-constructor.js | 23 ++++++++++++++++ .../Number/parseFloat/not-a-constructor.js | 23 ++++++++++++++++ .../Number/parseInt/not-a-constructor.js | 23 ++++++++++++++++ .../toExponential/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toFixed/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleString/not-a-constructor.js | 27 +++++++++++++++++++ .../toPrecision/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/valueOf/not-a-constructor.js | 27 +++++++++++++++++++ .../Object/assign/not-a-constructor.js | 23 ++++++++++++++++ .../Object/create/not-a-constructor.js | 23 ++++++++++++++++ .../defineProperties/not-a-constructor.js | 27 +++++++++++++++++++ .../defineProperty/not-a-constructor.js | 27 +++++++++++++++++++ .../Object/entries/not-a-constructor.js | 23 ++++++++++++++++ .../Object/freeze/not-a-constructor.js | 23 ++++++++++++++++ .../Object/fromEntries/not-a-constructor.js | 23 ++++++++++++++++ .../not-a-constructor.js | 27 +++++++++++++++++++ .../not-a-constructor.js | 27 +++++++++++++++++++ .../getOwnPropertyNames/not-a-constructor.js | 27 +++++++++++++++++++ .../not-a-constructor.js | 27 +++++++++++++++++++ .../getPrototypeOf/not-a-constructor.js | 27 +++++++++++++++++++ test/built-ins/Object/is/not-a-constructor.js | 23 ++++++++++++++++ .../Object/isExtensible/not-a-constructor.js | 23 ++++++++++++++++ .../Object/isFrozen/not-a-constructor.js | 23 ++++++++++++++++ .../Object/isSealed/not-a-constructor.js | 23 ++++++++++++++++ .../Object/keys/not-a-constructor.js | 23 ++++++++++++++++ .../preventExtensions/not-a-constructor.js | 27 +++++++++++++++++++ .../hasOwnProperty/not-a-constructor.js | 27 +++++++++++++++++++ .../isPrototypeOf/not-a-constructor.js | 27 +++++++++++++++++++ .../propertyIsEnumerable/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/valueOf/not-a-constructor.js | 27 +++++++++++++++++++ .../Object/seal/not-a-constructor.js | 23 ++++++++++++++++ .../setPrototypeOf/not-a-constructor.js | 27 +++++++++++++++++++ .../Object/values/not-a-constructor.js | 23 ++++++++++++++++ .../Promise/all/not-a-constructor.js | 23 ++++++++++++++++ .../Promise/allSettled/not-a-constructor.js | 23 ++++++++++++++++ .../Promise/any/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/catch/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/finally/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/then/not-a-constructor.js | 27 +++++++++++++++++++ .../Promise/race/not-a-constructor.js | 23 ++++++++++++++++ .../Promise/reject/not-a-constructor.js | 23 ++++++++++++++++ .../Promise/resolve/not-a-constructor.js | 23 ++++++++++++++++ .../Reflect/apply/not-a-constructor.js | 23 ++++++++++++++++ .../Reflect/construct/not-a-constructor.js | 23 ++++++++++++++++ .../defineProperty/not-a-constructor.js | 27 +++++++++++++++++++ .../deleteProperty/not-a-constructor.js | 27 +++++++++++++++++++ .../Reflect/get/not-a-constructor.js | 23 ++++++++++++++++ .../not-a-constructor.js | 27 +++++++++++++++++++ .../getPrototypeOf/not-a-constructor.js | 27 +++++++++++++++++++ .../Reflect/has/not-a-constructor.js | 23 ++++++++++++++++ .../Reflect/isExtensible/not-a-constructor.js | 23 ++++++++++++++++ .../Reflect/ownKeys/not-a-constructor.js | 23 ++++++++++++++++ .../preventExtensions/not-a-constructor.js | 27 +++++++++++++++++++ .../Reflect/set/not-a-constructor.js | 23 ++++++++++++++++ .../setPrototypeOf/not-a-constructor.js | 27 +++++++++++++++++++ .../Symbol.match/not-a-constructor.js | 27 +++++++++++++++++++ .../Symbol.matchAll/not-a-constructor.js | 27 +++++++++++++++++++ .../Symbol.replace/not-a-constructor.js | 27 +++++++++++++++++++ .../Symbol.search/not-a-constructor.js | 27 +++++++++++++++++++ .../Symbol.split/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/exec/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/test/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../Symbol.iterator/not-a-constructor.js | 27 +++++++++++++++++++ .../Set/prototype/add/not-a-constructor.js | 23 ++++++++++++++++ .../Set/prototype/clear/not-a-constructor.js | 23 ++++++++++++++++ .../Set/prototype/delete/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/entries/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/forEach/not-a-constructor.js | 27 +++++++++++++++++++ .../Set/prototype/has/not-a-constructor.js | 23 ++++++++++++++++ .../Set/prototype/values/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/slice/not-a-constructor.js | 27 +++++++++++++++++++ .../String/fromCharCode/not-a-constructor.js | 23 ++++++++++++++++ .../String/fromCodePoint/not-a-constructor.js | 23 ++++++++++++++++ .../Symbol.iterator/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/charAt/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/charCodeAt/not-a-constructor.js | 27 +++++++++++++++++++ .../codePointAt/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/concat/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/endsWith/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/includes/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/indexOf/not-a-constructor.js | 27 +++++++++++++++++++ .../lastIndexOf/not-a-constructor.js | 27 +++++++++++++++++++ .../localeCompare/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/match/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/matchAll/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/normalize/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/padEnd/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/padStart/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/repeat/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/replace/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/replaceAll/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/search/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/slice/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/split/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/startsWith/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/substring/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleLowerCase/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleUpperCase/not-a-constructor.js | 27 +++++++++++++++++++ .../toLowerCase/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../toUpperCase/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/trim/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/trimEnd/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/trimStart/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/valueOf/not-a-constructor.js | 27 +++++++++++++++++++ .../built-ins/String/raw/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/Symbol/for/not-a-constructor.js | 23 ++++++++++++++++ .../Symbol/keyFor/not-a-constructor.js | 23 ++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/valueOf/not-a-constructor.js | 27 +++++++++++++++++++ .../TypedArray/from/not-a-constructor.js | 23 ++++++++++++++++ .../TypedArray/of/not-a-constructor.js | 23 ++++++++++++++++ .../Symbol.iterator/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/copyWithin/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/entries/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/every/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/fill/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/filter/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/find/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/findIndex/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/forEach/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/includes/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/indexOf/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/join/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/keys/not-a-constructor.js | 27 +++++++++++++++++++ .../lastIndexOf/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/map/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/reduce/not-a-constructor.js | 27 +++++++++++++++++++ .../reduceRight/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/reverse/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/set/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/slice/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/some/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/sort/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/subarray/not-a-constructor.js | 27 +++++++++++++++++++ .../toLocaleString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/toString/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/values/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/delete/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/get/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/has/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/set/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/deref/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/add/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/delete/not-a-constructor.js | 27 +++++++++++++++++++ .../prototype/has/not-a-constructor.js | 27 +++++++++++++++++++ test/built-ins/decodeURI/not-a-constructor.js | 23 ++++++++++++++++ .../decodeURIComponent/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/encodeURI/not-a-constructor.js | 23 ++++++++++++++++ .../encodeURIComponent/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/eval/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/isFinite/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/isNaN/not-a-constructor.js | 23 ++++++++++++++++ .../built-ins/parseFloat/not-a-constructor.js | 23 ++++++++++++++++ test/built-ins/parseInt/not-a-constructor.js | 23 +++++++++++----- 360 files changed, 9164 insertions(+), 23 deletions(-) create mode 100644 test/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js create mode 100644 test/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js create mode 100644 test/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/anchor/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/big/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/blink/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/bold/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/fixed/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/italics/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/link/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/small/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/strike/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/sub/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/substr/not-a-constructor.js create mode 100644 test/annexB/built-ins/String/prototype/sup/not-a-constructor.js create mode 100644 test/annexB/built-ins/escape/not-a-constructor.js create mode 100644 test/annexB/built-ins/unescape/not-a-constructor.js create mode 100644 test/built-ins/Array/from/not-a-constructor.js create mode 100644 test/built-ins/Array/isArray/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/copyWithin/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/entries/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/every/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/fill/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/filter/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/find/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/findIndex/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/flat/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/flatMap/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/forEach/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/includes/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/indexOf/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/join/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/keys/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/map/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/pop/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/push/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/reduce/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/reduceRight/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/reverse/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/shift/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/slice/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/some/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/sort/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/splice/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/unshift/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/values/not-a-constructor.js create mode 100644 test/built-ins/ArrayBuffer/isView/not-a-constructor.js create mode 100644 test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js create mode 100644 test/built-ins/Atomics/add/not-a-constructor.js create mode 100644 test/built-ins/Atomics/and/not-a-constructor.js create mode 100644 test/built-ins/Atomics/compareExchange/not-a-constructor.js create mode 100644 test/built-ins/Atomics/exchange/not-a-constructor.js create mode 100644 test/built-ins/Atomics/isLockFree/not-a-constructor.js create mode 100644 test/built-ins/Atomics/load/not-a-constructor.js create mode 100644 test/built-ins/Atomics/notify/not-a-constructor.js create mode 100644 test/built-ins/Atomics/or/not-a-constructor.js create mode 100644 test/built-ins/Atomics/store/not-a-constructor.js create mode 100644 test/built-ins/Atomics/sub/not-a-constructor.js create mode 100644 test/built-ins/Atomics/xor/not-a-constructor.js create mode 100644 test/built-ins/BigInt/asIntN/not-a-constructor.js create mode 100644 test/built-ins/BigInt/asUintN/not-a-constructor.js create mode 100644 test/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js create mode 100644 test/built-ins/BigInt/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/BigInt/prototype/valueOf/not-a-constructor.js create mode 100644 test/built-ins/Boolean/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/Boolean/prototype/valueOf/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getFloat32/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getFloat64/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getInt16/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getInt32/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getInt8/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getUint16/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getUint32/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/getUint8/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setFloat32/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setFloat64/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setInt16/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setInt32/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setInt8/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setUint16/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setUint32/not-a-constructor.js create mode 100644 test/built-ins/DataView/prototype/setUint8/not-a-constructor.js create mode 100644 test/built-ins/Date/UTC/not-a-constructor.js create mode 100644 test/built-ins/Date/now/not-a-constructor.js create mode 100644 test/built-ins/Date/parse/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getDate/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getDay/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getFullYear/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getHours/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getMinutes/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getMonth/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getSeconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getTime/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCDate/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCDay/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCHours/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setDate/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setFullYear/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setHours/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setMinutes/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setMonth/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setSeconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setTime/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setUTCDate/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setUTCHours/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toDateString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toISOString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toJSON/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toLocaleString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toTimeString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/toUTCString/not-a-constructor.js create mode 100644 test/built-ins/Date/prototype/valueOf/not-a-constructor.js create mode 100644 test/built-ins/Error/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js create mode 100644 test/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js create mode 100644 test/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js create mode 100644 test/built-ins/Function/prototype/apply/not-a-constructor.js create mode 100644 test/built-ins/Function/prototype/bind/not-a-constructor.js create mode 100644 test/built-ins/Function/prototype/call/not-a-constructor.js create mode 100644 test/built-ins/Function/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/GeneratorPrototype/next/not-a-constructor.js create mode 100644 test/built-ins/GeneratorPrototype/return/not-a-constructor.js create mode 100644 test/built-ins/GeneratorPrototype/throw/not-a-constructor.js create mode 100644 test/built-ins/JSON/parse/not-a-constructor.js create mode 100644 test/built-ins/JSON/stringify/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/clear/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/delete/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/entries/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/forEach/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/get/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/has/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/keys/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/set/not-a-constructor.js create mode 100644 test/built-ins/Map/prototype/values/not-a-constructor.js create mode 100644 test/built-ins/Math/abs/not-a-constructor.js create mode 100644 test/built-ins/Math/acos/not-a-constructor.js create mode 100644 test/built-ins/Math/acosh/not-a-constructor.js create mode 100644 test/built-ins/Math/asin/not-a-constructor.js create mode 100644 test/built-ins/Math/asinh/not-a-constructor.js create mode 100644 test/built-ins/Math/atan/not-a-constructor.js create mode 100644 test/built-ins/Math/atan2/not-a-constructor.js create mode 100644 test/built-ins/Math/atanh/not-a-constructor.js create mode 100644 test/built-ins/Math/cbrt/not-a-constructor.js create mode 100644 test/built-ins/Math/ceil/not-a-constructor.js create mode 100644 test/built-ins/Math/clz32/not-a-constructor.js create mode 100644 test/built-ins/Math/cos/not-a-constructor.js create mode 100644 test/built-ins/Math/cosh/not-a-constructor.js create mode 100644 test/built-ins/Math/exp/not-a-constructor.js create mode 100644 test/built-ins/Math/expm1/not-a-constructor.js create mode 100644 test/built-ins/Math/floor/not-a-constructor.js create mode 100644 test/built-ins/Math/fround/not-a-constructor.js create mode 100644 test/built-ins/Math/hypot/not-a-constructor.js create mode 100644 test/built-ins/Math/imul/not-a-constructor.js create mode 100644 test/built-ins/Math/log/not-a-constructor.js create mode 100644 test/built-ins/Math/log10/not-a-constructor.js create mode 100644 test/built-ins/Math/log1p/not-a-constructor.js create mode 100644 test/built-ins/Math/log2/not-a-constructor.js create mode 100644 test/built-ins/Math/max/not-a-constructor.js create mode 100644 test/built-ins/Math/min/not-a-constructor.js create mode 100644 test/built-ins/Math/pow/not-a-constructor.js create mode 100644 test/built-ins/Math/random/not-a-constructor.js create mode 100644 test/built-ins/Math/round/not-a-constructor.js create mode 100644 test/built-ins/Math/sign/not-a-constructor.js create mode 100644 test/built-ins/Math/sin/not-a-constructor.js create mode 100644 test/built-ins/Math/sinh/not-a-constructor.js create mode 100644 test/built-ins/Math/sqrt/not-a-constructor.js create mode 100644 test/built-ins/Math/tan/not-a-constructor.js create mode 100644 test/built-ins/Math/tanh/not-a-constructor.js create mode 100644 test/built-ins/Math/trunc/not-a-constructor.js create mode 100644 test/built-ins/Number/isFinite/not-a-constructor.js create mode 100644 test/built-ins/Number/isInteger/not-a-constructor.js create mode 100644 test/built-ins/Number/isNaN/not-a-constructor.js create mode 100644 test/built-ins/Number/isSafeInteger/not-a-constructor.js create mode 100644 test/built-ins/Number/parseFloat/not-a-constructor.js create mode 100644 test/built-ins/Number/parseInt/not-a-constructor.js create mode 100644 test/built-ins/Number/prototype/toExponential/not-a-constructor.js create mode 100644 test/built-ins/Number/prototype/toFixed/not-a-constructor.js create mode 100644 test/built-ins/Number/prototype/toLocaleString/not-a-constructor.js create mode 100644 test/built-ins/Number/prototype/toPrecision/not-a-constructor.js create mode 100644 test/built-ins/Number/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/Number/prototype/valueOf/not-a-constructor.js create mode 100644 test/built-ins/Object/assign/not-a-constructor.js create mode 100644 test/built-ins/Object/create/not-a-constructor.js create mode 100644 test/built-ins/Object/defineProperties/not-a-constructor.js create mode 100644 test/built-ins/Object/defineProperty/not-a-constructor.js create mode 100644 test/built-ins/Object/entries/not-a-constructor.js create mode 100644 test/built-ins/Object/freeze/not-a-constructor.js create mode 100644 test/built-ins/Object/fromEntries/not-a-constructor.js create mode 100644 test/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js create mode 100644 test/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js create mode 100644 test/built-ins/Object/getOwnPropertyNames/not-a-constructor.js create mode 100644 test/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js create mode 100644 test/built-ins/Object/getPrototypeOf/not-a-constructor.js create mode 100644 test/built-ins/Object/is/not-a-constructor.js create mode 100644 test/built-ins/Object/isExtensible/not-a-constructor.js create mode 100644 test/built-ins/Object/isFrozen/not-a-constructor.js create mode 100644 test/built-ins/Object/isSealed/not-a-constructor.js create mode 100644 test/built-ins/Object/keys/not-a-constructor.js create mode 100644 test/built-ins/Object/preventExtensions/not-a-constructor.js create mode 100644 test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js create mode 100644 test/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js create mode 100644 test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js create mode 100644 test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js create mode 100644 test/built-ins/Object/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/Object/prototype/valueOf/not-a-constructor.js create mode 100644 test/built-ins/Object/seal/not-a-constructor.js create mode 100644 test/built-ins/Object/setPrototypeOf/not-a-constructor.js create mode 100644 test/built-ins/Object/values/not-a-constructor.js create mode 100644 test/built-ins/Promise/all/not-a-constructor.js create mode 100644 test/built-ins/Promise/allSettled/not-a-constructor.js create mode 100644 test/built-ins/Promise/any/not-a-constructor.js create mode 100644 test/built-ins/Promise/prototype/catch/not-a-constructor.js create mode 100644 test/built-ins/Promise/prototype/finally/not-a-constructor.js create mode 100644 test/built-ins/Promise/prototype/then/not-a-constructor.js create mode 100644 test/built-ins/Promise/race/not-a-constructor.js create mode 100644 test/built-ins/Promise/reject/not-a-constructor.js create mode 100644 test/built-ins/Promise/resolve/not-a-constructor.js create mode 100644 test/built-ins/Reflect/apply/not-a-constructor.js create mode 100644 test/built-ins/Reflect/construct/not-a-constructor.js create mode 100644 test/built-ins/Reflect/defineProperty/not-a-constructor.js create mode 100644 test/built-ins/Reflect/deleteProperty/not-a-constructor.js create mode 100644 test/built-ins/Reflect/get/not-a-constructor.js create mode 100644 test/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js create mode 100644 test/built-ins/Reflect/getPrototypeOf/not-a-constructor.js create mode 100644 test/built-ins/Reflect/has/not-a-constructor.js create mode 100644 test/built-ins/Reflect/isExtensible/not-a-constructor.js create mode 100644 test/built-ins/Reflect/ownKeys/not-a-constructor.js create mode 100644 test/built-ins/Reflect/preventExtensions/not-a-constructor.js create mode 100644 test/built-ins/Reflect/set/not-a-constructor.js create mode 100644 test/built-ins/Reflect/setPrototypeOf/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/exec/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/test/not-a-constructor.js create mode 100644 test/built-ins/RegExp/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/add/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/clear/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/delete/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/entries/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/forEach/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/has/not-a-constructor.js create mode 100644 test/built-ins/Set/prototype/values/not-a-constructor.js create mode 100644 test/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js create mode 100644 test/built-ins/String/fromCharCode/not-a-constructor.js create mode 100644 test/built-ins/String/fromCodePoint/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/charAt/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/charCodeAt/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/codePointAt/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/concat/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/endsWith/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/includes/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/indexOf/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/lastIndexOf/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/localeCompare/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/match/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/matchAll/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/normalize/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/padEnd/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/padStart/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/repeat/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/replace/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/replaceAll/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/search/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/slice/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/split/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/startsWith/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/substring/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/toLowerCase/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/toUpperCase/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/trim/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/trimEnd/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/trimStart/not-a-constructor.js create mode 100644 test/built-ins/String/prototype/valueOf/not-a-constructor.js create mode 100644 test/built-ins/String/raw/not-a-constructor.js create mode 100644 test/built-ins/Symbol/for/not-a-constructor.js create mode 100644 test/built-ins/Symbol/keyFor/not-a-constructor.js create mode 100644 test/built-ins/Symbol/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/Symbol/prototype/valueOf/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/from/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/of/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/Symbol.iterator/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/copyWithin/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/entries/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/every/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/fill/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/filter/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/find/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/forEach/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/includes/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/indexOf/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/join/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/keys/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/lastIndexOf/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/map/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/reduce/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/reverse/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/set/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/slice/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/some/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/sort/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/subarray/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/toString/not-a-constructor.js create mode 100644 test/built-ins/TypedArray/prototype/values/not-a-constructor.js create mode 100644 test/built-ins/WeakMap/prototype/delete/not-a-constructor.js create mode 100644 test/built-ins/WeakMap/prototype/get/not-a-constructor.js create mode 100644 test/built-ins/WeakMap/prototype/has/not-a-constructor.js create mode 100644 test/built-ins/WeakMap/prototype/set/not-a-constructor.js create mode 100644 test/built-ins/WeakRef/prototype/deref/not-a-constructor.js create mode 100644 test/built-ins/WeakSet/prototype/add/not-a-constructor.js create mode 100644 test/built-ins/WeakSet/prototype/delete/not-a-constructor.js create mode 100644 test/built-ins/WeakSet/prototype/has/not-a-constructor.js create mode 100644 test/built-ins/decodeURI/not-a-constructor.js create mode 100644 test/built-ins/decodeURIComponent/not-a-constructor.js create mode 100644 test/built-ins/encodeURI/not-a-constructor.js create mode 100644 test/built-ins/encodeURIComponent/not-a-constructor.js create mode 100644 test/built-ins/eval/not-a-constructor.js create mode 100644 test/built-ins/isFinite/not-a-constructor.js create mode 100644 test/built-ins/isNaN/not-a-constructor.js create mode 100644 test/built-ins/parseFloat/not-a-constructor.js diff --git a/test/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js b/test/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js new file mode 100644 index 0000000000..48c11a17b8 --- /dev/null +++ b/test/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getYear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getYear), + false, + 'isConstructor(Date.prototype.getYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getYear(); +}, '`let date = new Date(Date.now()); new date.getYear()` throws TypeError'); + diff --git a/test/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js b/test/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js new file mode 100644 index 0000000000..10747a3bcf --- /dev/null +++ b/test/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setYear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setYear), + false, + 'isConstructor(Date.prototype.setYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setYear(); +}, '`let date = new Date(Date.now()); new date.setYear()` throws TypeError'); + diff --git a/test/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js b/test/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js new file mode 100644 index 0000000000..8dbfb4d235 --- /dev/null +++ b/test/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toGMTString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toGMTString), + false, + 'isConstructor(Date.prototype.toGMTString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toGMTString(); +}, '`let date = new Date(Date.now()); new date.toGMTString()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/anchor/not-a-constructor.js b/test/annexB/built-ins/String/prototype/anchor/not-a-constructor.js new file mode 100644 index 0000000000..c2e6d50336 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/anchor/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.anchor does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.anchor), + false, + 'isConstructor(String.prototype.anchor) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.anchor(); +}, '`new String.prototype.anchor()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/big/not-a-constructor.js b/test/annexB/built-ins/String/prototype/big/not-a-constructor.js new file mode 100644 index 0000000000..4fadddfc58 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/big/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.big does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.prototype.big), false, 'isConstructor(String.prototype.big) must return false'); + +assert.throws(TypeError, () => { + new String.prototype.big(); +}, '`new String.prototype.big()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/blink/not-a-constructor.js b/test/annexB/built-ins/String/prototype/blink/not-a-constructor.js new file mode 100644 index 0000000000..7ea9690c3c --- /dev/null +++ b/test/annexB/built-ins/String/prototype/blink/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.blink does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.blink), + false, + 'isConstructor(String.prototype.blink) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.blink(); +}, '`new String.prototype.blink()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/bold/not-a-constructor.js b/test/annexB/built-ins/String/prototype/bold/not-a-constructor.js new file mode 100644 index 0000000000..eadee9bce6 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/bold/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.bold does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.bold), + false, + 'isConstructor(String.prototype.bold) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.bold(); +}, '`new String.prototype.bold()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/fixed/not-a-constructor.js b/test/annexB/built-ins/String/prototype/fixed/not-a-constructor.js new file mode 100644 index 0000000000..2480eedbb1 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/fixed/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.fixed does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.fixed), + false, + 'isConstructor(String.prototype.fixed) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.fixed(); +}, '`new String.prototype.fixed()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js b/test/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js new file mode 100644 index 0000000000..177125f9bd --- /dev/null +++ b/test/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.fontcolor does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.fontcolor), + false, + 'isConstructor(String.prototype.fontcolor) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.fontcolor(); +}, '`new String.prototype.fontcolor()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js b/test/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js new file mode 100644 index 0000000000..58a7930e91 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.fontsize does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.fontsize), + false, + 'isConstructor(String.prototype.fontsize) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.fontsize(); +}, '`new String.prototype.fontsize()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/italics/not-a-constructor.js b/test/annexB/built-ins/String/prototype/italics/not-a-constructor.js new file mode 100644 index 0000000000..67728cc22c --- /dev/null +++ b/test/annexB/built-ins/String/prototype/italics/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.italics does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.italics), + false, + 'isConstructor(String.prototype.italics) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.italics(); +}, '`new String.prototype.italics()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/link/not-a-constructor.js b/test/annexB/built-ins/String/prototype/link/not-a-constructor.js new file mode 100644 index 0000000000..84db07b0a0 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/link/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.link does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.link), + false, + 'isConstructor(String.prototype.link) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.link(); +}, '`new String.prototype.link()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/small/not-a-constructor.js b/test/annexB/built-ins/String/prototype/small/not-a-constructor.js new file mode 100644 index 0000000000..1597070fc5 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/small/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.small does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.small), + false, + 'isConstructor(String.prototype.small) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.small(); +}, '`new String.prototype.small()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/strike/not-a-constructor.js b/test/annexB/built-ins/String/prototype/strike/not-a-constructor.js new file mode 100644 index 0000000000..b34a1fa6fc --- /dev/null +++ b/test/annexB/built-ins/String/prototype/strike/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.strike does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.strike), + false, + 'isConstructor(String.prototype.strike) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.strike(); +}, '`new String.prototype.strike()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/sub/not-a-constructor.js b/test/annexB/built-ins/String/prototype/sub/not-a-constructor.js new file mode 100644 index 0000000000..d1647a7605 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/sub/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.sub does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.prototype.sub), false, 'isConstructor(String.prototype.sub) must return false'); + +assert.throws(TypeError, () => { + new String.prototype.sub(); +}, '`new String.prototype.sub()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/substr/not-a-constructor.js b/test/annexB/built-ins/String/prototype/substr/not-a-constructor.js new file mode 100644 index 0000000000..82cf786060 --- /dev/null +++ b/test/annexB/built-ins/String/prototype/substr/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.substr does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.substr), + false, + 'isConstructor(String.prototype.substr) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.substr(); +}, '`new String.prototype.substr()` throws TypeError'); + diff --git a/test/annexB/built-ins/String/prototype/sup/not-a-constructor.js b/test/annexB/built-ins/String/prototype/sup/not-a-constructor.js new file mode 100644 index 0000000000..5f6598f2bd --- /dev/null +++ b/test/annexB/built-ins/String/prototype/sup/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.sup does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.prototype.sup), false, 'isConstructor(String.prototype.sup) must return false'); + +assert.throws(TypeError, () => { + new String.prototype.sup(); +}, '`new String.prototype.sup()` throws TypeError'); + diff --git a/test/annexB/built-ins/escape/not-a-constructor.js b/test/annexB/built-ins/escape/not-a-constructor.js new file mode 100644 index 0000000000..41c8d88db8 --- /dev/null +++ b/test/annexB/built-ins/escape/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + escape does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(escape), false, 'isConstructor(escape) must return false'); + +assert.throws(TypeError, () => { + new escape(''); +}, '`new escape(\'\')` throws TypeError'); + diff --git a/test/annexB/built-ins/unescape/not-a-constructor.js b/test/annexB/built-ins/unescape/not-a-constructor.js new file mode 100644 index 0000000000..9c6b92eba4 --- /dev/null +++ b/test/annexB/built-ins/unescape/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + unescape does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(unescape), false, 'isConstructor(unescape) must return false'); + +assert.throws(TypeError, () => { + new unescape(''); +}, '`new unescape(\'\')` throws TypeError'); + diff --git a/test/built-ins/Array/from/not-a-constructor.js b/test/built-ins/Array/from/not-a-constructor.js new file mode 100644 index 0000000000..e7d7885d16 --- /dev/null +++ b/test/built-ins/Array/from/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.from does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.from), false, 'isConstructor(Array.from) must return false'); + +assert.throws(TypeError, () => { + new Array.from([]); +}, '`new Array.from([])` throws TypeError'); + diff --git a/test/built-ins/Array/isArray/not-a-constructor.js b/test/built-ins/Array/isArray/not-a-constructor.js new file mode 100644 index 0000000000..7c03bf80df --- /dev/null +++ b/test/built-ins/Array/isArray/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.isArray does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.isArray), false, 'isConstructor(Array.isArray) must return false'); + +assert.throws(TypeError, () => { + new Array.isArray([]); +}, '`new Array.isArray([])` throws TypeError'); + diff --git a/test/built-ins/Array/of/not-a-constructor.js b/test/built-ins/Array/of/not-a-constructor.js index 9c15fe739c..a9b910cceb 100644 --- a/test/built-ins/Array/of/not-a-constructor.js +++ b/test/built-ins/Array/of/not-a-constructor.js @@ -1,11 +1,23 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. +// Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. + /*--- -esid: sec-array.of +esid: sec-ecmascript-standard-built-in-objects description: > - Array.of is not a constructor. + Array.of does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] ---*/ -assert.throws(TypeError, function() { - new Array.of(); -}); +assert.sameValue(isConstructor(Array.of), false, 'isConstructor(Array.of) must return false'); + +assert.throws(TypeError, () => { + new Array.of(1); +}, '`new Array.of(1)` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js b/test/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js new file mode 100644 index 0000000000..fd5d038c04 --- /dev/null +++ b/test/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype[Symbol.iterator] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.iterator, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype[Symbol.iterator]), + false, + 'isConstructor(Array.prototype[Symbol.iterator]) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype[Symbol.iterator](); +}, '`new Array.prototype[Symbol.iterator]()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/concat/not-a-constructor.js b/test/built-ins/Array/prototype/concat/not-a-constructor.js index c69c22c7b5..c89304c29d 100644 --- a/test/built-ins/Array/prototype/concat/not-a-constructor.js +++ b/test/built-ins/Array/prototype/concat/not-a-constructor.js @@ -1,22 +1,27 @@ -// Copyright (C) 2017 Leo Balter. All rights reserved. +// Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-array.prototype.concat +esid: sec-ecmascript-standard-built-in-objects description: > - Array.prototype.concat is not a constructor. + Array.prototype.concat does not implement [[Construct]] info: | - 17 ECMAScript Standard Built-in Objects + ECMAScript Function Objects Built-in function objects that are not identified as constructors do not implement the [[Construct]] internal method unless otherwise specified in the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] ---*/ -assert.throws(TypeError, function() { - new Array.prototype.concat(); -}); +assert.sameValue( + isConstructor(Array.prototype.concat), + false, + 'isConstructor(Array.prototype.concat) must return false' +); -assert.throws(TypeError, function() { - new [].concat(); -}); +assert.throws(TypeError, () => { + new Array.prototype.concat([]); +}, '`new Array.prototype.concat([])` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/copyWithin/not-a-constructor.js b/test/built-ins/Array/prototype/copyWithin/not-a-constructor.js new file mode 100644 index 0000000000..caf8907205 --- /dev/null +++ b/test/built-ins/Array/prototype/copyWithin/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.copyWithin does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.copyWithin), + false, + 'isConstructor(Array.prototype.copyWithin) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.copyWithin(); +}, '`new Array.prototype.copyWithin()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/entries/not-a-constructor.js b/test/built-ins/Array/prototype/entries/not-a-constructor.js new file mode 100644 index 0000000000..d4ab797a3f --- /dev/null +++ b/test/built-ins/Array/prototype/entries/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.entries does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.entries), + false, + 'isConstructor(Array.prototype.entries) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.entries(); +}, '`new Array.prototype.entries()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/every/not-a-constructor.js b/test/built-ins/Array/prototype/every/not-a-constructor.js new file mode 100644 index 0000000000..76a9149243 --- /dev/null +++ b/test/built-ins/Array/prototype/every/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.every does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.every), + false, + 'isConstructor(Array.prototype.every) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.every(() => {}); +}, '`new Array.prototype.every(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/fill/not-a-constructor.js b/test/built-ins/Array/prototype/fill/not-a-constructor.js new file mode 100644 index 0000000000..18529fa6b5 --- /dev/null +++ b/test/built-ins/Array/prototype/fill/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.fill does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.fill), false, 'isConstructor(Array.prototype.fill) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.fill(); +}, '`new Array.prototype.fill()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/filter/not-a-constructor.js b/test/built-ins/Array/prototype/filter/not-a-constructor.js new file mode 100644 index 0000000000..2bd20be1f9 --- /dev/null +++ b/test/built-ins/Array/prototype/filter/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.filter does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.filter), + false, + 'isConstructor(Array.prototype.filter) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.filter(() => {}); +}, '`new Array.prototype.filter(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/find/not-a-constructor.js b/test/built-ins/Array/prototype/find/not-a-constructor.js new file mode 100644 index 0000000000..f8b7a8b87d --- /dev/null +++ b/test/built-ins/Array/prototype/find/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.find does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.find), false, 'isConstructor(Array.prototype.find) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.find(() => {}); +}, '`new Array.prototype.find(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/findIndex/not-a-constructor.js b/test/built-ins/Array/prototype/findIndex/not-a-constructor.js new file mode 100644 index 0000000000..5580d84842 --- /dev/null +++ b/test/built-ins/Array/prototype/findIndex/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.findIndex does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.findIndex), + false, + 'isConstructor(Array.prototype.findIndex) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.findIndex(() => {}); +}, '`new Array.prototype.findIndex(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/flat/not-a-constructor.js b/test/built-ins/Array/prototype/flat/not-a-constructor.js new file mode 100644 index 0000000000..175dbbbc6b --- /dev/null +++ b/test/built-ins/Array/prototype/flat/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.flat does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.flat), false, 'isConstructor(Array.prototype.flat) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.flat(); +}, '`new Array.prototype.flat()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/flatMap/not-a-constructor.js b/test/built-ins/Array/prototype/flatMap/not-a-constructor.js new file mode 100644 index 0000000000..df68c99001 --- /dev/null +++ b/test/built-ins/Array/prototype/flatMap/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.flatMap does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Array.prototype.flatMap, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.flatMap), + false, + 'isConstructor(Array.prototype.flatMap) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.flatMap(() => {}); +}, '`new Array.prototype.flatMap(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/forEach/not-a-constructor.js b/test/built-ins/Array/prototype/forEach/not-a-constructor.js new file mode 100644 index 0000000000..a59663c63b --- /dev/null +++ b/test/built-ins/Array/prototype/forEach/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.forEach does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.forEach), + false, + 'isConstructor(Array.prototype.forEach) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.forEach(() => {}); +}, '`new Array.prototype.forEach(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/includes/not-a-constructor.js b/test/built-ins/Array/prototype/includes/not-a-constructor.js new file mode 100644 index 0000000000..da056dc0cb --- /dev/null +++ b/test/built-ins/Array/prototype/includes/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.includes does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.includes), + false, + 'isConstructor(Array.prototype.includes) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.includes(1); +}, '`new Array.prototype.includes(1)` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/indexOf/not-a-constructor.js b/test/built-ins/Array/prototype/indexOf/not-a-constructor.js new file mode 100644 index 0000000000..bfbd77cf78 --- /dev/null +++ b/test/built-ins/Array/prototype/indexOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.indexOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.indexOf), + false, + 'isConstructor(Array.prototype.indexOf) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.indexOf(); +}, '`new Array.prototype.indexOf()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/join/not-a-constructor.js b/test/built-ins/Array/prototype/join/not-a-constructor.js new file mode 100644 index 0000000000..26196adf37 --- /dev/null +++ b/test/built-ins/Array/prototype/join/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.join does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.join), false, 'isConstructor(Array.prototype.join) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.join(); +}, '`new Array.prototype.join()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/keys/not-a-constructor.js b/test/built-ins/Array/prototype/keys/not-a-constructor.js new file mode 100644 index 0000000000..f99bfd7a32 --- /dev/null +++ b/test/built-ins/Array/prototype/keys/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.keys does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.keys), false, 'isConstructor(Array.prototype.keys) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.keys(); +}, '`new Array.prototype.keys()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js b/test/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js new file mode 100644 index 0000000000..ed4de49a51 --- /dev/null +++ b/test/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.lastIndexOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.lastIndexOf), + false, + 'isConstructor(Array.prototype.lastIndexOf) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.lastIndexOf(); +}, '`new Array.prototype.lastIndexOf()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/map/not-a-constructor.js b/test/built-ins/Array/prototype/map/not-a-constructor.js new file mode 100644 index 0000000000..ebb238a953 --- /dev/null +++ b/test/built-ins/Array/prototype/map/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.map does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.map), false, 'isConstructor(Array.prototype.map) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.map(() => {}); +}, '`new Array.prototype.map(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/pop/not-a-constructor.js b/test/built-ins/Array/prototype/pop/not-a-constructor.js new file mode 100644 index 0000000000..7645728768 --- /dev/null +++ b/test/built-ins/Array/prototype/pop/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.pop does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.pop), false, 'isConstructor(Array.prototype.pop) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.pop(); +}, '`new Array.prototype.pop()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/push/not-a-constructor.js b/test/built-ins/Array/prototype/push/not-a-constructor.js new file mode 100644 index 0000000000..35fc7fe1f4 --- /dev/null +++ b/test/built-ins/Array/prototype/push/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.push does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.push), false, 'isConstructor(Array.prototype.push) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.push(); +}, '`new Array.prototype.push()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/reduce/not-a-constructor.js b/test/built-ins/Array/prototype/reduce/not-a-constructor.js new file mode 100644 index 0000000000..ab3e31e034 --- /dev/null +++ b/test/built-ins/Array/prototype/reduce/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.reduce does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.reduce), + false, + 'isConstructor(Array.prototype.reduce) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.reduce(() => {}, []); +}, '`new Array.prototype.reduce(() => {}, [])` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/reduceRight/not-a-constructor.js b/test/built-ins/Array/prototype/reduceRight/not-a-constructor.js new file mode 100644 index 0000000000..e2c8b50c70 --- /dev/null +++ b/test/built-ins/Array/prototype/reduceRight/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.reduceRight does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.reduceRight), + false, + 'isConstructor(Array.prototype.reduceRight) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.reduceRight(() => {}, []); +}, '`new Array.prototype.reduceRight(() => {}, [])` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/reverse/not-a-constructor.js b/test/built-ins/Array/prototype/reverse/not-a-constructor.js new file mode 100644 index 0000000000..dea81129d2 --- /dev/null +++ b/test/built-ins/Array/prototype/reverse/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.reverse does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.reverse), + false, + 'isConstructor(Array.prototype.reverse) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.reverse(); +}, '`new Array.prototype.reverse()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/shift/not-a-constructor.js b/test/built-ins/Array/prototype/shift/not-a-constructor.js new file mode 100644 index 0000000000..75d95e96ec --- /dev/null +++ b/test/built-ins/Array/prototype/shift/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.shift does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.shift), + false, + 'isConstructor(Array.prototype.shift) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.shift(); +}, '`new Array.prototype.shift()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/slice/not-a-constructor.js b/test/built-ins/Array/prototype/slice/not-a-constructor.js new file mode 100644 index 0000000000..815923c1a6 --- /dev/null +++ b/test/built-ins/Array/prototype/slice/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.slice does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.slice), + false, + 'isConstructor(Array.prototype.slice) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.slice(); +}, '`new Array.prototype.slice()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/some/not-a-constructor.js b/test/built-ins/Array/prototype/some/not-a-constructor.js new file mode 100644 index 0000000000..d383bd7761 --- /dev/null +++ b/test/built-ins/Array/prototype/some/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.some does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.some), false, 'isConstructor(Array.prototype.some) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.some(() => {}); +}, '`new Array.prototype.some(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/sort/not-a-constructor.js b/test/built-ins/Array/prototype/sort/not-a-constructor.js new file mode 100644 index 0000000000..4a5d17a479 --- /dev/null +++ b/test/built-ins/Array/prototype/sort/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.sort does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Array.prototype.sort), false, 'isConstructor(Array.prototype.sort) must return false'); + +assert.throws(TypeError, () => { + new Array.prototype.sort(); +}, '`new Array.prototype.sort()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/splice/not-a-constructor.js b/test/built-ins/Array/prototype/splice/not-a-constructor.js new file mode 100644 index 0000000000..c8036193da --- /dev/null +++ b/test/built-ins/Array/prototype/splice/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.splice does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.splice), + false, + 'isConstructor(Array.prototype.splice) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.splice(); +}, '`new Array.prototype.splice()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js b/test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js new file mode 100644 index 0000000000..aa9f41faa3 --- /dev/null +++ b/test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.toLocaleString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.toLocaleString), + false, + 'isConstructor(Array.prototype.toLocaleString) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.toLocaleString(); +}, '`new Array.prototype.toLocaleString()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/toString/not-a-constructor.js b/test/built-ins/Array/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..1c69f18c98 --- /dev/null +++ b/test/built-ins/Array/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.toString), + false, + 'isConstructor(Array.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.toString(); +}, '`new Array.prototype.toString()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/unshift/not-a-constructor.js b/test/built-ins/Array/prototype/unshift/not-a-constructor.js new file mode 100644 index 0000000000..10d8a571a6 --- /dev/null +++ b/test/built-ins/Array/prototype/unshift/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.unshift does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.unshift), + false, + 'isConstructor(Array.prototype.unshift) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.unshift(); +}, '`new Array.prototype.unshift()` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/values/not-a-constructor.js b/test/built-ins/Array/prototype/values/not-a-constructor.js new file mode 100644 index 0000000000..f4d4f218df --- /dev/null +++ b/test/built-ins/Array/prototype/values/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.values does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Array.prototype.values, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.values), + false, + 'isConstructor(Array.prototype.values) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.values(); +}, '`new Array.prototype.values()` throws TypeError'); + diff --git a/test/built-ins/ArrayBuffer/isView/not-a-constructor.js b/test/built-ins/ArrayBuffer/isView/not-a-constructor.js new file mode 100644 index 0000000000..ff1a276b44 --- /dev/null +++ b/test/built-ins/ArrayBuffer/isView/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + ArrayBuffer.isView does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, ArrayBuffer, arrow-function] +---*/ + +assert.sameValue(isConstructor(ArrayBuffer.isView), false, 'isConstructor(ArrayBuffer.isView) must return false'); + +assert.throws(TypeError, () => { + new ArrayBuffer.isView(); +}, '`new ArrayBuffer.isView()` throws TypeError'); + diff --git a/test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js b/test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js new file mode 100644 index 0000000000..cfff6b314e --- /dev/null +++ b/test/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + ArrayBuffer.prototype.slice does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, ArrayBuffer, arrow-function] +---*/ + +assert.sameValue( + isConstructor(ArrayBuffer.prototype.slice), + false, + 'isConstructor(ArrayBuffer.prototype.slice) must return false' +); + +assert.throws(TypeError, () => { + let ab = new ArrayBuffer(); new ab.slice(); +}, '`let ab = new ArrayBuffer(); new ab.slice()` throws TypeError'); + diff --git a/test/built-ins/Atomics/add/not-a-constructor.js b/test/built-ins/Atomics/add/not-a-constructor.js new file mode 100644 index 0000000000..b582a354ac --- /dev/null +++ b/test/built-ins/Atomics/add/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.add does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.add), false, 'isConstructor(Atomics.add) must return false'); + +assert.throws(TypeError, () => { + new Atomics.add(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.add(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/and/not-a-constructor.js b/test/built-ins/Atomics/and/not-a-constructor.js new file mode 100644 index 0000000000..f0d2722fc7 --- /dev/null +++ b/test/built-ins/Atomics/and/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.and does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.and), false, 'isConstructor(Atomics.and) must return false'); + +assert.throws(TypeError, () => { + new Atomics.and(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.and(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/compareExchange/not-a-constructor.js b/test/built-ins/Atomics/compareExchange/not-a-constructor.js new file mode 100644 index 0000000000..09437acffa --- /dev/null +++ b/test/built-ins/Atomics/compareExchange/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.compareExchange does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(Atomics.compareExchange), + false, + 'isConstructor(Atomics.compareExchange) must return false' +); + +assert.throws(TypeError, () => { + new Atomics.compareExchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.compareExchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/exchange/not-a-constructor.js b/test/built-ins/Atomics/exchange/not-a-constructor.js new file mode 100644 index 0000000000..7e667e324f --- /dev/null +++ b/test/built-ins/Atomics/exchange/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.exchange does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.exchange), false, 'isConstructor(Atomics.exchange) must return false'); + +assert.throws(TypeError, () => { + new Atomics.exchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.exchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/isLockFree/not-a-constructor.js b/test/built-ins/Atomics/isLockFree/not-a-constructor.js new file mode 100644 index 0000000000..eddec8eb9d --- /dev/null +++ b/test/built-ins/Atomics/isLockFree/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.isLockFree does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.isLockFree), false, 'isConstructor(Atomics.isLockFree) must return false'); + +assert.throws(TypeError, () => { + new Atomics.isLockFree(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.isLockFree(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/load/not-a-constructor.js b/test/built-ins/Atomics/load/not-a-constructor.js new file mode 100644 index 0000000000..49ae3ef469 --- /dev/null +++ b/test/built-ins/Atomics/load/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.load does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.load), false, 'isConstructor(Atomics.load) must return false'); + +assert.throws(TypeError, () => { + new Atomics.load(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.load(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/notify/not-a-constructor.js b/test/built-ins/Atomics/notify/not-a-constructor.js new file mode 100644 index 0000000000..eb454b899f --- /dev/null +++ b/test/built-ins/Atomics/notify/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.notify does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.notify), false, 'isConstructor(Atomics.notify) must return false'); + +assert.throws(TypeError, () => { + new Atomics.notify(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.notify(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/or/not-a-constructor.js b/test/built-ins/Atomics/or/not-a-constructor.js new file mode 100644 index 0000000000..4b8bb0dffe --- /dev/null +++ b/test/built-ins/Atomics/or/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.or does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.or), false, 'isConstructor(Atomics.or) must return false'); + +assert.throws(TypeError, () => { + new Atomics.or(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.or(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/store/not-a-constructor.js b/test/built-ins/Atomics/store/not-a-constructor.js new file mode 100644 index 0000000000..3c7eb8903c --- /dev/null +++ b/test/built-ins/Atomics/store/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.store does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.store), false, 'isConstructor(Atomics.store) must return false'); + +assert.throws(TypeError, () => { + new Atomics.store(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.store(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/sub/not-a-constructor.js b/test/built-ins/Atomics/sub/not-a-constructor.js new file mode 100644 index 0000000000..4d4b230de7 --- /dev/null +++ b/test/built-ins/Atomics/sub/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.sub does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.sub), false, 'isConstructor(Atomics.sub) must return false'); + +assert.throws(TypeError, () => { + new Atomics.sub(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.sub(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/Atomics/xor/not-a-constructor.js b/test/built-ins/Atomics/xor/not-a-constructor.js new file mode 100644 index 0000000000..94d855a042 --- /dev/null +++ b/test/built-ins/Atomics/xor/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Atomics.xor does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Atomics, arrow-function, TypedArray, SharedArrayBuffer] +---*/ + +assert.sameValue(isConstructor(Atomics.xor), false, 'isConstructor(Atomics.xor) must return false'); + +assert.throws(TypeError, () => { + new Atomics.xor(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); +}, '`new Atomics.xor(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); + diff --git a/test/built-ins/BigInt/asIntN/not-a-constructor.js b/test/built-ins/BigInt/asIntN/not-a-constructor.js new file mode 100644 index 0000000000..9e512c7774 --- /dev/null +++ b/test/built-ins/BigInt/asIntN/not-a-constructor.js @@ -0,0 +1,20 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + BigInt.asIntN does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, BigInt, arrow-function] +---*/ +assert.sameValue(isConstructor(BigInt.asIntN), false, 'isConstructor(BigInt.asIntN) must return false'); + +assert.throws(TypeError, () => { + new BigInt.asIntN(64, 1n); +}, '`new BigInt.asIntN(64, 1n)` throws TypeError'); diff --git a/test/built-ins/BigInt/asUintN/not-a-constructor.js b/test/built-ins/BigInt/asUintN/not-a-constructor.js new file mode 100644 index 0000000000..a7ee5ee24d --- /dev/null +++ b/test/built-ins/BigInt/asUintN/not-a-constructor.js @@ -0,0 +1,20 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + BigInt.asUintN does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, BigInt, arrow-function] +---*/ +assert.sameValue(isConstructor(BigInt.asUintN), false, 'isConstructor(BigInt.asUintN) must return false'); + +assert.throws(TypeError, () => { + new BigInt.asUintN(64, 1n); +}, '`new BigInt.asUintN(64, 1n)` throws TypeError'); diff --git a/test/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js b/test/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js new file mode 100644 index 0000000000..b47561b239 --- /dev/null +++ b/test/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js @@ -0,0 +1,25 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + BigInt.prototype.toLocaleString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, BigInt, arrow-function] +---*/ +assert.sameValue( + isConstructor(BigInt.prototype.toLocaleString), + false, + 'isConstructor(BigInt.prototype.toLocaleString) must return false' +); + +assert.throws(TypeError, () => { + let n = 1n; + new n.toLocaleString(); +}, '`let n = 1n; new n.toLocaleString()` throws TypeError'); diff --git a/test/built-ins/BigInt/prototype/toString/not-a-constructor.js b/test/built-ins/BigInt/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..a69937a973 --- /dev/null +++ b/test/built-ins/BigInt/prototype/toString/not-a-constructor.js @@ -0,0 +1,25 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + BigInt.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, BigInt, arrow-function] +---*/ +assert.sameValue( + isConstructor(BigInt.prototype.toString), + false, + 'isConstructor(BigInt.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + let n = 1n; + new n.toString(); +}, '`let n = 1n; new n.toString()` throws TypeError'); diff --git a/test/built-ins/BigInt/prototype/valueOf/not-a-constructor.js b/test/built-ins/BigInt/prototype/valueOf/not-a-constructor.js new file mode 100644 index 0000000000..a0d60101c6 --- /dev/null +++ b/test/built-ins/BigInt/prototype/valueOf/not-a-constructor.js @@ -0,0 +1,25 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + BigInt.prototype.valueOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, BigInt, arrow-function] +---*/ +assert.sameValue( + isConstructor(BigInt.prototype.valueOf), + false, + 'isConstructor(BigInt.prototype.valueOf) must return false' +); + +assert.throws(TypeError, () => { + let n = 1n; + new n.valueOf(); +}, '`let n = 1n; new n.valueOf()` throws TypeError'); diff --git a/test/built-ins/Boolean/prototype/toString/not-a-constructor.js b/test/built-ins/Boolean/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..2cee7e197f --- /dev/null +++ b/test/built-ins/Boolean/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Boolean.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Boolean.prototype.toString), + false, + 'isConstructor(Boolean.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + new Boolean.prototype.toString(); +}, '`new Boolean.prototype.toString()` throws TypeError'); + diff --git a/test/built-ins/Boolean/prototype/valueOf/not-a-constructor.js b/test/built-ins/Boolean/prototype/valueOf/not-a-constructor.js new file mode 100644 index 0000000000..bf8afa305a --- /dev/null +++ b/test/built-ins/Boolean/prototype/valueOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Boolean.prototype.valueOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Boolean.prototype.valueOf), + false, + 'isConstructor(Boolean.prototype.valueOf) must return false' +); + +assert.throws(TypeError, () => { + new Boolean.prototype.valueOf(); +}, '`new Boolean.prototype.valueOf()` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js b/test/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js new file mode 100644 index 0000000000..e58d8fd865 --- /dev/null +++ b/test/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getBigInt64 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, BigInt, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getBigInt64), + false, + 'isConstructor(DataView.prototype.getBigInt64) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getBigInt64(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getBigInt64(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js b/test/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js new file mode 100644 index 0000000000..60cf4f7d5e --- /dev/null +++ b/test/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getBigUint64 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getBigUint64), + false, + 'isConstructor(DataView.prototype.getBigUint64) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getBigUint64(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getBigUint64(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getFloat32/not-a-constructor.js b/test/built-ins/DataView/prototype/getFloat32/not-a-constructor.js new file mode 100644 index 0000000000..0967866711 --- /dev/null +++ b/test/built-ins/DataView/prototype/getFloat32/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getFloat32 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getFloat32), + false, + 'isConstructor(DataView.prototype.getFloat32) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat32(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat32(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getFloat64/not-a-constructor.js b/test/built-ins/DataView/prototype/getFloat64/not-a-constructor.js new file mode 100644 index 0000000000..452fadb946 --- /dev/null +++ b/test/built-ins/DataView/prototype/getFloat64/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getFloat64 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getFloat64), + false, + 'isConstructor(DataView.prototype.getFloat64) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat64(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat64(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getInt16/not-a-constructor.js b/test/built-ins/DataView/prototype/getInt16/not-a-constructor.js new file mode 100644 index 0000000000..f4c449811e --- /dev/null +++ b/test/built-ins/DataView/prototype/getInt16/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getInt16 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getInt16), + false, + 'isConstructor(DataView.prototype.getInt16) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getInt16(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt16(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getInt32/not-a-constructor.js b/test/built-ins/DataView/prototype/getInt32/not-a-constructor.js new file mode 100644 index 0000000000..0f2fe1e9c0 --- /dev/null +++ b/test/built-ins/DataView/prototype/getInt32/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getInt32 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getInt32), + false, + 'isConstructor(DataView.prototype.getInt32) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getInt32(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt32(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getInt8/not-a-constructor.js b/test/built-ins/DataView/prototype/getInt8/not-a-constructor.js new file mode 100644 index 0000000000..0566b5398f --- /dev/null +++ b/test/built-ins/DataView/prototype/getInt8/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getInt8 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getInt8), + false, + 'isConstructor(DataView.prototype.getInt8) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getInt8(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt8(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getUint16/not-a-constructor.js b/test/built-ins/DataView/prototype/getUint16/not-a-constructor.js new file mode 100644 index 0000000000..a88685e64f --- /dev/null +++ b/test/built-ins/DataView/prototype/getUint16/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getUint16 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getUint16), + false, + 'isConstructor(DataView.prototype.getUint16) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getUint16(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint16(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getUint32/not-a-constructor.js b/test/built-ins/DataView/prototype/getUint32/not-a-constructor.js new file mode 100644 index 0000000000..ec5949be64 --- /dev/null +++ b/test/built-ins/DataView/prototype/getUint32/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getUint32 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getUint32), + false, + 'isConstructor(DataView.prototype.getUint32) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getUint32(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint32(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/getUint8/not-a-constructor.js b/test/built-ins/DataView/prototype/getUint8/not-a-constructor.js new file mode 100644 index 0000000000..52f9673a30 --- /dev/null +++ b/test/built-ins/DataView/prototype/getUint8/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getUint8 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getUint8), + false, + 'isConstructor(DataView.prototype.getUint8) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getUint8(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint8(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js b/test/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js new file mode 100644 index 0000000000..d1f1d70090 --- /dev/null +++ b/test/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setBigInt64 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, BigInt, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setBigInt64), + false, + 'isConstructor(DataView.prototype.setBigInt64) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setBigInt64(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setBigInt64(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js b/test/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js new file mode 100644 index 0000000000..d1951096e1 --- /dev/null +++ b/test/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setBigUint64 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setBigUint64), + false, + 'isConstructor(DataView.prototype.setBigUint64) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setBigUint64(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setBigUint64(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setFloat32/not-a-constructor.js b/test/built-ins/DataView/prototype/setFloat32/not-a-constructor.js new file mode 100644 index 0000000000..c1465a2fa3 --- /dev/null +++ b/test/built-ins/DataView/prototype/setFloat32/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setFloat32 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setFloat32), + false, + 'isConstructor(DataView.prototype.setFloat32) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat32(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat32(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setFloat64/not-a-constructor.js b/test/built-ins/DataView/prototype/setFloat64/not-a-constructor.js new file mode 100644 index 0000000000..4d6f0e3c91 --- /dev/null +++ b/test/built-ins/DataView/prototype/setFloat64/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setFloat64 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setFloat64), + false, + 'isConstructor(DataView.prototype.setFloat64) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat64(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat64(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setInt16/not-a-constructor.js b/test/built-ins/DataView/prototype/setInt16/not-a-constructor.js new file mode 100644 index 0000000000..135f34cc90 --- /dev/null +++ b/test/built-ins/DataView/prototype/setInt16/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setInt16 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setInt16), + false, + 'isConstructor(DataView.prototype.setInt16) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setInt16(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt16(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setInt32/not-a-constructor.js b/test/built-ins/DataView/prototype/setInt32/not-a-constructor.js new file mode 100644 index 0000000000..628a76867c --- /dev/null +++ b/test/built-ins/DataView/prototype/setInt32/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setInt32 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setInt32), + false, + 'isConstructor(DataView.prototype.setInt32) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setInt32(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt32(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setInt8/not-a-constructor.js b/test/built-ins/DataView/prototype/setInt8/not-a-constructor.js new file mode 100644 index 0000000000..3287f50d77 --- /dev/null +++ b/test/built-ins/DataView/prototype/setInt8/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setInt8 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setInt8), + false, + 'isConstructor(DataView.prototype.setInt8) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setInt8(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt8(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setUint16/not-a-constructor.js b/test/built-ins/DataView/prototype/setUint16/not-a-constructor.js new file mode 100644 index 0000000000..62f8cb0981 --- /dev/null +++ b/test/built-ins/DataView/prototype/setUint16/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setUint16 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setUint16), + false, + 'isConstructor(DataView.prototype.setUint16) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setUint16(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint16(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setUint32/not-a-constructor.js b/test/built-ins/DataView/prototype/setUint32/not-a-constructor.js new file mode 100644 index 0000000000..89d5998756 --- /dev/null +++ b/test/built-ins/DataView/prototype/setUint32/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setUint32 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setUint32), + false, + 'isConstructor(DataView.prototype.setUint32) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setUint32(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint32(0, 0)` throws TypeError'); + diff --git a/test/built-ins/DataView/prototype/setUint8/not-a-constructor.js b/test/built-ins/DataView/prototype/setUint8/not-a-constructor.js new file mode 100644 index 0000000000..2eb4521315 --- /dev/null +++ b/test/built-ins/DataView/prototype/setUint8/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setUint8 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setUint8), + false, + 'isConstructor(DataView.prototype.setUint8) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setUint8(0, 0); +}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint8(0, 0)` throws TypeError'); + diff --git a/test/built-ins/Date/UTC/not-a-constructor.js b/test/built-ins/Date/UTC/not-a-constructor.js new file mode 100644 index 0000000000..64607b32dd --- /dev/null +++ b/test/built-ins/Date/UTC/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.UTC does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Date.UTC), false, 'isConstructor(Date.UTC) must return false'); + +assert.throws(TypeError, () => { + new Date.UTC(); +}, '`new Date.UTC()` throws TypeError'); + diff --git a/test/built-ins/Date/now/not-a-constructor.js b/test/built-ins/Date/now/not-a-constructor.js new file mode 100644 index 0000000000..5522787de0 --- /dev/null +++ b/test/built-ins/Date/now/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.now does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Date.now), false, 'isConstructor(Date.now) must return false'); + +assert.throws(TypeError, () => { + new Date.now(); +}, '`new Date.now()` throws TypeError'); + diff --git a/test/built-ins/Date/parse/not-a-constructor.js b/test/built-ins/Date/parse/not-a-constructor.js new file mode 100644 index 0000000000..e4a745b944 --- /dev/null +++ b/test/built-ins/Date/parse/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.parse does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Date.parse), false, 'isConstructor(Date.parse) must return false'); + +assert.throws(TypeError, () => { + new Date.parse(); +}, '`new Date.parse()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getDate/not-a-constructor.js b/test/built-ins/Date/prototype/getDate/not-a-constructor.js new file mode 100644 index 0000000000..708f3f1887 --- /dev/null +++ b/test/built-ins/Date/prototype/getDate/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getDate does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getDate), + false, + 'isConstructor(Date.prototype.getDate) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getDate(); +}, '`let date = new Date(Date.now()); new date.getDate()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getDay/not-a-constructor.js b/test/built-ins/Date/prototype/getDay/not-a-constructor.js new file mode 100644 index 0000000000..0b53733b99 --- /dev/null +++ b/test/built-ins/Date/prototype/getDay/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getDay does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getDay), + false, + 'isConstructor(Date.prototype.getDay) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getDay(); +}, '`let date = new Date(Date.now()); new date.getDay()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getFullYear/not-a-constructor.js b/test/built-ins/Date/prototype/getFullYear/not-a-constructor.js new file mode 100644 index 0000000000..0e187cdfc4 --- /dev/null +++ b/test/built-ins/Date/prototype/getFullYear/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getFullYear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getFullYear), + false, + 'isConstructor(Date.prototype.getFullYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getFullYear(); +}, '`let date = new Date(Date.now()); new date.getFullYear()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getHours/not-a-constructor.js b/test/built-ins/Date/prototype/getHours/not-a-constructor.js new file mode 100644 index 0000000000..64ef731bf0 --- /dev/null +++ b/test/built-ins/Date/prototype/getHours/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getHours does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getHours), + false, + 'isConstructor(Date.prototype.getHours) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getHours(); +}, '`let date = new Date(Date.now()); new date.getHours()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js b/test/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js new file mode 100644 index 0000000000..4de4763d30 --- /dev/null +++ b/test/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getMilliseconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getMilliseconds), + false, + 'isConstructor(Date.prototype.getMilliseconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getMilliseconds(); +}, '`let date = new Date(Date.now()); new date.getMilliseconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getMinutes/not-a-constructor.js b/test/built-ins/Date/prototype/getMinutes/not-a-constructor.js new file mode 100644 index 0000000000..7d8d83c010 --- /dev/null +++ b/test/built-ins/Date/prototype/getMinutes/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getMinutes does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getMinutes), + false, + 'isConstructor(Date.prototype.getMinutes) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getMinutes(); +}, '`let date = new Date(Date.now()); new date.getMinutes()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getMonth/not-a-constructor.js b/test/built-ins/Date/prototype/getMonth/not-a-constructor.js new file mode 100644 index 0000000000..f8fa89cc63 --- /dev/null +++ b/test/built-ins/Date/prototype/getMonth/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getMonth does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getMonth), + false, + 'isConstructor(Date.prototype.getMonth) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getMonth(); +}, '`let date = new Date(Date.now()); new date.getMonth()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getSeconds/not-a-constructor.js b/test/built-ins/Date/prototype/getSeconds/not-a-constructor.js new file mode 100644 index 0000000000..56e69dd215 --- /dev/null +++ b/test/built-ins/Date/prototype/getSeconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getSeconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getSeconds), + false, + 'isConstructor(Date.prototype.getSeconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getSeconds(); +}, '`let date = new Date(Date.now()); new date.getSeconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getTime/not-a-constructor.js b/test/built-ins/Date/prototype/getTime/not-a-constructor.js new file mode 100644 index 0000000000..4b766f0abb --- /dev/null +++ b/test/built-ins/Date/prototype/getTime/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getTime does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getTime), + false, + 'isConstructor(Date.prototype.getTime) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getTime(); +}, '`let date = new Date(Date.now()); new date.getTime()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js b/test/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js new file mode 100644 index 0000000000..2af2324a25 --- /dev/null +++ b/test/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getTimezoneOffset does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getTimezoneOffset), + false, + 'isConstructor(Date.prototype.getTimezoneOffset) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getTimezoneOffset(); +}, '`let date = new Date(Date.now()); new date.getTimezoneOffset()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCDate/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCDate/not-a-constructor.js new file mode 100644 index 0000000000..612fab529f --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCDate/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCDate does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCDate), + false, + 'isConstructor(Date.prototype.getUTCDate) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCDate(); +}, '`let date = new Date(Date.now()); new date.getUTCDate()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCDay/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCDay/not-a-constructor.js new file mode 100644 index 0000000000..913698db63 --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCDay/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCDay does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCDay), + false, + 'isConstructor(Date.prototype.getUTCDay) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCDay(); +}, '`let date = new Date(Date.now()); new date.getUTCDay()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js new file mode 100644 index 0000000000..23eb08efdd --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCFullYear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCFullYear), + false, + 'isConstructor(Date.prototype.getUTCFullYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCFullYear(); +}, '`let date = new Date(Date.now()); new date.getUTCFullYear()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCHours/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCHours/not-a-constructor.js new file mode 100644 index 0000000000..c75a084100 --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCHours/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCHours does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCHours), + false, + 'isConstructor(Date.prototype.getUTCHours) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCHours(); +}, '`let date = new Date(Date.now()); new date.getUTCHours()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js new file mode 100644 index 0000000000..3a26721db8 --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCMilliseconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCMilliseconds), + false, + 'isConstructor(Date.prototype.getUTCMilliseconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCMilliseconds(); +}, '`let date = new Date(Date.now()); new date.getUTCMilliseconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js new file mode 100644 index 0000000000..60f2adc1a5 --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCMinutes does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCMinutes), + false, + 'isConstructor(Date.prototype.getUTCMinutes) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCMinutes(); +}, '`let date = new Date(Date.now()); new date.getUTCMinutes()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js new file mode 100644 index 0000000000..231bd72e7b --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCMonth does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCMonth), + false, + 'isConstructor(Date.prototype.getUTCMonth) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCMonth(); +}, '`let date = new Date(Date.now()); new date.getUTCMonth()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js b/test/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js new file mode 100644 index 0000000000..228c2d8ca0 --- /dev/null +++ b/test/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getUTCSeconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getUTCSeconds), + false, + 'isConstructor(Date.prototype.getUTCSeconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getUTCSeconds(); +}, '`let date = new Date(Date.now()); new date.getUTCSeconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setDate/not-a-constructor.js b/test/built-ins/Date/prototype/setDate/not-a-constructor.js new file mode 100644 index 0000000000..41867ef705 --- /dev/null +++ b/test/built-ins/Date/prototype/setDate/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setDate does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setDate), + false, + 'isConstructor(Date.prototype.setDate) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setDate(); +}, '`let date = new Date(Date.now()); new date.setDate()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setFullYear/not-a-constructor.js b/test/built-ins/Date/prototype/setFullYear/not-a-constructor.js new file mode 100644 index 0000000000..7c31771f60 --- /dev/null +++ b/test/built-ins/Date/prototype/setFullYear/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setFullYear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setFullYear), + false, + 'isConstructor(Date.prototype.setFullYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setFullYear(); +}, '`let date = new Date(Date.now()); new date.setFullYear()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setHours/not-a-constructor.js b/test/built-ins/Date/prototype/setHours/not-a-constructor.js new file mode 100644 index 0000000000..e8f1269105 --- /dev/null +++ b/test/built-ins/Date/prototype/setHours/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setHours does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setHours), + false, + 'isConstructor(Date.prototype.setHours) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setHours(); +}, '`let date = new Date(Date.now()); new date.setHours()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js b/test/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js new file mode 100644 index 0000000000..f365428f97 --- /dev/null +++ b/test/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setMilliseconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setMilliseconds), + false, + 'isConstructor(Date.prototype.setMilliseconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setMilliseconds(); +}, '`let date = new Date(Date.now()); new date.setMilliseconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setMinutes/not-a-constructor.js b/test/built-ins/Date/prototype/setMinutes/not-a-constructor.js new file mode 100644 index 0000000000..1dac219e49 --- /dev/null +++ b/test/built-ins/Date/prototype/setMinutes/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setMinutes does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setMinutes), + false, + 'isConstructor(Date.prototype.setMinutes) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setMinutes(); +}, '`let date = new Date(Date.now()); new date.setMinutes()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setMonth/not-a-constructor.js b/test/built-ins/Date/prototype/setMonth/not-a-constructor.js new file mode 100644 index 0000000000..843fa2d624 --- /dev/null +++ b/test/built-ins/Date/prototype/setMonth/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setMonth does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setMonth), + false, + 'isConstructor(Date.prototype.setMonth) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setMonth(); +}, '`let date = new Date(Date.now()); new date.setMonth()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setSeconds/not-a-constructor.js b/test/built-ins/Date/prototype/setSeconds/not-a-constructor.js new file mode 100644 index 0000000000..69e6d12223 --- /dev/null +++ b/test/built-ins/Date/prototype/setSeconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setSeconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setSeconds), + false, + 'isConstructor(Date.prototype.setSeconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setSeconds(); +}, '`let date = new Date(Date.now()); new date.setSeconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setTime/not-a-constructor.js b/test/built-ins/Date/prototype/setTime/not-a-constructor.js new file mode 100644 index 0000000000..9c881ea8d4 --- /dev/null +++ b/test/built-ins/Date/prototype/setTime/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setTime does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setTime), + false, + 'isConstructor(Date.prototype.setTime) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setTime(); +}, '`let date = new Date(Date.now()); new date.setTime()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setUTCDate/not-a-constructor.js b/test/built-ins/Date/prototype/setUTCDate/not-a-constructor.js new file mode 100644 index 0000000000..1bce4c055d --- /dev/null +++ b/test/built-ins/Date/prototype/setUTCDate/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setUTCDate does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setUTCDate), + false, + 'isConstructor(Date.prototype.setUTCDate) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCDate(); +}, '`let date = new Date(Date.now()); new date.setUTCDate()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js b/test/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js new file mode 100644 index 0000000000..84653851bb --- /dev/null +++ b/test/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setUTCFullYear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setUTCFullYear), + false, + 'isConstructor(Date.prototype.setUTCFullYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCFullYear(); +}, '`let date = new Date(Date.now()); new date.setUTCFullYear()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setUTCHours/not-a-constructor.js b/test/built-ins/Date/prototype/setUTCHours/not-a-constructor.js new file mode 100644 index 0000000000..b90cbd484d --- /dev/null +++ b/test/built-ins/Date/prototype/setUTCHours/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setUTCHours does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setUTCHours), + false, + 'isConstructor(Date.prototype.setUTCHours) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCHours(); +}, '`let date = new Date(Date.now()); new date.setUTCHours()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js b/test/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js new file mode 100644 index 0000000000..b4dbc75c02 --- /dev/null +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setUTCMilliseconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setUTCMilliseconds), + false, + 'isConstructor(Date.prototype.setUTCMilliseconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCMilliseconds(); +}, '`let date = new Date(Date.now()); new date.setUTCMilliseconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js b/test/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js new file mode 100644 index 0000000000..0647118890 --- /dev/null +++ b/test/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setUTCMinutes does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setUTCMinutes), + false, + 'isConstructor(Date.prototype.setUTCMinutes) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCMinutes(); +}, '`let date = new Date(Date.now()); new date.setUTCMinutes()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js b/test/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js new file mode 100644 index 0000000000..d5a455ed2a --- /dev/null +++ b/test/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setUTCMonth does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setUTCMonth), + false, + 'isConstructor(Date.prototype.setUTCMonth) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCMonth(); +}, '`let date = new Date(Date.now()); new date.setUTCMonth()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js b/test/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js new file mode 100644 index 0000000000..13a7507233 --- /dev/null +++ b/test/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setUTCSeconds does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setUTCSeconds), + false, + 'isConstructor(Date.prototype.setUTCSeconds) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setUTCSeconds(); +}, '`let date = new Date(Date.now()); new date.setUTCSeconds()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toDateString/not-a-constructor.js b/test/built-ins/Date/prototype/toDateString/not-a-constructor.js new file mode 100644 index 0000000000..6320f29698 --- /dev/null +++ b/test/built-ins/Date/prototype/toDateString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toDateString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toDateString), + false, + 'isConstructor(Date.prototype.toDateString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toDateString(); +}, '`let date = new Date(Date.now()); new date.toDateString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toISOString/not-a-constructor.js b/test/built-ins/Date/prototype/toISOString/not-a-constructor.js new file mode 100644 index 0000000000..8df5305915 --- /dev/null +++ b/test/built-ins/Date/prototype/toISOString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toISOString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toISOString), + false, + 'isConstructor(Date.prototype.toISOString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toISOString(); +}, '`let date = new Date(Date.now()); new date.toISOString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toJSON/not-a-constructor.js b/test/built-ins/Date/prototype/toJSON/not-a-constructor.js new file mode 100644 index 0000000000..b06b229456 --- /dev/null +++ b/test/built-ins/Date/prototype/toJSON/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toJSON does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toJSON), + false, + 'isConstructor(Date.prototype.toJSON) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toJSON(); +}, '`let date = new Date(Date.now()); new date.toJSON()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js b/test/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js new file mode 100644 index 0000000000..d4bf9a3e9e --- /dev/null +++ b/test/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toLocaleDateString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toLocaleDateString), + false, + 'isConstructor(Date.prototype.toLocaleDateString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toLocaleDateString(); +}, '`let date = new Date(Date.now()); new date.toLocaleDateString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toLocaleString/not-a-constructor.js b/test/built-ins/Date/prototype/toLocaleString/not-a-constructor.js new file mode 100644 index 0000000000..067b0e752c --- /dev/null +++ b/test/built-ins/Date/prototype/toLocaleString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toLocaleString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toLocaleString), + false, + 'isConstructor(Date.prototype.toLocaleString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toLocaleString(); +}, '`let date = new Date(Date.now()); new date.toLocaleString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js b/test/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js new file mode 100644 index 0000000000..c2c7586fc9 --- /dev/null +++ b/test/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toLocaleTimeString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toLocaleTimeString), + false, + 'isConstructor(Date.prototype.toLocaleTimeString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toLocaleTimeString(); +}, '`let date = new Date(Date.now()); new date.toLocaleTimeString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toString/not-a-constructor.js b/test/built-ins/Date/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..bb4fdb252c --- /dev/null +++ b/test/built-ins/Date/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toString), + false, + 'isConstructor(Date.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toString(); +}, '`let date = new Date(Date.now()); new date.toString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toTimeString/not-a-constructor.js b/test/built-ins/Date/prototype/toTimeString/not-a-constructor.js new file mode 100644 index 0000000000..982f5e3904 --- /dev/null +++ b/test/built-ins/Date/prototype/toTimeString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toTimeString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toTimeString), + false, + 'isConstructor(Date.prototype.toTimeString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toTimeString(); +}, '`let date = new Date(Date.now()); new date.toTimeString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/toUTCString/not-a-constructor.js b/test/built-ins/Date/prototype/toUTCString/not-a-constructor.js new file mode 100644 index 0000000000..5d73d2d667 --- /dev/null +++ b/test/built-ins/Date/prototype/toUTCString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toUTCString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toUTCString), + false, + 'isConstructor(Date.prototype.toUTCString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toUTCString(); +}, '`let date = new Date(Date.now()); new date.toUTCString()` throws TypeError'); + diff --git a/test/built-ins/Date/prototype/valueOf/not-a-constructor.js b/test/built-ins/Date/prototype/valueOf/not-a-constructor.js new file mode 100644 index 0000000000..75402d9350 --- /dev/null +++ b/test/built-ins/Date/prototype/valueOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.valueOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.valueOf), + false, + 'isConstructor(Date.prototype.valueOf) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.valueOf(); +}, '`let date = new Date(Date.now()); new date.valueOf()` throws TypeError'); + diff --git a/test/built-ins/Error/prototype/toString/not-a-constructor.js b/test/built-ins/Error/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..759bcba8c5 --- /dev/null +++ b/test/built-ins/Error/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Error.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Error.prototype.toString), + false, + 'isConstructor(Error.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + new Error.prototype.toString(); +}, '`new Error.prototype.toString()` throws TypeError'); + diff --git a/test/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js b/test/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js new file mode 100644 index 0000000000..c0153f1dda --- /dev/null +++ b/test/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + FinalizationRegistry.prototype.cleanupSome does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, FinalizationRegistry, arrow-function] +---*/ + +assert.sameValue( + isConstructor(FinalizationRegistry.prototype.cleanupSome), + false, + 'isConstructor(FinalizationRegistry.prototype.cleanupSome) must return false' +); + +assert.throws(TypeError, () => { + let fr = new FinalizationRegistry(() => {}); new fr.cleanupSome(() => {}); +}, '`let fr = new FinalizationRegistry(() => {}); new fr.cleanupSome(() => {})` throws TypeError'); + diff --git a/test/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js b/test/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js new file mode 100644 index 0000000000..357248e1b0 --- /dev/null +++ b/test/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + FinalizationRegistry.prototype.register does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, FinalizationRegistry, arrow-function] +---*/ + +assert.sameValue( + isConstructor(FinalizationRegistry.prototype.register), + false, + 'isConstructor(FinalizationRegistry.prototype.register) must return false' +); + +assert.throws(TypeError, () => { + let fr = new FinalizationRegistry(() => {}); new fr.register({}); +}, '`let fr = new FinalizationRegistry(() => {}); new fr.register({})` throws TypeError'); + diff --git a/test/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js b/test/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js new file mode 100644 index 0000000000..29883694f2 --- /dev/null +++ b/test/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + FinalizationRegistry.prototype.unregister does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, FinalizationRegistry, arrow-function] +---*/ + +assert.sameValue( + isConstructor(FinalizationRegistry.prototype.unregister), + false, + 'isConstructor(FinalizationRegistry.prototype.unregister) must return false' +); + +assert.throws(TypeError, () => { + let fr = new FinalizationRegistry(() => {}); let token = {}; fr.register(token); new fr.unregister(token); +}, '`let fr = new FinalizationRegistry(() => {}); let token = {}; fr.register(token); new fr.unregister(token)` throws TypeError'); + diff --git a/test/built-ins/Function/prototype/apply/not-a-constructor.js b/test/built-ins/Function/prototype/apply/not-a-constructor.js new file mode 100644 index 0000000000..1ea7ee265f --- /dev/null +++ b/test/built-ins/Function/prototype/apply/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Function.prototype.apply does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Function.prototype.apply), + false, + 'isConstructor(Function.prototype.apply) must return false' +); + +assert.throws(TypeError, () => { + new Function.prototype.apply(); +}, '`new Function.prototype.apply()` throws TypeError'); + diff --git a/test/built-ins/Function/prototype/bind/not-a-constructor.js b/test/built-ins/Function/prototype/bind/not-a-constructor.js new file mode 100644 index 0000000000..880e23cd2a --- /dev/null +++ b/test/built-ins/Function/prototype/bind/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Function.prototype.bind does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Function.prototype.bind), + false, + 'isConstructor(Function.prototype.bind) must return false' +); + +assert.throws(TypeError, () => { + new Function.prototype.bind(); +}, '`new Function.prototype.bind()` throws TypeError'); + diff --git a/test/built-ins/Function/prototype/call/not-a-constructor.js b/test/built-ins/Function/prototype/call/not-a-constructor.js new file mode 100644 index 0000000000..82b1f87af1 --- /dev/null +++ b/test/built-ins/Function/prototype/call/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Function.prototype.call does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Function.prototype.call), + false, + 'isConstructor(Function.prototype.call) must return false' +); + +assert.throws(TypeError, () => { + new Function.prototype.call(); +}, '`new Function.prototype.call()` throws TypeError'); + diff --git a/test/built-ins/Function/prototype/toString/not-a-constructor.js b/test/built-ins/Function/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..7257bf46da --- /dev/null +++ b/test/built-ins/Function/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Function.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Function.prototype.toString), + false, + 'isConstructor(Function.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + new Function.prototype.toString(); +}, '`new Function.prototype.toString()` throws TypeError'); + diff --git a/test/built-ins/GeneratorPrototype/next/not-a-constructor.js b/test/built-ins/GeneratorPrototype/next/not-a-constructor.js new file mode 100644 index 0000000000..7130a01db2 --- /dev/null +++ b/test/built-ins/GeneratorPrototype/next/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getPrototypeOf((function* g() {}).prototype).next does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, generators, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getPrototypeOf((function* g() {}).prototype).next), + false, + 'isConstructor(Object.getPrototypeOf((function* g() {}).prototype).next) must return false' +); + +assert.throws(TypeError, () => { + function* g() {} let iterator = g(); new iterator.next(); +}, '`function* g() {} let iterator = g(); new iterator.next()` throws TypeError'); + diff --git a/test/built-ins/GeneratorPrototype/return/not-a-constructor.js b/test/built-ins/GeneratorPrototype/return/not-a-constructor.js new file mode 100644 index 0000000000..7ebbd948a8 --- /dev/null +++ b/test/built-ins/GeneratorPrototype/return/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getPrototypeOf((function* g() {}).prototype).return does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, generators, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getPrototypeOf((function* g() {}).prototype).return), + false, + 'isConstructor(Object.getPrototypeOf((function* g() {}).prototype).return) must return false' +); + +assert.throws(TypeError, () => { + function* g() {} let iterator = g(); new iterator.return(); +}, '`function* g() {} let iterator = g(); new iterator.return()` throws TypeError'); + diff --git a/test/built-ins/GeneratorPrototype/throw/not-a-constructor.js b/test/built-ins/GeneratorPrototype/throw/not-a-constructor.js new file mode 100644 index 0000000000..a48a07151e --- /dev/null +++ b/test/built-ins/GeneratorPrototype/throw/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getPrototypeOf((function* g() {}).prototype).throw does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, generators, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getPrototypeOf((function* g() {}).prototype).throw), + false, + 'isConstructor(Object.getPrototypeOf((function* g() {}).prototype).throw) must return false' +); + +assert.throws(TypeError, () => { + function* g() {} let expected = new Test262Error(); let iterator = g();try {new iterator.throw(expected);} catch (e) {if (e !== expected) {throw e;}} +}, '`function* g() {} let expected = new Test262Error(); let iterator = g();try {new iterator.throw(expected);} catch (e) {if (e !== expected) {throw e;}}` throws TypeError'); + diff --git a/test/built-ins/JSON/parse/not-a-constructor.js b/test/built-ins/JSON/parse/not-a-constructor.js new file mode 100644 index 0000000000..a815cded6e --- /dev/null +++ b/test/built-ins/JSON/parse/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + JSON.parse does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(JSON.parse), false, 'isConstructor(JSON.parse) must return false'); + +assert.throws(TypeError, () => { + new JSON.parse('{}'); +}, '`new JSON.parse(\'{}\')` throws TypeError'); + diff --git a/test/built-ins/JSON/stringify/not-a-constructor.js b/test/built-ins/JSON/stringify/not-a-constructor.js new file mode 100644 index 0000000000..cd2294c6f4 --- /dev/null +++ b/test/built-ins/JSON/stringify/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + JSON.stringify does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(JSON.stringify), false, 'isConstructor(JSON.stringify) must return false'); + +assert.throws(TypeError, () => { + new JSON.stringify({}); +}, '`new JSON.stringify({})` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js b/test/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js new file mode 100644 index 0000000000..a46d9fe1af --- /dev/null +++ b/test/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype[Symbol.iterator] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.iterator, Map, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Map.prototype[Symbol.iterator]), + false, + 'isConstructor(Map.prototype[Symbol.iterator]) must return false' +); + +assert.throws(TypeError, () => { + let m = new Map(); new m[Symbol.iterator](); +}, '`let m = new Map(); new m[Symbol.iterator]()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/clear/not-a-constructor.js b/test/built-ins/Map/prototype/clear/not-a-constructor.js new file mode 100644 index 0000000000..8649892500 --- /dev/null +++ b/test/built-ins/Map/prototype/clear/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.clear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue(isConstructor(Map.prototype.clear), false, 'isConstructor(Map.prototype.clear) must return false'); + +assert.throws(TypeError, () => { + let m = new Map(); new m.clear(); +}, '`let m = new Map(); new m.clear()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/delete/not-a-constructor.js b/test/built-ins/Map/prototype/delete/not-a-constructor.js new file mode 100644 index 0000000000..7c804d71e7 --- /dev/null +++ b/test/built-ins/Map/prototype/delete/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.delete does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue(isConstructor(Map.prototype.delete), false, 'isConstructor(Map.prototype.delete) must return false'); + +assert.throws(TypeError, () => { + let m = new Map(); new m.delete(); +}, '`let m = new Map(); new m.delete()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/entries/not-a-constructor.js b/test/built-ins/Map/prototype/entries/not-a-constructor.js new file mode 100644 index 0000000000..e2824cea2e --- /dev/null +++ b/test/built-ins/Map/prototype/entries/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.entries does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Map.prototype.entries), + false, + 'isConstructor(Map.prototype.entries) must return false' +); + +assert.throws(TypeError, () => { + let m = new Map(); new m.entries(); +}, '`let m = new Map(); new m.entries()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/forEach/not-a-constructor.js b/test/built-ins/Map/prototype/forEach/not-a-constructor.js new file mode 100644 index 0000000000..beeb01363b --- /dev/null +++ b/test/built-ins/Map/prototype/forEach/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.forEach does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Map.prototype.forEach), + false, + 'isConstructor(Map.prototype.forEach) must return false' +); + +assert.throws(TypeError, () => { + let m = new Map(); new m.forEach(); +}, '`let m = new Map(); new m.forEach()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/get/not-a-constructor.js b/test/built-ins/Map/prototype/get/not-a-constructor.js new file mode 100644 index 0000000000..e2b6e2471e --- /dev/null +++ b/test/built-ins/Map/prototype/get/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.get does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue(isConstructor(Map.prototype.get), false, 'isConstructor(Map.prototype.get) must return false'); + +assert.throws(TypeError, () => { + let m = new Map(); new m.get(); +}, '`let m = new Map(); new m.get()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/has/not-a-constructor.js b/test/built-ins/Map/prototype/has/not-a-constructor.js new file mode 100644 index 0000000000..3338db48af --- /dev/null +++ b/test/built-ins/Map/prototype/has/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.has does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue(isConstructor(Map.prototype.has), false, 'isConstructor(Map.prototype.has) must return false'); + +assert.throws(TypeError, () => { + let m = new Map(); new m.has(); +}, '`let m = new Map(); new m.has()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/keys/not-a-constructor.js b/test/built-ins/Map/prototype/keys/not-a-constructor.js new file mode 100644 index 0000000000..9d84207e33 --- /dev/null +++ b/test/built-ins/Map/prototype/keys/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.keys does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue(isConstructor(Map.prototype.keys), false, 'isConstructor(Map.prototype.keys) must return false'); + +assert.throws(TypeError, () => { + let m = new Map(); new m.keys(); +}, '`let m = new Map(); new m.keys()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/set/not-a-constructor.js b/test/built-ins/Map/prototype/set/not-a-constructor.js new file mode 100644 index 0000000000..3997fda7da --- /dev/null +++ b/test/built-ins/Map/prototype/set/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.set does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue(isConstructor(Map.prototype.set), false, 'isConstructor(Map.prototype.set) must return false'); + +assert.throws(TypeError, () => { + let m = new Map(); new m.set(); +}, '`let m = new Map(); new m.set()` throws TypeError'); + diff --git a/test/built-ins/Map/prototype/values/not-a-constructor.js b/test/built-ins/Map/prototype/values/not-a-constructor.js new file mode 100644 index 0000000000..547008e405 --- /dev/null +++ b/test/built-ins/Map/prototype/values/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Map.prototype.values does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Map, arrow-function] +---*/ + +assert.sameValue(isConstructor(Map.prototype.values), false, 'isConstructor(Map.prototype.values) must return false'); + +assert.throws(TypeError, () => { + let m = new Map(); new m.values(); +}, '`let m = new Map(); new m.values()` throws TypeError'); + diff --git a/test/built-ins/Math/abs/not-a-constructor.js b/test/built-ins/Math/abs/not-a-constructor.js new file mode 100644 index 0000000000..821a976491 --- /dev/null +++ b/test/built-ins/Math/abs/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.abs does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.abs), false, 'isConstructor(Math.abs) must return false'); + +assert.throws(TypeError, () => { + new Math.abs(); +}, '`new Math.abs()` throws TypeError'); + diff --git a/test/built-ins/Math/acos/not-a-constructor.js b/test/built-ins/Math/acos/not-a-constructor.js new file mode 100644 index 0000000000..7632a4261b --- /dev/null +++ b/test/built-ins/Math/acos/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.acos does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.acos), false, 'isConstructor(Math.acos) must return false'); + +assert.throws(TypeError, () => { + new Math.acos(); +}, '`new Math.acos()` throws TypeError'); + diff --git a/test/built-ins/Math/acosh/not-a-constructor.js b/test/built-ins/Math/acosh/not-a-constructor.js new file mode 100644 index 0000000000..da6c7b7a91 --- /dev/null +++ b/test/built-ins/Math/acosh/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.acosh does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.acosh), false, 'isConstructor(Math.acosh) must return false'); + +assert.throws(TypeError, () => { + new Math.acosh(); +}, '`new Math.acosh()` throws TypeError'); + diff --git a/test/built-ins/Math/asin/not-a-constructor.js b/test/built-ins/Math/asin/not-a-constructor.js new file mode 100644 index 0000000000..86f41330fb --- /dev/null +++ b/test/built-ins/Math/asin/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.asin does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.asin), false, 'isConstructor(Math.asin) must return false'); + +assert.throws(TypeError, () => { + new Math.asin(); +}, '`new Math.asin()` throws TypeError'); + diff --git a/test/built-ins/Math/asinh/not-a-constructor.js b/test/built-ins/Math/asinh/not-a-constructor.js new file mode 100644 index 0000000000..e8c6be7bfc --- /dev/null +++ b/test/built-ins/Math/asinh/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.asinh does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.asinh), false, 'isConstructor(Math.asinh) must return false'); + +assert.throws(TypeError, () => { + new Math.asinh(); +}, '`new Math.asinh()` throws TypeError'); + diff --git a/test/built-ins/Math/atan/not-a-constructor.js b/test/built-ins/Math/atan/not-a-constructor.js new file mode 100644 index 0000000000..79e508eeaf --- /dev/null +++ b/test/built-ins/Math/atan/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.atan does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.atan), false, 'isConstructor(Math.atan) must return false'); + +assert.throws(TypeError, () => { + new Math.atan(); +}, '`new Math.atan()` throws TypeError'); + diff --git a/test/built-ins/Math/atan2/not-a-constructor.js b/test/built-ins/Math/atan2/not-a-constructor.js new file mode 100644 index 0000000000..8a70d3a3c3 --- /dev/null +++ b/test/built-ins/Math/atan2/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.atan2 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.atan2), false, 'isConstructor(Math.atan2) must return false'); + +assert.throws(TypeError, () => { + new Math.atan2(); +}, '`new Math.atan2()` throws TypeError'); + diff --git a/test/built-ins/Math/atanh/not-a-constructor.js b/test/built-ins/Math/atanh/not-a-constructor.js new file mode 100644 index 0000000000..3453a851f0 --- /dev/null +++ b/test/built-ins/Math/atanh/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.atanh does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.atanh), false, 'isConstructor(Math.atanh) must return false'); + +assert.throws(TypeError, () => { + new Math.atanh(); +}, '`new Math.atanh()` throws TypeError'); + diff --git a/test/built-ins/Math/cbrt/not-a-constructor.js b/test/built-ins/Math/cbrt/not-a-constructor.js new file mode 100644 index 0000000000..7f989bd79b --- /dev/null +++ b/test/built-ins/Math/cbrt/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.cbrt does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.cbrt), false, 'isConstructor(Math.cbrt) must return false'); + +assert.throws(TypeError, () => { + new Math.cbrt(); +}, '`new Math.cbrt()` throws TypeError'); + diff --git a/test/built-ins/Math/ceil/not-a-constructor.js b/test/built-ins/Math/ceil/not-a-constructor.js new file mode 100644 index 0000000000..06fe934984 --- /dev/null +++ b/test/built-ins/Math/ceil/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.ceil does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.ceil), false, 'isConstructor(Math.ceil) must return false'); + +assert.throws(TypeError, () => { + new Math.ceil(); +}, '`new Math.ceil()` throws TypeError'); + diff --git a/test/built-ins/Math/clz32/not-a-constructor.js b/test/built-ins/Math/clz32/not-a-constructor.js new file mode 100644 index 0000000000..69bb0dedd9 --- /dev/null +++ b/test/built-ins/Math/clz32/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.clz32 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.clz32), false, 'isConstructor(Math.clz32) must return false'); + +assert.throws(TypeError, () => { + new Math.clz32(); +}, '`new Math.clz32()` throws TypeError'); + diff --git a/test/built-ins/Math/cos/not-a-constructor.js b/test/built-ins/Math/cos/not-a-constructor.js new file mode 100644 index 0000000000..4fc4400f77 --- /dev/null +++ b/test/built-ins/Math/cos/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.cos does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.cos), false, 'isConstructor(Math.cos) must return false'); + +assert.throws(TypeError, () => { + new Math.cos(); +}, '`new Math.cos()` throws TypeError'); + diff --git a/test/built-ins/Math/cosh/not-a-constructor.js b/test/built-ins/Math/cosh/not-a-constructor.js new file mode 100644 index 0000000000..94c919f2dc --- /dev/null +++ b/test/built-ins/Math/cosh/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.cosh does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.cosh), false, 'isConstructor(Math.cosh) must return false'); + +assert.throws(TypeError, () => { + new Math.cosh(); +}, '`new Math.cosh()` throws TypeError'); + diff --git a/test/built-ins/Math/exp/not-a-constructor.js b/test/built-ins/Math/exp/not-a-constructor.js new file mode 100644 index 0000000000..4f26dfbd28 --- /dev/null +++ b/test/built-ins/Math/exp/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.exp does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.exp), false, 'isConstructor(Math.exp) must return false'); + +assert.throws(TypeError, () => { + new Math.exp(); +}, '`new Math.exp()` throws TypeError'); + diff --git a/test/built-ins/Math/expm1/not-a-constructor.js b/test/built-ins/Math/expm1/not-a-constructor.js new file mode 100644 index 0000000000..6d59db44fc --- /dev/null +++ b/test/built-ins/Math/expm1/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.expm1 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.expm1), false, 'isConstructor(Math.expm1) must return false'); + +assert.throws(TypeError, () => { + new Math.expm1(); +}, '`new Math.expm1()` throws TypeError'); + diff --git a/test/built-ins/Math/floor/not-a-constructor.js b/test/built-ins/Math/floor/not-a-constructor.js new file mode 100644 index 0000000000..4addd3abd3 --- /dev/null +++ b/test/built-ins/Math/floor/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.floor does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.floor), false, 'isConstructor(Math.floor) must return false'); + +assert.throws(TypeError, () => { + new Math.floor(); +}, '`new Math.floor()` throws TypeError'); + diff --git a/test/built-ins/Math/fround/not-a-constructor.js b/test/built-ins/Math/fround/not-a-constructor.js new file mode 100644 index 0000000000..fc5543babb --- /dev/null +++ b/test/built-ins/Math/fround/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.fround does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.fround), false, 'isConstructor(Math.fround) must return false'); + +assert.throws(TypeError, () => { + new Math.fround(); +}, '`new Math.fround()` throws TypeError'); + diff --git a/test/built-ins/Math/hypot/not-a-constructor.js b/test/built-ins/Math/hypot/not-a-constructor.js new file mode 100644 index 0000000000..5b497f4c7c --- /dev/null +++ b/test/built-ins/Math/hypot/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.hypot does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.hypot), false, 'isConstructor(Math.hypot) must return false'); + +assert.throws(TypeError, () => { + new Math.hypot(); +}, '`new Math.hypot()` throws TypeError'); + diff --git a/test/built-ins/Math/imul/not-a-constructor.js b/test/built-ins/Math/imul/not-a-constructor.js new file mode 100644 index 0000000000..8884b15f63 --- /dev/null +++ b/test/built-ins/Math/imul/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.imul does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.imul), false, 'isConstructor(Math.imul) must return false'); + +assert.throws(TypeError, () => { + new Math.imul(); +}, '`new Math.imul()` throws TypeError'); + diff --git a/test/built-ins/Math/log/not-a-constructor.js b/test/built-ins/Math/log/not-a-constructor.js new file mode 100644 index 0000000000..5435e4bb3d --- /dev/null +++ b/test/built-ins/Math/log/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.log does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.log), false, 'isConstructor(Math.log) must return false'); + +assert.throws(TypeError, () => { + new Math.log(); +}, '`new Math.log()` throws TypeError'); + diff --git a/test/built-ins/Math/log10/not-a-constructor.js b/test/built-ins/Math/log10/not-a-constructor.js new file mode 100644 index 0000000000..58c759918d --- /dev/null +++ b/test/built-ins/Math/log10/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.log10 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.log10), false, 'isConstructor(Math.log10) must return false'); + +assert.throws(TypeError, () => { + new Math.log10(); +}, '`new Math.log10()` throws TypeError'); + diff --git a/test/built-ins/Math/log1p/not-a-constructor.js b/test/built-ins/Math/log1p/not-a-constructor.js new file mode 100644 index 0000000000..06e952d8f8 --- /dev/null +++ b/test/built-ins/Math/log1p/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.log1p does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.log1p), false, 'isConstructor(Math.log1p) must return false'); + +assert.throws(TypeError, () => { + new Math.log1p(); +}, '`new Math.log1p()` throws TypeError'); + diff --git a/test/built-ins/Math/log2/not-a-constructor.js b/test/built-ins/Math/log2/not-a-constructor.js new file mode 100644 index 0000000000..c08eddae0b --- /dev/null +++ b/test/built-ins/Math/log2/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.log2 does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.log2), false, 'isConstructor(Math.log2) must return false'); + +assert.throws(TypeError, () => { + new Math.log2(); +}, '`new Math.log2()` throws TypeError'); + diff --git a/test/built-ins/Math/max/not-a-constructor.js b/test/built-ins/Math/max/not-a-constructor.js new file mode 100644 index 0000000000..f0811b3cf8 --- /dev/null +++ b/test/built-ins/Math/max/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.max does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.max), false, 'isConstructor(Math.max) must return false'); + +assert.throws(TypeError, () => { + new Math.max(); +}, '`new Math.max()` throws TypeError'); + diff --git a/test/built-ins/Math/min/not-a-constructor.js b/test/built-ins/Math/min/not-a-constructor.js new file mode 100644 index 0000000000..47370e4411 --- /dev/null +++ b/test/built-ins/Math/min/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.min does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.min), false, 'isConstructor(Math.min) must return false'); + +assert.throws(TypeError, () => { + new Math.min(); +}, '`new Math.min()` throws TypeError'); + diff --git a/test/built-ins/Math/pow/not-a-constructor.js b/test/built-ins/Math/pow/not-a-constructor.js new file mode 100644 index 0000000000..fad4c25dbf --- /dev/null +++ b/test/built-ins/Math/pow/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.pow does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.pow), false, 'isConstructor(Math.pow) must return false'); + +assert.throws(TypeError, () => { + new Math.pow(); +}, '`new Math.pow()` throws TypeError'); + diff --git a/test/built-ins/Math/random/not-a-constructor.js b/test/built-ins/Math/random/not-a-constructor.js new file mode 100644 index 0000000000..55752baca5 --- /dev/null +++ b/test/built-ins/Math/random/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.random does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.random), false, 'isConstructor(Math.random) must return false'); + +assert.throws(TypeError, () => { + new Math.random(); +}, '`new Math.random()` throws TypeError'); + diff --git a/test/built-ins/Math/round/not-a-constructor.js b/test/built-ins/Math/round/not-a-constructor.js new file mode 100644 index 0000000000..2f9ada06a9 --- /dev/null +++ b/test/built-ins/Math/round/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.round does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.round), false, 'isConstructor(Math.round) must return false'); + +assert.throws(TypeError, () => { + new Math.round(); +}, '`new Math.round()` throws TypeError'); + diff --git a/test/built-ins/Math/sign/not-a-constructor.js b/test/built-ins/Math/sign/not-a-constructor.js new file mode 100644 index 0000000000..df7cf0ed0c --- /dev/null +++ b/test/built-ins/Math/sign/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.sign does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.sign), false, 'isConstructor(Math.sign) must return false'); + +assert.throws(TypeError, () => { + new Math.sign(); +}, '`new Math.sign()` throws TypeError'); + diff --git a/test/built-ins/Math/sin/not-a-constructor.js b/test/built-ins/Math/sin/not-a-constructor.js new file mode 100644 index 0000000000..cba00547f6 --- /dev/null +++ b/test/built-ins/Math/sin/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.sin does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.sin), false, 'isConstructor(Math.sin) must return false'); + +assert.throws(TypeError, () => { + new Math.sin(); +}, '`new Math.sin()` throws TypeError'); + diff --git a/test/built-ins/Math/sinh/not-a-constructor.js b/test/built-ins/Math/sinh/not-a-constructor.js new file mode 100644 index 0000000000..d669d71faf --- /dev/null +++ b/test/built-ins/Math/sinh/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.sinh does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.sinh), false, 'isConstructor(Math.sinh) must return false'); + +assert.throws(TypeError, () => { + new Math.sinh(); +}, '`new Math.sinh()` throws TypeError'); + diff --git a/test/built-ins/Math/sqrt/not-a-constructor.js b/test/built-ins/Math/sqrt/not-a-constructor.js new file mode 100644 index 0000000000..a542d1ecf6 --- /dev/null +++ b/test/built-ins/Math/sqrt/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.sqrt does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.sqrt), false, 'isConstructor(Math.sqrt) must return false'); + +assert.throws(TypeError, () => { + new Math.sqrt(); +}, '`new Math.sqrt()` throws TypeError'); + diff --git a/test/built-ins/Math/tan/not-a-constructor.js b/test/built-ins/Math/tan/not-a-constructor.js new file mode 100644 index 0000000000..bc053f5275 --- /dev/null +++ b/test/built-ins/Math/tan/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.tan does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.tan), false, 'isConstructor(Math.tan) must return false'); + +assert.throws(TypeError, () => { + new Math.tan(); +}, '`new Math.tan()` throws TypeError'); + diff --git a/test/built-ins/Math/tanh/not-a-constructor.js b/test/built-ins/Math/tanh/not-a-constructor.js new file mode 100644 index 0000000000..b91f195000 --- /dev/null +++ b/test/built-ins/Math/tanh/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.tanh does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.tanh), false, 'isConstructor(Math.tanh) must return false'); + +assert.throws(TypeError, () => { + new Math.tanh(); +}, '`new Math.tanh()` throws TypeError'); + diff --git a/test/built-ins/Math/trunc/not-a-constructor.js b/test/built-ins/Math/trunc/not-a-constructor.js new file mode 100644 index 0000000000..7abd8df2c0 --- /dev/null +++ b/test/built-ins/Math/trunc/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.trunc does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Math.trunc), false, 'isConstructor(Math.trunc) must return false'); + +assert.throws(TypeError, () => { + new Math.trunc(); +}, '`new Math.trunc()` throws TypeError'); + diff --git a/test/built-ins/Number/isFinite/not-a-constructor.js b/test/built-ins/Number/isFinite/not-a-constructor.js new file mode 100644 index 0000000000..ec49e89efb --- /dev/null +++ b/test/built-ins/Number/isFinite/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.isFinite does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Number.isFinite), false, 'isConstructor(Number.isFinite) must return false'); + +assert.throws(TypeError, () => { + new Number.isFinite(); +}, '`new Number.isFinite()` throws TypeError'); + diff --git a/test/built-ins/Number/isInteger/not-a-constructor.js b/test/built-ins/Number/isInteger/not-a-constructor.js new file mode 100644 index 0000000000..5f1c73de68 --- /dev/null +++ b/test/built-ins/Number/isInteger/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.isInteger does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Number.isInteger), false, 'isConstructor(Number.isInteger) must return false'); + +assert.throws(TypeError, () => { + new Number.isInteger(); +}, '`new Number.isInteger()` throws TypeError'); + diff --git a/test/built-ins/Number/isNaN/not-a-constructor.js b/test/built-ins/Number/isNaN/not-a-constructor.js new file mode 100644 index 0000000000..009245ce64 --- /dev/null +++ b/test/built-ins/Number/isNaN/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.isNaN does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Number.isNaN), false, 'isConstructor(Number.isNaN) must return false'); + +assert.throws(TypeError, () => { + new Number.isNaN(); +}, '`new Number.isNaN()` throws TypeError'); + diff --git a/test/built-ins/Number/isSafeInteger/not-a-constructor.js b/test/built-ins/Number/isSafeInteger/not-a-constructor.js new file mode 100644 index 0000000000..60af065748 --- /dev/null +++ b/test/built-ins/Number/isSafeInteger/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.isSafeInteger does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Number.isSafeInteger), false, 'isConstructor(Number.isSafeInteger) must return false'); + +assert.throws(TypeError, () => { + new Number.isSafeInteger(); +}, '`new Number.isSafeInteger()` throws TypeError'); + diff --git a/test/built-ins/Number/parseFloat/not-a-constructor.js b/test/built-ins/Number/parseFloat/not-a-constructor.js new file mode 100644 index 0000000000..a756f03d61 --- /dev/null +++ b/test/built-ins/Number/parseFloat/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.parseFloat does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Number.parseFloat), false, 'isConstructor(Number.parseFloat) must return false'); + +assert.throws(TypeError, () => { + new Number.parseFloat(); +}, '`new Number.parseFloat()` throws TypeError'); + diff --git a/test/built-ins/Number/parseInt/not-a-constructor.js b/test/built-ins/Number/parseInt/not-a-constructor.js new file mode 100644 index 0000000000..9a3936fe52 --- /dev/null +++ b/test/built-ins/Number/parseInt/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.parseInt does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Number.parseInt), false, 'isConstructor(Number.parseInt) must return false'); + +assert.throws(TypeError, () => { + new Number.parseInt(); +}, '`new Number.parseInt()` throws TypeError'); + diff --git a/test/built-ins/Number/prototype/toExponential/not-a-constructor.js b/test/built-ins/Number/prototype/toExponential/not-a-constructor.js new file mode 100644 index 0000000000..3a72ca7fac --- /dev/null +++ b/test/built-ins/Number/prototype/toExponential/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.prototype.toExponential does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Number.prototype.toExponential), + false, + 'isConstructor(Number.prototype.toExponential) must return false' +); + +assert.throws(TypeError, () => { + new Number.prototype.toExponential(); +}, '`new Number.prototype.toExponential()` throws TypeError'); + diff --git a/test/built-ins/Number/prototype/toFixed/not-a-constructor.js b/test/built-ins/Number/prototype/toFixed/not-a-constructor.js new file mode 100644 index 0000000000..3a85fd9ba9 --- /dev/null +++ b/test/built-ins/Number/prototype/toFixed/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.prototype.toFixed does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Number.prototype.toFixed), + false, + 'isConstructor(Number.prototype.toFixed) must return false' +); + +assert.throws(TypeError, () => { + new Number.prototype.toFixed(); +}, '`new Number.prototype.toFixed()` throws TypeError'); + diff --git a/test/built-ins/Number/prototype/toLocaleString/not-a-constructor.js b/test/built-ins/Number/prototype/toLocaleString/not-a-constructor.js new file mode 100644 index 0000000000..1e76f2e4b4 --- /dev/null +++ b/test/built-ins/Number/prototype/toLocaleString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.prototype.toLocaleString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Number.prototype.toLocaleString), + false, + 'isConstructor(Number.prototype.toLocaleString) must return false' +); + +assert.throws(TypeError, () => { + new Number.prototype.toLocaleString(); +}, '`new Number.prototype.toLocaleString()` throws TypeError'); + diff --git a/test/built-ins/Number/prototype/toPrecision/not-a-constructor.js b/test/built-ins/Number/prototype/toPrecision/not-a-constructor.js new file mode 100644 index 0000000000..a53a27b89c --- /dev/null +++ b/test/built-ins/Number/prototype/toPrecision/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.prototype.toPrecision does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Number.prototype.toPrecision), + false, + 'isConstructor(Number.prototype.toPrecision) must return false' +); + +assert.throws(TypeError, () => { + new Number.prototype.toPrecision(); +}, '`new Number.prototype.toPrecision()` throws TypeError'); + diff --git a/test/built-ins/Number/prototype/toString/not-a-constructor.js b/test/built-ins/Number/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..07463ab860 --- /dev/null +++ b/test/built-ins/Number/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Number.prototype.toString), + false, + 'isConstructor(Number.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + new Number.prototype.toString(); +}, '`new Number.prototype.toString()` throws TypeError'); + diff --git a/test/built-ins/Number/prototype/valueOf/not-a-constructor.js b/test/built-ins/Number/prototype/valueOf/not-a-constructor.js new file mode 100644 index 0000000000..18c83fe80e --- /dev/null +++ b/test/built-ins/Number/prototype/valueOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Number.prototype.valueOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Number.prototype.valueOf), + false, + 'isConstructor(Number.prototype.valueOf) must return false' +); + +assert.throws(TypeError, () => { + new Number.prototype.valueOf(); +}, '`new Number.prototype.valueOf()` throws TypeError'); + diff --git a/test/built-ins/Object/assign/not-a-constructor.js b/test/built-ins/Object/assign/not-a-constructor.js new file mode 100644 index 0000000000..26ba247af5 --- /dev/null +++ b/test/built-ins/Object/assign/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.assign does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.assign), false, 'isConstructor(Object.assign) must return false'); + +assert.throws(TypeError, () => { + new Object.assign({}); +}, '`new Object.assign({})` throws TypeError'); + diff --git a/test/built-ins/Object/create/not-a-constructor.js b/test/built-ins/Object/create/not-a-constructor.js new file mode 100644 index 0000000000..6c54b5f32e --- /dev/null +++ b/test/built-ins/Object/create/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.create does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.create), false, 'isConstructor(Object.create) must return false'); + +assert.throws(TypeError, () => { + new Object.create(null); +}, '`new Object.create(null)` throws TypeError'); + diff --git a/test/built-ins/Object/defineProperties/not-a-constructor.js b/test/built-ins/Object/defineProperties/not-a-constructor.js new file mode 100644 index 0000000000..fc32fa9e2d --- /dev/null +++ b/test/built-ins/Object/defineProperties/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.defineProperties does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.defineProperties), + false, + 'isConstructor(Object.defineProperties) must return false' +); + +assert.throws(TypeError, () => { + new Object.defineProperties({}, {}); +}, '`new Object.defineProperties({}, {})` throws TypeError'); + diff --git a/test/built-ins/Object/defineProperty/not-a-constructor.js b/test/built-ins/Object/defineProperty/not-a-constructor.js new file mode 100644 index 0000000000..5432ca72db --- /dev/null +++ b/test/built-ins/Object/defineProperty/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.defineProperty does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.defineProperty), + false, + 'isConstructor(Object.defineProperty) must return false' +); + +assert.throws(TypeError, () => { + new Object.defineProperty({}, '', {}); +}, '`new Object.defineProperty({}, \'\', {})` throws TypeError'); + diff --git a/test/built-ins/Object/entries/not-a-constructor.js b/test/built-ins/Object/entries/not-a-constructor.js new file mode 100644 index 0000000000..63d6359485 --- /dev/null +++ b/test/built-ins/Object/entries/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.entries does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.entries), false, 'isConstructor(Object.entries) must return false'); + +assert.throws(TypeError, () => { + new Object.entries({}); +}, '`new Object.entries({})` throws TypeError'); + diff --git a/test/built-ins/Object/freeze/not-a-constructor.js b/test/built-ins/Object/freeze/not-a-constructor.js new file mode 100644 index 0000000000..9c126fcba2 --- /dev/null +++ b/test/built-ins/Object/freeze/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.freeze does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.freeze), false, 'isConstructor(Object.freeze) must return false'); + +assert.throws(TypeError, () => { + new Object.freeze({}); +}, '`new Object.freeze({})` throws TypeError'); + diff --git a/test/built-ins/Object/fromEntries/not-a-constructor.js b/test/built-ins/Object/fromEntries/not-a-constructor.js new file mode 100644 index 0000000000..fd9ab8da3e --- /dev/null +++ b/test/built-ins/Object/fromEntries/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.fromEntries does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Object.fromEntries, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.fromEntries), false, 'isConstructor(Object.fromEntries) must return false'); + +assert.throws(TypeError, () => { + new Object.fromEntries([]); +}, '`new Object.fromEntries([])` throws TypeError'); + diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js b/test/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js new file mode 100644 index 0000000000..ca919af3e0 --- /dev/null +++ b/test/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getOwnPropertyDescriptor does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getOwnPropertyDescriptor), + false, + 'isConstructor(Object.getOwnPropertyDescriptor) must return false' +); + +assert.throws(TypeError, () => { + new Object.getOwnPropertyDescriptor({}, ''); +}, '`new Object.getOwnPropertyDescriptor({}, \'\')` throws TypeError'); + diff --git a/test/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js b/test/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js new file mode 100644 index 0000000000..ef8fd3d1f8 --- /dev/null +++ b/test/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getOwnPropertyDescriptors does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getOwnPropertyDescriptors), + false, + 'isConstructor(Object.getOwnPropertyDescriptors) must return false' +); + +assert.throws(TypeError, () => { + new Object.getOwnPropertyDescriptors({}); +}, '`new Object.getOwnPropertyDescriptors({})` throws TypeError'); + diff --git a/test/built-ins/Object/getOwnPropertyNames/not-a-constructor.js b/test/built-ins/Object/getOwnPropertyNames/not-a-constructor.js new file mode 100644 index 0000000000..98c29dbcbd --- /dev/null +++ b/test/built-ins/Object/getOwnPropertyNames/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getOwnPropertyNames does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getOwnPropertyNames), + false, + 'isConstructor(Object.getOwnPropertyNames) must return false' +); + +assert.throws(TypeError, () => { + new Object.getOwnPropertyNames({}); +}, '`new Object.getOwnPropertyNames({})` throws TypeError'); + diff --git a/test/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js b/test/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js new file mode 100644 index 0000000000..27f302676d --- /dev/null +++ b/test/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getOwnPropertySymbols does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getOwnPropertySymbols), + false, + 'isConstructor(Object.getOwnPropertySymbols) must return false' +); + +assert.throws(TypeError, () => { + new Object.getOwnPropertySymbols({}); +}, '`new Object.getOwnPropertySymbols({})` throws TypeError'); + diff --git a/test/built-ins/Object/getPrototypeOf/not-a-constructor.js b/test/built-ins/Object/getPrototypeOf/not-a-constructor.js new file mode 100644 index 0000000000..5064fc08c7 --- /dev/null +++ b/test/built-ins/Object/getPrototypeOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.getPrototypeOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.getPrototypeOf), + false, + 'isConstructor(Object.getPrototypeOf) must return false' +); + +assert.throws(TypeError, () => { + new Object.getPrototypeOf({}); +}, '`new Object.getPrototypeOf({})` throws TypeError'); + diff --git a/test/built-ins/Object/is/not-a-constructor.js b/test/built-ins/Object/is/not-a-constructor.js new file mode 100644 index 0000000000..e798b75a2b --- /dev/null +++ b/test/built-ins/Object/is/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.is does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Object.is, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.is), false, 'isConstructor(Object.is) must return false'); + +assert.throws(TypeError, () => { + new Object.is(0, 0); +}, '`new Object.is(0, 0)` throws TypeError'); + diff --git a/test/built-ins/Object/isExtensible/not-a-constructor.js b/test/built-ins/Object/isExtensible/not-a-constructor.js new file mode 100644 index 0000000000..fd01fb059f --- /dev/null +++ b/test/built-ins/Object/isExtensible/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.isExtensible does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.isExtensible), false, 'isConstructor(Object.isExtensible) must return false'); + +assert.throws(TypeError, () => { + new Object.isExtensible({}); +}, '`new Object.isExtensible({})` throws TypeError'); + diff --git a/test/built-ins/Object/isFrozen/not-a-constructor.js b/test/built-ins/Object/isFrozen/not-a-constructor.js new file mode 100644 index 0000000000..b1acf2c2ae --- /dev/null +++ b/test/built-ins/Object/isFrozen/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.isFrozen does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.isFrozen), false, 'isConstructor(Object.isFrozen) must return false'); + +assert.throws(TypeError, () => { + new Object.isFrozen({}); +}, '`new Object.isFrozen({})` throws TypeError'); + diff --git a/test/built-ins/Object/isSealed/not-a-constructor.js b/test/built-ins/Object/isSealed/not-a-constructor.js new file mode 100644 index 0000000000..67afdadf18 --- /dev/null +++ b/test/built-ins/Object/isSealed/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.isSealed does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.isSealed), false, 'isConstructor(Object.isSealed) must return false'); + +assert.throws(TypeError, () => { + new Object.isSealed({}); +}, '`new Object.isSealed({})` throws TypeError'); + diff --git a/test/built-ins/Object/keys/not-a-constructor.js b/test/built-ins/Object/keys/not-a-constructor.js new file mode 100644 index 0000000000..010d83a3ff --- /dev/null +++ b/test/built-ins/Object/keys/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.keys does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.keys), false, 'isConstructor(Object.keys) must return false'); + +assert.throws(TypeError, () => { + new Object.keys({}); +}, '`new Object.keys({})` throws TypeError'); + diff --git a/test/built-ins/Object/preventExtensions/not-a-constructor.js b/test/built-ins/Object/preventExtensions/not-a-constructor.js new file mode 100644 index 0000000000..85c7193e4c --- /dev/null +++ b/test/built-ins/Object/preventExtensions/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.preventExtensions does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.preventExtensions), + false, + 'isConstructor(Object.preventExtensions) must return false' +); + +assert.throws(TypeError, () => { + new Object.preventExtensions({}); +}, '`new Object.preventExtensions({})` throws TypeError'); + diff --git a/test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js b/test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js new file mode 100644 index 0000000000..9127a90363 --- /dev/null +++ b/test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.prototype.hasOwnProperty does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.prototype.hasOwnProperty), + false, + 'isConstructor(Object.prototype.hasOwnProperty) must return false' +); + +assert.throws(TypeError, () => { + new Object.prototype.hasOwnProperty(''); +}, '`new Object.prototype.hasOwnProperty(\'\')` throws TypeError'); + diff --git a/test/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js b/test/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js new file mode 100644 index 0000000000..38357e0cd9 --- /dev/null +++ b/test/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.prototype.isPrototypeOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.prototype.isPrototypeOf), + false, + 'isConstructor(Object.prototype.isPrototypeOf) must return false' +); + +assert.throws(TypeError, () => { + new Object.prototype.isPrototypeOf({}); +}, '`new Object.prototype.isPrototypeOf({})` throws TypeError'); + diff --git a/test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js b/test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js new file mode 100644 index 0000000000..eb1170bad3 --- /dev/null +++ b/test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.prototype.propertyIsEnumerable does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.prototype.propertyIsEnumerable), + false, + 'isConstructor(Object.prototype.propertyIsEnumerable) must return false' +); + +assert.throws(TypeError, () => { + new Object.prototype.propertyIsEnumerable(''); +}, '`new Object.prototype.propertyIsEnumerable(\'\')` throws TypeError'); + diff --git a/test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js b/test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js new file mode 100644 index 0000000000..3d67be4488 --- /dev/null +++ b/test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.prototype.toLocaleString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.prototype.toLocaleString), + false, + 'isConstructor(Object.prototype.toLocaleString) must return false' +); + +assert.throws(TypeError, () => { + new Object.prototype.toLocaleString(''); +}, '`new Object.prototype.toLocaleString(\'\')` throws TypeError'); + diff --git a/test/built-ins/Object/prototype/toString/not-a-constructor.js b/test/built-ins/Object/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..1e37e46510 --- /dev/null +++ b/test/built-ins/Object/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.prototype.toString), + false, + 'isConstructor(Object.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + new Object.prototype.toString(); +}, '`new Object.prototype.toString()` throws TypeError'); + diff --git a/test/built-ins/Object/prototype/valueOf/not-a-constructor.js b/test/built-ins/Object/prototype/valueOf/not-a-constructor.js new file mode 100644 index 0000000000..7f87d77208 --- /dev/null +++ b/test/built-ins/Object/prototype/valueOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.prototype.valueOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.prototype.valueOf), + false, + 'isConstructor(Object.prototype.valueOf) must return false' +); + +assert.throws(TypeError, () => { + new Object.prototype.valueOf(); +}, '`new Object.prototype.valueOf()` throws TypeError'); + diff --git a/test/built-ins/Object/seal/not-a-constructor.js b/test/built-ins/Object/seal/not-a-constructor.js new file mode 100644 index 0000000000..88f74d963f --- /dev/null +++ b/test/built-ins/Object/seal/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.seal does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.seal), false, 'isConstructor(Object.seal) must return false'); + +assert.throws(TypeError, () => { + new Object.seal(); +}, '`new Object.seal()` throws TypeError'); + diff --git a/test/built-ins/Object/setPrototypeOf/not-a-constructor.js b/test/built-ins/Object/setPrototypeOf/not-a-constructor.js new file mode 100644 index 0000000000..967903fc80 --- /dev/null +++ b/test/built-ins/Object/setPrototypeOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.setPrototypeOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Object.setPrototypeOf), + false, + 'isConstructor(Object.setPrototypeOf) must return false' +); + +assert.throws(TypeError, () => { + new Object.setPrototypeOf({}, {}); +}, '`new Object.setPrototypeOf({}, {})` throws TypeError'); + diff --git a/test/built-ins/Object/values/not-a-constructor.js b/test/built-ins/Object/values/not-a-constructor.js new file mode 100644 index 0000000000..50ce82012b --- /dev/null +++ b/test/built-ins/Object/values/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.values does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.values), false, 'isConstructor(Object.values) must return false'); + +assert.throws(TypeError, () => { + new Object.values({}); +}, '`new Object.values({})` throws TypeError'); + diff --git a/test/built-ins/Promise/all/not-a-constructor.js b/test/built-ins/Promise/all/not-a-constructor.js new file mode 100644 index 0000000000..98dd7fc190 --- /dev/null +++ b/test/built-ins/Promise/all/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.all does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Promise.all), false, 'isConstructor(Promise.all) must return false'); + +assert.throws(TypeError, () => { + new Promise.all([]); +}, '`new Promise.all([])` throws TypeError'); + diff --git a/test/built-ins/Promise/allSettled/not-a-constructor.js b/test/built-ins/Promise/allSettled/not-a-constructor.js new file mode 100644 index 0000000000..f519716f8f --- /dev/null +++ b/test/built-ins/Promise/allSettled/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.allSettled does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Promise.allSettled, arrow-function] +---*/ + +assert.sameValue(isConstructor(Promise.allSettled), false, 'isConstructor(Promise.allSettled) must return false'); + +assert.throws(TypeError, () => { + new Promise.allSettled(); +}, '`new Promise.allSettled()` throws TypeError'); + diff --git a/test/built-ins/Promise/any/not-a-constructor.js b/test/built-ins/Promise/any/not-a-constructor.js new file mode 100644 index 0000000000..f739b23307 --- /dev/null +++ b/test/built-ins/Promise/any/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.any does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Promise.any, arrow-function] +---*/ + +assert.sameValue(isConstructor(Promise.any), false, 'isConstructor(Promise.any) must return false'); + +assert.throws(TypeError, () => { + new Promise.any([1]); +}, '`new Promise.any([1])` throws TypeError'); + diff --git a/test/built-ins/Promise/prototype/catch/not-a-constructor.js b/test/built-ins/Promise/prototype/catch/not-a-constructor.js new file mode 100644 index 0000000000..722d1982cf --- /dev/null +++ b/test/built-ins/Promise/prototype/catch/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.prototype.catch does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Promise.prototype.catch), + false, + 'isConstructor(Promise.prototype.catch) must return false' +); + +assert.throws(TypeError, () => { + let p = new Promise(() => {}); new p.catch(); +}, '`let p = new Promise(() => {}); new p.catch()` throws TypeError'); + diff --git a/test/built-ins/Promise/prototype/finally/not-a-constructor.js b/test/built-ins/Promise/prototype/finally/not-a-constructor.js new file mode 100644 index 0000000000..c6e2a37bc1 --- /dev/null +++ b/test/built-ins/Promise/prototype/finally/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.prototype.finally does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Promise.prototype.finally, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Promise.prototype.finally), + false, + 'isConstructor(Promise.prototype.finally) must return false' +); + +assert.throws(TypeError, () => { + let p = new Promise(() => {}); new p.finally(); +}, '`let p = new Promise(() => {}); new p.finally()` throws TypeError'); + diff --git a/test/built-ins/Promise/prototype/then/not-a-constructor.js b/test/built-ins/Promise/prototype/then/not-a-constructor.js new file mode 100644 index 0000000000..8e1c13b249 --- /dev/null +++ b/test/built-ins/Promise/prototype/then/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.prototype.then does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Promise.prototype.then), + false, + 'isConstructor(Promise.prototype.then) must return false' +); + +assert.throws(TypeError, () => { + let p = new Promise(() => {}); new p.then(); +}, '`let p = new Promise(() => {}); new p.then()` throws TypeError'); + diff --git a/test/built-ins/Promise/race/not-a-constructor.js b/test/built-ins/Promise/race/not-a-constructor.js new file mode 100644 index 0000000000..347c54736f --- /dev/null +++ b/test/built-ins/Promise/race/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.race does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Promise.race), false, 'isConstructor(Promise.race) must return false'); + +assert.throws(TypeError, () => { + new Promise.race([]); +}, '`new Promise.race([])` throws TypeError'); + diff --git a/test/built-ins/Promise/reject/not-a-constructor.js b/test/built-ins/Promise/reject/not-a-constructor.js new file mode 100644 index 0000000000..9c8498de90 --- /dev/null +++ b/test/built-ins/Promise/reject/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.reject does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Promise.reject), false, 'isConstructor(Promise.reject) must return false'); + +assert.throws(TypeError, () => { + new Promise.reject(); +}, '`new Promise.reject()` throws TypeError'); + diff --git a/test/built-ins/Promise/resolve/not-a-constructor.js b/test/built-ins/Promise/resolve/not-a-constructor.js new file mode 100644 index 0000000000..422bbe0b7c --- /dev/null +++ b/test/built-ins/Promise/resolve/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Promise.resolve does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Promise.resolve), false, 'isConstructor(Promise.resolve) must return false'); + +assert.throws(TypeError, () => { + new Promise.resolve(); +}, '`new Promise.resolve()` throws TypeError'); + diff --git a/test/built-ins/Reflect/apply/not-a-constructor.js b/test/built-ins/Reflect/apply/not-a-constructor.js new file mode 100644 index 0000000000..cda2a97d23 --- /dev/null +++ b/test/built-ins/Reflect/apply/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.apply does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue(isConstructor(Reflect.apply), false, 'isConstructor(Reflect.apply) must return false'); + +assert.throws(TypeError, () => { + new Reflect.apply(() => {}, undefined, []); +}, '`new Reflect.apply(() => {}, undefined, [])` throws TypeError'); + diff --git a/test/built-ins/Reflect/construct/not-a-constructor.js b/test/built-ins/Reflect/construct/not-a-constructor.js new file mode 100644 index 0000000000..4a053f04b6 --- /dev/null +++ b/test/built-ins/Reflect/construct/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.construct does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue(isConstructor(Reflect.construct), false, 'isConstructor(Reflect.construct) must return false'); + +assert.throws(TypeError, () => { + new Reflect.construct(Function, [], Function); +}, '`new Reflect.construct(Function, [], Function)` throws TypeError'); + diff --git a/test/built-ins/Reflect/defineProperty/not-a-constructor.js b/test/built-ins/Reflect/defineProperty/not-a-constructor.js new file mode 100644 index 0000000000..30cf37a9e3 --- /dev/null +++ b/test/built-ins/Reflect/defineProperty/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.defineProperty does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Reflect.defineProperty), + false, + 'isConstructor(Reflect.defineProperty) must return false' +); + +assert.throws(TypeError, () => { + new Reflect.defineProperty({}, ''); +}, '`new Reflect.defineProperty({}, \'\')` throws TypeError'); + diff --git a/test/built-ins/Reflect/deleteProperty/not-a-constructor.js b/test/built-ins/Reflect/deleteProperty/not-a-constructor.js new file mode 100644 index 0000000000..928f46bd11 --- /dev/null +++ b/test/built-ins/Reflect/deleteProperty/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.deleteProperty does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Reflect.deleteProperty), + false, + 'isConstructor(Reflect.deleteProperty) must return false' +); + +assert.throws(TypeError, () => { + new Reflect.deleteProperty({}, ''); +}, '`new Reflect.deleteProperty({}, \'\')` throws TypeError'); + diff --git a/test/built-ins/Reflect/get/not-a-constructor.js b/test/built-ins/Reflect/get/not-a-constructor.js new file mode 100644 index 0000000000..c5971fb332 --- /dev/null +++ b/test/built-ins/Reflect/get/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.get does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue(isConstructor(Reflect.get), false, 'isConstructor(Reflect.get) must return false'); + +assert.throws(TypeError, () => { + new Reflect.get({}, ''); +}, '`new Reflect.get({}, \'\')` throws TypeError'); + diff --git a/test/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js b/test/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js new file mode 100644 index 0000000000..5a59ddc41f --- /dev/null +++ b/test/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.getOwnPropertyDescriptor does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Reflect.getOwnPropertyDescriptor), + false, + 'isConstructor(Reflect.getOwnPropertyDescriptor) must return false' +); + +assert.throws(TypeError, () => { + new Reflect.getOwnPropertyDescriptor({}, ''); +}, '`new Reflect.getOwnPropertyDescriptor({}, \'\')` throws TypeError'); + diff --git a/test/built-ins/Reflect/getPrototypeOf/not-a-constructor.js b/test/built-ins/Reflect/getPrototypeOf/not-a-constructor.js new file mode 100644 index 0000000000..18bd7be95a --- /dev/null +++ b/test/built-ins/Reflect/getPrototypeOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.getPrototypeOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Reflect.getPrototypeOf), + false, + 'isConstructor(Reflect.getPrototypeOf) must return false' +); + +assert.throws(TypeError, () => { + new Reflect.getPrototypeOf({}); +}, '`new Reflect.getPrototypeOf({})` throws TypeError'); + diff --git a/test/built-ins/Reflect/has/not-a-constructor.js b/test/built-ins/Reflect/has/not-a-constructor.js new file mode 100644 index 0000000000..d2ccbb966c --- /dev/null +++ b/test/built-ins/Reflect/has/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.has does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue(isConstructor(Reflect.has), false, 'isConstructor(Reflect.has) must return false'); + +assert.throws(TypeError, () => { + new Reflect.has(); +}, '`new Reflect.has()` throws TypeError'); + diff --git a/test/built-ins/Reflect/isExtensible/not-a-constructor.js b/test/built-ins/Reflect/isExtensible/not-a-constructor.js new file mode 100644 index 0000000000..00e4480b24 --- /dev/null +++ b/test/built-ins/Reflect/isExtensible/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.isExtensible does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue(isConstructor(Reflect.isExtensible), false, 'isConstructor(Reflect.isExtensible) must return false'); + +assert.throws(TypeError, () => { + new Reflect.isExtensible({}); +}, '`new Reflect.isExtensible({})` throws TypeError'); + diff --git a/test/built-ins/Reflect/ownKeys/not-a-constructor.js b/test/built-ins/Reflect/ownKeys/not-a-constructor.js new file mode 100644 index 0000000000..48d2876801 --- /dev/null +++ b/test/built-ins/Reflect/ownKeys/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.ownKeys does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue(isConstructor(Reflect.ownKeys), false, 'isConstructor(Reflect.ownKeys) must return false'); + +assert.throws(TypeError, () => { + new Reflect.ownKeys({}); +}, '`new Reflect.ownKeys({})` throws TypeError'); + diff --git a/test/built-ins/Reflect/preventExtensions/not-a-constructor.js b/test/built-ins/Reflect/preventExtensions/not-a-constructor.js new file mode 100644 index 0000000000..a0197cded6 --- /dev/null +++ b/test/built-ins/Reflect/preventExtensions/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.preventExtensions does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Reflect.preventExtensions), + false, + 'isConstructor(Reflect.preventExtensions) must return false' +); + +assert.throws(TypeError, () => { + new Reflect.preventExtensions({}); +}, '`new Reflect.preventExtensions({})` throws TypeError'); + diff --git a/test/built-ins/Reflect/set/not-a-constructor.js b/test/built-ins/Reflect/set/not-a-constructor.js new file mode 100644 index 0000000000..71819b568c --- /dev/null +++ b/test/built-ins/Reflect/set/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.set does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, Reflect.set, arrow-function] +---*/ + +assert.sameValue(isConstructor(Reflect.set), false, 'isConstructor(Reflect.set) must return false'); + +assert.throws(TypeError, () => { + new Reflect.set({}); +}, '`new Reflect.set({})` throws TypeError'); + diff --git a/test/built-ins/Reflect/setPrototypeOf/not-a-constructor.js b/test/built-ins/Reflect/setPrototypeOf/not-a-constructor.js new file mode 100644 index 0000000000..757bad1fc7 --- /dev/null +++ b/test/built-ins/Reflect/setPrototypeOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Reflect.setPrototypeOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Reflect, Reflect.setPrototypeOf, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Reflect.setPrototypeOf), + false, + 'isConstructor(Reflect.setPrototypeOf) must return false' +); + +assert.throws(TypeError, () => { + new Reflect.setPrototypeOf({}, {}); +}, '`new Reflect.setPrototypeOf({}, {})` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js b/test/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js new file mode 100644 index 0000000000..e8c4e00b02 --- /dev/null +++ b/test/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype[Symbol.match] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.match, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype[Symbol.match]), + false, + 'isConstructor(RegExp.prototype[Symbol.match]) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re[Symbol.match](); +}, '`let re = new RegExp(\'\'); new re[Symbol.match]()` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js b/test/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js new file mode 100644 index 0000000000..7183035ab3 --- /dev/null +++ b/test/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype[Symbol.matchAll] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.match, Symbol.matchAll, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype[Symbol.matchAll]), + false, + 'isConstructor(RegExp.prototype[Symbol.matchAll]) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re[Symbol.matchAll](); +}, '`let re = new RegExp(\'\'); new re[Symbol.matchAll]()` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js b/test/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js new file mode 100644 index 0000000000..b8ee0a8d4e --- /dev/null +++ b/test/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype[Symbol.replace] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.replace, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype[Symbol.replace]), + false, + 'isConstructor(RegExp.prototype[Symbol.replace]) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re[Symbol.replace](); +}, '`let re = new RegExp(\'\'); new re[Symbol.replace]()` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js b/test/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js new file mode 100644 index 0000000000..74c2a6121b --- /dev/null +++ b/test/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype[Symbol.search] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.search, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype[Symbol.search]), + false, + 'isConstructor(RegExp.prototype[Symbol.search]) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re[Symbol.search](); +}, '`let re = new RegExp(\'\'); new re[Symbol.search]()` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js b/test/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js new file mode 100644 index 0000000000..2bfd76e978 --- /dev/null +++ b/test/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype[Symbol.split] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.split, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype[Symbol.split]), + false, + 'isConstructor(RegExp.prototype[Symbol.split]) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re[Symbol.split](); +}, '`let re = new RegExp(\'\'); new re[Symbol.split]()` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/exec/not-a-constructor.js b/test/built-ins/RegExp/prototype/exec/not-a-constructor.js new file mode 100644 index 0000000000..e71752f8e9 --- /dev/null +++ b/test/built-ins/RegExp/prototype/exec/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype.exec does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype.exec), + false, + 'isConstructor(RegExp.prototype.exec) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re.exec(); +}, '`let re = new RegExp(\'\'); new re.exec()` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/test/not-a-constructor.js b/test/built-ins/RegExp/prototype/test/not-a-constructor.js new file mode 100644 index 0000000000..86b8f9da23 --- /dev/null +++ b/test/built-ins/RegExp/prototype/test/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype.test does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype.test), + false, + 'isConstructor(RegExp.prototype.test) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re.test(); +}, '`let re = new RegExp(\'\'); new re.test()` throws TypeError'); + diff --git a/test/built-ins/RegExp/prototype/toString/not-a-constructor.js b/test/built-ins/RegExp/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..bf27374f53 --- /dev/null +++ b/test/built-ins/RegExp/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + RegExp.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(RegExp.prototype.toString), + false, + 'isConstructor(RegExp.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + let re = new RegExp(''); new re.toString(); +}, '`let re = new RegExp(\'\'); new re.toString()` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js b/test/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js new file mode 100644 index 0000000000..a40673cb2f --- /dev/null +++ b/test/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype[Symbol.iterator] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.iterator, Set, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Set.prototype[Symbol.iterator]), + false, + 'isConstructor(Set.prototype[Symbol.iterator]) must return false' +); + +assert.throws(TypeError, () => { + let s = new Set([]); new s[Symbol.iterator](); +}, '`let s = new Set([]); new s[Symbol.iterator]()` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/add/not-a-constructor.js b/test/built-ins/Set/prototype/add/not-a-constructor.js new file mode 100644 index 0000000000..b57c17c05d --- /dev/null +++ b/test/built-ins/Set/prototype/add/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype.add does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Set, arrow-function] +---*/ + +assert.sameValue(isConstructor(Set.prototype.add), false, 'isConstructor(Set.prototype.add) must return false'); + +assert.throws(TypeError, () => { + let s = new Set([]); new s.add(); +}, '`let s = new Set([]); new s.add()` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/clear/not-a-constructor.js b/test/built-ins/Set/prototype/clear/not-a-constructor.js new file mode 100644 index 0000000000..945b19a6ea --- /dev/null +++ b/test/built-ins/Set/prototype/clear/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype.clear does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Set, arrow-function] +---*/ + +assert.sameValue(isConstructor(Set.prototype.clear), false, 'isConstructor(Set.prototype.clear) must return false'); + +assert.throws(TypeError, () => { + let s = new Set([]); new s.clear(); +}, '`let s = new Set([]); new s.clear()` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/delete/not-a-constructor.js b/test/built-ins/Set/prototype/delete/not-a-constructor.js new file mode 100644 index 0000000000..5561983d12 --- /dev/null +++ b/test/built-ins/Set/prototype/delete/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype.delete does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Set, arrow-function] +---*/ + +assert.sameValue(isConstructor(Set.prototype.delete), false, 'isConstructor(Set.prototype.delete) must return false'); + +assert.throws(TypeError, () => { + let s = new Set([]); new s.delete(); +}, '`let s = new Set([]); new s.delete()` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/entries/not-a-constructor.js b/test/built-ins/Set/prototype/entries/not-a-constructor.js new file mode 100644 index 0000000000..859fb3bdd0 --- /dev/null +++ b/test/built-ins/Set/prototype/entries/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype.entries does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Set, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Set.prototype.entries), + false, + 'isConstructor(Set.prototype.entries) must return false' +); + +assert.throws(TypeError, () => { + let s = new Set([]); new s.entries(); +}, '`let s = new Set([]); new s.entries()` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/forEach/not-a-constructor.js b/test/built-ins/Set/prototype/forEach/not-a-constructor.js new file mode 100644 index 0000000000..81182abcc3 --- /dev/null +++ b/test/built-ins/Set/prototype/forEach/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype.forEach does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Set, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Set.prototype.forEach), + false, + 'isConstructor(Set.prototype.forEach) must return false' +); + +assert.throws(TypeError, () => { + let s = new Set([]); new s.forEach(() => {}); +}, '`let s = new Set([]); new s.forEach(() => {})` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/has/not-a-constructor.js b/test/built-ins/Set/prototype/has/not-a-constructor.js new file mode 100644 index 0000000000..4b102b8e17 --- /dev/null +++ b/test/built-ins/Set/prototype/has/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype.has does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Set, arrow-function] +---*/ + +assert.sameValue(isConstructor(Set.prototype.has), false, 'isConstructor(Set.prototype.has) must return false'); + +assert.throws(TypeError, () => { + let s = new Set([]); new s.has(); +}, '`let s = new Set([]); new s.has()` throws TypeError'); + diff --git a/test/built-ins/Set/prototype/values/not-a-constructor.js b/test/built-ins/Set/prototype/values/not-a-constructor.js new file mode 100644 index 0000000000..c3f8ba336e --- /dev/null +++ b/test/built-ins/Set/prototype/values/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Set.prototype.values does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Set, arrow-function] +---*/ + +assert.sameValue(isConstructor(Set.prototype.values), false, 'isConstructor(Set.prototype.values) must return false'); + +assert.throws(TypeError, () => { + let s = new Set([]); new s.values(); +}, '`let s = new Set([]); new s.values()` throws TypeError'); + diff --git a/test/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js b/test/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js new file mode 100644 index 0000000000..616bc0eb26 --- /dev/null +++ b/test/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + SharedArrayBuffer.prototype.slice does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, SharedArrayBuffer, arrow-function] +---*/ + +assert.sameValue( + isConstructor(SharedArrayBuffer.prototype.slice), + false, + 'isConstructor(SharedArrayBuffer.prototype.slice) must return false' +); + +assert.throws(TypeError, () => { + let sab = new SharedArrayBuffer(1); new sab.slice(); +}, '`let sab = new SharedArrayBuffer(1); new sab.slice()` throws TypeError'); + diff --git a/test/built-ins/String/fromCharCode/not-a-constructor.js b/test/built-ins/String/fromCharCode/not-a-constructor.js new file mode 100644 index 0000000000..a8cb8b48ee --- /dev/null +++ b/test/built-ins/String/fromCharCode/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.fromCharCode does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.fromCharCode), false, 'isConstructor(String.fromCharCode) must return false'); + +assert.throws(TypeError, () => { + new String.fromCharCode(); +}, '`new String.fromCharCode()` throws TypeError'); + diff --git a/test/built-ins/String/fromCodePoint/not-a-constructor.js b/test/built-ins/String/fromCodePoint/not-a-constructor.js new file mode 100644 index 0000000000..368d4d1007 --- /dev/null +++ b/test/built-ins/String/fromCodePoint/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.fromCodePoint does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.fromCodePoint), false, 'isConstructor(String.fromCodePoint) must return false'); + +assert.throws(TypeError, () => { + new String.fromCodePoint(); +}, '`new String.fromCodePoint()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js b/test/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js new file mode 100644 index 0000000000..7cb4e8c4ee --- /dev/null +++ b/test/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype[Symbol.iterator] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, Symbol.iterator, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype[Symbol.iterator]), + false, + 'isConstructor(String.prototype[Symbol.iterator]) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype[Symbol.iterator](); +}, '`new String.prototype[Symbol.iterator]()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/charAt/not-a-constructor.js b/test/built-ins/String/prototype/charAt/not-a-constructor.js new file mode 100644 index 0000000000..b21223e71a --- /dev/null +++ b/test/built-ins/String/prototype/charAt/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.charAt does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.charAt), + false, + 'isConstructor(String.prototype.charAt) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.charAt(); +}, '`new String.prototype.charAt()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/charCodeAt/not-a-constructor.js b/test/built-ins/String/prototype/charCodeAt/not-a-constructor.js new file mode 100644 index 0000000000..14a54d57fb --- /dev/null +++ b/test/built-ins/String/prototype/charCodeAt/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.charCodeAt does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.charCodeAt), + false, + 'isConstructor(String.prototype.charCodeAt) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.charCodeAt(); +}, '`new String.prototype.charCodeAt()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/codePointAt/not-a-constructor.js b/test/built-ins/String/prototype/codePointAt/not-a-constructor.js new file mode 100644 index 0000000000..9a0a56966c --- /dev/null +++ b/test/built-ins/String/prototype/codePointAt/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.codePointAt does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.codePointAt), + false, + 'isConstructor(String.prototype.codePointAt) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.codePointAt(); +}, '`new String.prototype.codePointAt()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/concat/not-a-constructor.js b/test/built-ins/String/prototype/concat/not-a-constructor.js new file mode 100644 index 0000000000..236dbeb738 --- /dev/null +++ b/test/built-ins/String/prototype/concat/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.concat does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.concat), + false, + 'isConstructor(String.prototype.concat) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.concat(); +}, '`new String.prototype.concat()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/endsWith/not-a-constructor.js b/test/built-ins/String/prototype/endsWith/not-a-constructor.js new file mode 100644 index 0000000000..0599d56526 --- /dev/null +++ b/test/built-ins/String/prototype/endsWith/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.endsWith does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, String.prototype.endsWith, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.endsWith), + false, + 'isConstructor(String.prototype.endsWith) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.endsWith(); +}, '`new String.prototype.endsWith()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/includes/not-a-constructor.js b/test/built-ins/String/prototype/includes/not-a-constructor.js new file mode 100644 index 0000000000..5409d9020c --- /dev/null +++ b/test/built-ins/String/prototype/includes/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.includes does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.includes), + false, + 'isConstructor(String.prototype.includes) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.includes(1); +}, '`new String.prototype.includes(1)` throws TypeError'); + diff --git a/test/built-ins/String/prototype/indexOf/not-a-constructor.js b/test/built-ins/String/prototype/indexOf/not-a-constructor.js new file mode 100644 index 0000000000..5c52308256 --- /dev/null +++ b/test/built-ins/String/prototype/indexOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.indexOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.indexOf), + false, + 'isConstructor(String.prototype.indexOf) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.indexOf(); +}, '`new String.prototype.indexOf()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/lastIndexOf/not-a-constructor.js b/test/built-ins/String/prototype/lastIndexOf/not-a-constructor.js new file mode 100644 index 0000000000..2597640e6a --- /dev/null +++ b/test/built-ins/String/prototype/lastIndexOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.lastIndexOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.lastIndexOf), + false, + 'isConstructor(String.prototype.lastIndexOf) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.lastIndexOf(); +}, '`new String.prototype.lastIndexOf()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/localeCompare/not-a-constructor.js b/test/built-ins/String/prototype/localeCompare/not-a-constructor.js new file mode 100644 index 0000000000..2d39418212 --- /dev/null +++ b/test/built-ins/String/prototype/localeCompare/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.localeCompare does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.localeCompare), + false, + 'isConstructor(String.prototype.localeCompare) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.localeCompare(); +}, '`new String.prototype.localeCompare()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/match/not-a-constructor.js b/test/built-ins/String/prototype/match/not-a-constructor.js new file mode 100644 index 0000000000..627706fddd --- /dev/null +++ b/test/built-ins/String/prototype/match/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.match does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.match), + false, + 'isConstructor(String.prototype.match) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.match(); +}, '`new String.prototype.match()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/matchAll/not-a-constructor.js b/test/built-ins/String/prototype/matchAll/not-a-constructor.js new file mode 100644 index 0000000000..78169cd6d7 --- /dev/null +++ b/test/built-ins/String/prototype/matchAll/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.matchAll does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, String.prototype.matchAll, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.matchAll), + false, + 'isConstructor(String.prototype.matchAll) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.matchAll(); +}, '`new String.prototype.matchAll()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/normalize/not-a-constructor.js b/test/built-ins/String/prototype/normalize/not-a-constructor.js new file mode 100644 index 0000000000..cb43168f01 --- /dev/null +++ b/test/built-ins/String/prototype/normalize/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.normalize does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.normalize), + false, + 'isConstructor(String.prototype.normalize) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.normalize(); +}, '`new String.prototype.normalize()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/padEnd/not-a-constructor.js b/test/built-ins/String/prototype/padEnd/not-a-constructor.js new file mode 100644 index 0000000000..31eb29dbcb --- /dev/null +++ b/test/built-ins/String/prototype/padEnd/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.padEnd does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.padEnd), + false, + 'isConstructor(String.prototype.padEnd) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.padEnd(); +}, '`new String.prototype.padEnd()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/padStart/not-a-constructor.js b/test/built-ins/String/prototype/padStart/not-a-constructor.js new file mode 100644 index 0000000000..4cfb176e8d --- /dev/null +++ b/test/built-ins/String/prototype/padStart/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.padStart does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.padStart), + false, + 'isConstructor(String.prototype.padStart) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.padStart(); +}, '`new String.prototype.padStart()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/repeat/not-a-constructor.js b/test/built-ins/String/prototype/repeat/not-a-constructor.js new file mode 100644 index 0000000000..6ad404f2f1 --- /dev/null +++ b/test/built-ins/String/prototype/repeat/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.repeat does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.repeat), + false, + 'isConstructor(String.prototype.repeat) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.repeat(); +}, '`new String.prototype.repeat()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/replace/not-a-constructor.js b/test/built-ins/String/prototype/replace/not-a-constructor.js new file mode 100644 index 0000000000..5880ee7ee6 --- /dev/null +++ b/test/built-ins/String/prototype/replace/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.replace does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.replace), + false, + 'isConstructor(String.prototype.replace) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.replace(); +}, '`new String.prototype.replace()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/replaceAll/not-a-constructor.js b/test/built-ins/String/prototype/replaceAll/not-a-constructor.js new file mode 100644 index 0000000000..51443f416d --- /dev/null +++ b/test/built-ins/String/prototype/replaceAll/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.replaceAll does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.replaceAll), + false, + 'isConstructor(String.prototype.replaceAll) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.replaceAll(); +}, '`new String.prototype.replaceAll()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/search/not-a-constructor.js b/test/built-ins/String/prototype/search/not-a-constructor.js new file mode 100644 index 0000000000..f5c73a5c74 --- /dev/null +++ b/test/built-ins/String/prototype/search/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.search does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.search), + false, + 'isConstructor(String.prototype.search) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.search(); +}, '`new String.prototype.search()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/slice/not-a-constructor.js b/test/built-ins/String/prototype/slice/not-a-constructor.js new file mode 100644 index 0000000000..0cf9569d5b --- /dev/null +++ b/test/built-ins/String/prototype/slice/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.slice does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.slice), + false, + 'isConstructor(String.prototype.slice) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.slice(); +}, '`new String.prototype.slice()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/split/not-a-constructor.js b/test/built-ins/String/prototype/split/not-a-constructor.js new file mode 100644 index 0000000000..c60b20c666 --- /dev/null +++ b/test/built-ins/String/prototype/split/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.split does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.split), + false, + 'isConstructor(String.prototype.split) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.split(); +}, '`new String.prototype.split()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/startsWith/not-a-constructor.js b/test/built-ins/String/prototype/startsWith/not-a-constructor.js new file mode 100644 index 0000000000..64f31aa037 --- /dev/null +++ b/test/built-ins/String/prototype/startsWith/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.startsWith does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.startsWith), + false, + 'isConstructor(String.prototype.startsWith) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.startsWith(); +}, '`new String.prototype.startsWith()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/substring/not-a-constructor.js b/test/built-ins/String/prototype/substring/not-a-constructor.js new file mode 100644 index 0000000000..9819d567b7 --- /dev/null +++ b/test/built-ins/String/prototype/substring/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.substring does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.substring), + false, + 'isConstructor(String.prototype.substring) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.substring(); +}, '`new String.prototype.substring()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js b/test/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js new file mode 100644 index 0000000000..5037dd1678 --- /dev/null +++ b/test/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.toLocaleLowerCase does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.toLocaleLowerCase), + false, + 'isConstructor(String.prototype.toLocaleLowerCase) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.toLocaleLowerCase(); +}, '`new String.prototype.toLocaleLowerCase()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js b/test/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js new file mode 100644 index 0000000000..292495a415 --- /dev/null +++ b/test/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.toLocaleUpperCase does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.toLocaleUpperCase), + false, + 'isConstructor(String.prototype.toLocaleUpperCase) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.toLocaleUpperCase(); +}, '`new String.prototype.toLocaleUpperCase()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/toLowerCase/not-a-constructor.js b/test/built-ins/String/prototype/toLowerCase/not-a-constructor.js new file mode 100644 index 0000000000..57a5ddc16b --- /dev/null +++ b/test/built-ins/String/prototype/toLowerCase/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.toLowerCase does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.toLowerCase), + false, + 'isConstructor(String.prototype.toLowerCase) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.toLowerCase(); +}, '`new String.prototype.toLowerCase()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/toString/not-a-constructor.js b/test/built-ins/String/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..518e740934 --- /dev/null +++ b/test/built-ins/String/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.toString), + false, + 'isConstructor(String.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.toString(); +}, '`new String.prototype.toString()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/toUpperCase/not-a-constructor.js b/test/built-ins/String/prototype/toUpperCase/not-a-constructor.js new file mode 100644 index 0000000000..de98916a69 --- /dev/null +++ b/test/built-ins/String/prototype/toUpperCase/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.toUpperCase does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.toUpperCase), + false, + 'isConstructor(String.prototype.toUpperCase) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.toUpperCase(); +}, '`new String.prototype.toUpperCase()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/trim/not-a-constructor.js b/test/built-ins/String/prototype/trim/not-a-constructor.js new file mode 100644 index 0000000000..64895d417e --- /dev/null +++ b/test/built-ins/String/prototype/trim/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.trim does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.trim), + false, + 'isConstructor(String.prototype.trim) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.trim(); +}, '`new String.prototype.trim()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/trimEnd/not-a-constructor.js b/test/built-ins/String/prototype/trimEnd/not-a-constructor.js new file mode 100644 index 0000000000..0620d5bffa --- /dev/null +++ b/test/built-ins/String/prototype/trimEnd/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.trimEnd does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, string-trimming, String.prototype.trimEnd, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.trimEnd), + false, + 'isConstructor(String.prototype.trimEnd) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.trimEnd(); +}, '`new String.prototype.trimEnd()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/trimStart/not-a-constructor.js b/test/built-ins/String/prototype/trimStart/not-a-constructor.js new file mode 100644 index 0000000000..c81a16abc3 --- /dev/null +++ b/test/built-ins/String/prototype/trimStart/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.trimStart does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, string-trimming, String.prototype.trimStart, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.trimStart), + false, + 'isConstructor(String.prototype.trimStart) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.trimStart(); +}, '`new String.prototype.trimStart()` throws TypeError'); + diff --git a/test/built-ins/String/prototype/valueOf/not-a-constructor.js b/test/built-ins/String/prototype/valueOf/not-a-constructor.js new file mode 100644 index 0000000000..49f5f91ac3 --- /dev/null +++ b/test/built-ins/String/prototype/valueOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.valueOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.valueOf), + false, + 'isConstructor(String.prototype.valueOf) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.valueOf(); +}, '`new String.prototype.valueOf()` throws TypeError'); + diff --git a/test/built-ins/String/raw/not-a-constructor.js b/test/built-ins/String/raw/not-a-constructor.js new file mode 100644 index 0000000000..02d34d037e --- /dev/null +++ b/test/built-ins/String/raw/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.raw does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.raw), false, 'isConstructor(String.raw) must return false'); + +assert.throws(TypeError, () => { + new String.raw({raw: []}, []); +}, '`new String.raw({raw: []}, [])` throws TypeError'); + diff --git a/test/built-ins/Symbol/for/not-a-constructor.js b/test/built-ins/Symbol/for/not-a-constructor.js new file mode 100644 index 0000000000..415e98e3bf --- /dev/null +++ b/test/built-ins/Symbol/for/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Symbol.for does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, arrow-function] +---*/ + +assert.sameValue(isConstructor(Symbol.for), false, 'isConstructor(Symbol.for) must return false'); + +assert.throws(TypeError, () => { + new Symbol.for(); +}, '`new Symbol.for()` throws TypeError'); + diff --git a/test/built-ins/Symbol/keyFor/not-a-constructor.js b/test/built-ins/Symbol/keyFor/not-a-constructor.js new file mode 100644 index 0000000000..a74d45d8d4 --- /dev/null +++ b/test/built-ins/Symbol/keyFor/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Symbol.keyFor does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, arrow-function] +---*/ + +assert.sameValue(isConstructor(Symbol.keyFor), false, 'isConstructor(Symbol.keyFor) must return false'); + +assert.throws(TypeError, () => { + new Symbol.keyFor(Symbol()); +}, '`new Symbol.keyFor(Symbol())` throws TypeError'); + diff --git a/test/built-ins/Symbol/prototype/toString/not-a-constructor.js b/test/built-ins/Symbol/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..1473532e2c --- /dev/null +++ b/test/built-ins/Symbol/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Symbol.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Symbol.prototype.toString), + false, + 'isConstructor(Symbol.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + let symbol = Symbol(); new symbol.toString(); +}, '`let symbol = Symbol(); new symbol.toString()` throws TypeError'); + diff --git a/test/built-ins/Symbol/prototype/valueOf/not-a-constructor.js b/test/built-ins/Symbol/prototype/valueOf/not-a-constructor.js new file mode 100644 index 0000000000..4849c17761 --- /dev/null +++ b/test/built-ins/Symbol/prototype/valueOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Symbol.prototype.valueOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, Symbol, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Symbol.prototype.valueOf), + false, + 'isConstructor(Symbol.prototype.valueOf) must return false' +); + +assert.throws(TypeError, () => { + let symbol = Symbol(); new symbol.valueOf(); +}, '`let symbol = Symbol(); new symbol.valueOf()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/from/not-a-constructor.js b/test/built-ins/TypedArray/from/not-a-constructor.js new file mode 100644 index 0000000000..b71a07444b --- /dev/null +++ b/test/built-ins/TypedArray/from/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.from does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(TypedArray.from), false, 'isConstructor(TypedArray.from) must return false'); + +assert.throws(TypeError, () => { + new TypedArray.from([]); +}, '`new TypedArray.from([])` throws TypeError'); + diff --git a/test/built-ins/TypedArray/of/not-a-constructor.js b/test/built-ins/TypedArray/of/not-a-constructor.js new file mode 100644 index 0000000000..5787f8c92b --- /dev/null +++ b/test/built-ins/TypedArray/of/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.of does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(TypedArray.of), false, 'isConstructor(TypedArray.of) must return false'); + +assert.throws(TypeError, () => { + new TypedArray.of(1, 2, 3, 4); +}, '`new TypedArray.of(1, 2, 3, 4)` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/Symbol.iterator/not-a-constructor.js b/test/built-ins/TypedArray/prototype/Symbol.iterator/not-a-constructor.js new file mode 100644 index 0000000000..21307f7909 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/Symbol.iterator/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype[Symbol.iterator] does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, Symbol, Symbol.iterator, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype[Symbol.iterator]), + false, + 'isConstructor(TypedArray.prototype[Symbol.iterator]) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8[Symbol.iterator](); +}, '`let u8 = new Uint8Array(1); new u8[Symbol.iterator]()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/copyWithin/not-a-constructor.js b/test/built-ins/TypedArray/prototype/copyWithin/not-a-constructor.js new file mode 100644 index 0000000000..c1dd022b7e --- /dev/null +++ b/test/built-ins/TypedArray/prototype/copyWithin/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.copyWithin does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.copyWithin), + false, + 'isConstructor(TypedArray.prototype.copyWithin) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.copyWithin(); +}, '`let u8 = new Uint8Array(1); new u8.copyWithin()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/entries/not-a-constructor.js b/test/built-ins/TypedArray/prototype/entries/not-a-constructor.js new file mode 100644 index 0000000000..bf72d93264 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/entries/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.entries does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.entries), + false, + 'isConstructor(TypedArray.prototype.entries) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.entries(); +}, '`let u8 = new Uint8Array(1); new u8.entries()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/every/not-a-constructor.js b/test/built-ins/TypedArray/prototype/every/not-a-constructor.js new file mode 100644 index 0000000000..9e4e591227 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/every/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.every does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.every), + false, + 'isConstructor(TypedArray.prototype.every) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.every(() => {}); +}, '`let u8 = new Uint8Array(1); new u8.every(() => {})` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/fill/not-a-constructor.js b/test/built-ins/TypedArray/prototype/fill/not-a-constructor.js new file mode 100644 index 0000000000..934fb7655a --- /dev/null +++ b/test/built-ins/TypedArray/prototype/fill/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.fill does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.fill), + false, + 'isConstructor(TypedArray.prototype.fill) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.fill(); +}, '`let u8 = new Uint8Array(1); new u8.fill()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/filter/not-a-constructor.js b/test/built-ins/TypedArray/prototype/filter/not-a-constructor.js new file mode 100644 index 0000000000..bedefb3e50 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/filter/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.filter does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.filter), + false, + 'isConstructor(TypedArray.prototype.filter) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.filter(() => {}); +}, '`let u8 = new Uint8Array(1); new u8.filter(() => {})` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/find/not-a-constructor.js b/test/built-ins/TypedArray/prototype/find/not-a-constructor.js new file mode 100644 index 0000000000..0254c25ede --- /dev/null +++ b/test/built-ins/TypedArray/prototype/find/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.find does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.find), + false, + 'isConstructor(TypedArray.prototype.find) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.find(() => {}); +}, '`let u8 = new Uint8Array(1); new u8.find(() => {})` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js b/test/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js new file mode 100644 index 0000000000..db6e436783 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.findIndex does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.findIndex), + false, + 'isConstructor(TypedArray.prototype.findIndex) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.findIndex(() => {}); +}, '`let u8 = new Uint8Array(1); new u8.findIndex(() => {})` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/forEach/not-a-constructor.js b/test/built-ins/TypedArray/prototype/forEach/not-a-constructor.js new file mode 100644 index 0000000000..b65d20b5a3 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/forEach/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.forEach does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.forEach), + false, + 'isConstructor(TypedArray.prototype.forEach) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.forEach(() => {}); +}, '`let u8 = new Uint8Array(1); new u8.forEach(() => {})` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/includes/not-a-constructor.js b/test/built-ins/TypedArray/prototype/includes/not-a-constructor.js new file mode 100644 index 0000000000..63e51be06f --- /dev/null +++ b/test/built-ins/TypedArray/prototype/includes/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.includes does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.includes), + false, + 'isConstructor(TypedArray.prototype.includes) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.includes(1); +}, '`let u8 = new Uint8Array(1); new u8.includes(1)` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/indexOf/not-a-constructor.js b/test/built-ins/TypedArray/prototype/indexOf/not-a-constructor.js new file mode 100644 index 0000000000..48ee2069ae --- /dev/null +++ b/test/built-ins/TypedArray/prototype/indexOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.indexOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.indexOf), + false, + 'isConstructor(TypedArray.prototype.indexOf) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.indexOf(); +}, '`let u8 = new Uint8Array(1); new u8.indexOf()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/join/not-a-constructor.js b/test/built-ins/TypedArray/prototype/join/not-a-constructor.js new file mode 100644 index 0000000000..8037bef876 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/join/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.join does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.join), + false, + 'isConstructor(TypedArray.prototype.join) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.join(); +}, '`let u8 = new Uint8Array(1); new u8.join()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/keys/not-a-constructor.js b/test/built-ins/TypedArray/prototype/keys/not-a-constructor.js new file mode 100644 index 0000000000..bda4825bb4 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/keys/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.keys does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.keys), + false, + 'isConstructor(TypedArray.prototype.keys) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.keys(); +}, '`let u8 = new Uint8Array(1); new u8.keys()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/not-a-constructor.js b/test/built-ins/TypedArray/prototype/lastIndexOf/not-a-constructor.js new file mode 100644 index 0000000000..5b33448140 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.lastIndexOf does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.lastIndexOf), + false, + 'isConstructor(TypedArray.prototype.lastIndexOf) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.lastIndexOf(); +}, '`let u8 = new Uint8Array(1); new u8.lastIndexOf()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/map/not-a-constructor.js b/test/built-ins/TypedArray/prototype/map/not-a-constructor.js new file mode 100644 index 0000000000..3366aecc6c --- /dev/null +++ b/test/built-ins/TypedArray/prototype/map/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.map does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.map), + false, + 'isConstructor(TypedArray.prototype.map) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.map(() => {}); +}, '`let u8 = new Uint8Array(1); new u8.map(() => {})` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/reduce/not-a-constructor.js b/test/built-ins/TypedArray/prototype/reduce/not-a-constructor.js new file mode 100644 index 0000000000..95ea768d82 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/reduce/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.reduce does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.reduce), + false, + 'isConstructor(TypedArray.prototype.reduce) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.reduce(() => {}, []); +}, '`let u8 = new Uint8Array(1); new u8.reduce(() => {}, [])` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js b/test/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js new file mode 100644 index 0000000000..dc4bc76cb6 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.reduceRight does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.reduceRight), + false, + 'isConstructor(TypedArray.prototype.reduceRight) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.reduceRight(() => {}, []); +}, '`let u8 = new Uint8Array(1); new u8.reduceRight(() => {}, [])` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/reverse/not-a-constructor.js b/test/built-ins/TypedArray/prototype/reverse/not-a-constructor.js new file mode 100644 index 0000000000..6f75dd751f --- /dev/null +++ b/test/built-ins/TypedArray/prototype/reverse/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.reverse does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.reverse), + false, + 'isConstructor(TypedArray.prototype.reverse) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.reverse(); +}, '`let u8 = new Uint8Array(1); new u8.reverse()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/set/not-a-constructor.js b/test/built-ins/TypedArray/prototype/set/not-a-constructor.js new file mode 100644 index 0000000000..289ddc6733 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/set/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.set does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.set), + false, + 'isConstructor(TypedArray.prototype.set) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.set([0], 0); +}, '`let u8 = new Uint8Array(1); new u8.set([0], 0)` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/slice/not-a-constructor.js b/test/built-ins/TypedArray/prototype/slice/not-a-constructor.js new file mode 100644 index 0000000000..a2907322c1 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/slice/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.slice does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.slice), + false, + 'isConstructor(TypedArray.prototype.slice) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.slice(); +}, '`let u8 = new Uint8Array(1); new u8.slice()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/some/not-a-constructor.js b/test/built-ins/TypedArray/prototype/some/not-a-constructor.js new file mode 100644 index 0000000000..e9bfe385f7 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/some/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.some does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.some), + false, + 'isConstructor(TypedArray.prototype.some) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.some(() => {}); +}, '`let u8 = new Uint8Array(1); new u8.some(() => {})` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/sort/not-a-constructor.js b/test/built-ins/TypedArray/prototype/sort/not-a-constructor.js new file mode 100644 index 0000000000..0ef4408710 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/sort/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.sort does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.sort), + false, + 'isConstructor(TypedArray.prototype.sort) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.sort(); +}, '`let u8 = new Uint8Array(1); new u8.sort()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/subarray/not-a-constructor.js b/test/built-ins/TypedArray/prototype/subarray/not-a-constructor.js new file mode 100644 index 0000000000..1a75b2d18d --- /dev/null +++ b/test/built-ins/TypedArray/prototype/subarray/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.subarray does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.subarray), + false, + 'isConstructor(TypedArray.prototype.subarray) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.subarray(); +}, '`let u8 = new Uint8Array(1); new u8.subarray()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js b/test/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js new file mode 100644 index 0000000000..3de2607fa0 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.toLocaleString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.toLocaleString), + false, + 'isConstructor(TypedArray.prototype.toLocaleString) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.toLocaleString(); +}, '`let u8 = new Uint8Array(1); new u8.toLocaleString()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/toString/not-a-constructor.js b/test/built-ins/TypedArray/prototype/toString/not-a-constructor.js new file mode 100644 index 0000000000..c2f63f75e3 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/toString/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.toString does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.toString), + false, + 'isConstructor(TypedArray.prototype.toString) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.toString(); +}, '`let u8 = new Uint8Array(1); new u8.toString()` throws TypeError'); + diff --git a/test/built-ins/TypedArray/prototype/values/not-a-constructor.js b/test/built-ins/TypedArray/prototype/values/not-a-constructor.js new file mode 100644 index 0000000000..85afc41980 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/values/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + TypedArray.prototype.values does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js, testTypedArray.js] +features: [Reflect.construct, arrow-function, TypedArray] +---*/ + +assert.sameValue( + isConstructor(TypedArray.prototype.values), + false, + 'isConstructor(TypedArray.prototype.values) must return false' +); + +assert.throws(TypeError, () => { + let u8 = new Uint8Array(1); new u8.values(); +}, '`let u8 = new Uint8Array(1); new u8.values()` throws TypeError'); + diff --git a/test/built-ins/WeakMap/prototype/delete/not-a-constructor.js b/test/built-ins/WeakMap/prototype/delete/not-a-constructor.js new file mode 100644 index 0000000000..f9bb6bffaf --- /dev/null +++ b/test/built-ins/WeakMap/prototype/delete/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakMap.prototype.delete does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakMap, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakMap.prototype.delete), + false, + 'isConstructor(WeakMap.prototype.delete) must return false' +); + +assert.throws(TypeError, () => { + let wm = new WeakMap(); new wm.delete(); +}, '`let wm = new WeakMap(); new wm.delete()` throws TypeError'); + diff --git a/test/built-ins/WeakMap/prototype/get/not-a-constructor.js b/test/built-ins/WeakMap/prototype/get/not-a-constructor.js new file mode 100644 index 0000000000..ff422bd9fd --- /dev/null +++ b/test/built-ins/WeakMap/prototype/get/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakMap.prototype.get does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakMap, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakMap.prototype.get), + false, + 'isConstructor(WeakMap.prototype.get) must return false' +); + +assert.throws(TypeError, () => { + let wm = new WeakMap(); new wm.get(); +}, '`let wm = new WeakMap(); new wm.get()` throws TypeError'); + diff --git a/test/built-ins/WeakMap/prototype/has/not-a-constructor.js b/test/built-ins/WeakMap/prototype/has/not-a-constructor.js new file mode 100644 index 0000000000..4b9bb88312 --- /dev/null +++ b/test/built-ins/WeakMap/prototype/has/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakMap.prototype.has does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakMap, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakMap.prototype.has), + false, + 'isConstructor(WeakMap.prototype.has) must return false' +); + +assert.throws(TypeError, () => { + let wm = new WeakMap(); new wm.has(); +}, '`let wm = new WeakMap(); new wm.has()` throws TypeError'); + diff --git a/test/built-ins/WeakMap/prototype/set/not-a-constructor.js b/test/built-ins/WeakMap/prototype/set/not-a-constructor.js new file mode 100644 index 0000000000..5241b815e8 --- /dev/null +++ b/test/built-ins/WeakMap/prototype/set/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakMap.prototype.set does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakMap, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakMap.prototype.set), + false, + 'isConstructor(WeakMap.prototype.set) must return false' +); + +assert.throws(TypeError, () => { + let wm = new WeakMap(); new wm.set({}, 1); +}, '`let wm = new WeakMap(); new wm.set({}, 1)` throws TypeError'); + diff --git a/test/built-ins/WeakRef/prototype/deref/not-a-constructor.js b/test/built-ins/WeakRef/prototype/deref/not-a-constructor.js new file mode 100644 index 0000000000..161baea529 --- /dev/null +++ b/test/built-ins/WeakRef/prototype/deref/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakRef.prototype.deref does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakRef, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakRef.prototype.deref), + false, + 'isConstructor(WeakRef.prototype.deref) must return false' +); + +assert.throws(TypeError, () => { + let wr = new WeakRef({}); new wr.deref(); +}, '`let wr = new WeakRef({}); new wr.deref()` throws TypeError'); + diff --git a/test/built-ins/WeakSet/prototype/add/not-a-constructor.js b/test/built-ins/WeakSet/prototype/add/not-a-constructor.js new file mode 100644 index 0000000000..4e24303e0b --- /dev/null +++ b/test/built-ins/WeakSet/prototype/add/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakSet.prototype.add does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakSet, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakSet.prototype.add), + false, + 'isConstructor(WeakSet.prototype.add) must return false' +); + +assert.throws(TypeError, () => { + let ws = new WeakSet(); new ws.add({}); +}, '`let ws = new WeakSet(); new ws.add({})` throws TypeError'); + diff --git a/test/built-ins/WeakSet/prototype/delete/not-a-constructor.js b/test/built-ins/WeakSet/prototype/delete/not-a-constructor.js new file mode 100644 index 0000000000..55d5af7693 --- /dev/null +++ b/test/built-ins/WeakSet/prototype/delete/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakSet.prototype.delete does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakSet, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakSet.prototype.delete), + false, + 'isConstructor(WeakSet.prototype.delete) must return false' +); + +assert.throws(TypeError, () => { + let ws = new WeakSet(); new ws.delete(); +}, '`let ws = new WeakSet(); new ws.delete()` throws TypeError'); + diff --git a/test/built-ins/WeakSet/prototype/has/not-a-constructor.js b/test/built-ins/WeakSet/prototype/has/not-a-constructor.js new file mode 100644 index 0000000000..86b5f01d5e --- /dev/null +++ b/test/built-ins/WeakSet/prototype/has/not-a-constructor.js @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + WeakSet.prototype.has); does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, WeakSet, arrow-function] +---*/ + +assert.sameValue( + isConstructor(WeakSet.prototype.has), + false, + 'isConstructor(WeakSet.prototype.has) must return false' +); + +assert.throws(TypeError, () => { + let ws = new WeakSet(); new ws.has(); +}, '`let ws = new WeakSet(); new ws.has()` throws TypeError'); + diff --git a/test/built-ins/decodeURI/not-a-constructor.js b/test/built-ins/decodeURI/not-a-constructor.js new file mode 100644 index 0000000000..06bab4d6c7 --- /dev/null +++ b/test/built-ins/decodeURI/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + decodeURI does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(decodeURI), false, 'isConstructor(decodeURI) must return false'); + +assert.throws(TypeError, () => { + new decodeURI(''); +}, '`new decodeURI(\'\')` throws TypeError'); + diff --git a/test/built-ins/decodeURIComponent/not-a-constructor.js b/test/built-ins/decodeURIComponent/not-a-constructor.js new file mode 100644 index 0000000000..2eab6419c0 --- /dev/null +++ b/test/built-ins/decodeURIComponent/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + decodeURIComponent does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(decodeURIComponent), false, 'isConstructor(decodeURIComponent) must return false'); + +assert.throws(TypeError, () => { + new decodeURIComponent(''); +}, '`new decodeURIComponent(\'\')` throws TypeError'); + diff --git a/test/built-ins/encodeURI/not-a-constructor.js b/test/built-ins/encodeURI/not-a-constructor.js new file mode 100644 index 0000000000..bb8b5baf97 --- /dev/null +++ b/test/built-ins/encodeURI/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + encodeURI does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(encodeURI), false, 'isConstructor(encodeURI) must return false'); + +assert.throws(TypeError, () => { + new encodeURI(''); +}, '`new encodeURI(\'\')` throws TypeError'); + diff --git a/test/built-ins/encodeURIComponent/not-a-constructor.js b/test/built-ins/encodeURIComponent/not-a-constructor.js new file mode 100644 index 0000000000..54dd2014b2 --- /dev/null +++ b/test/built-ins/encodeURIComponent/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + encodeURIComponent does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(encodeURIComponent), false, 'isConstructor(encodeURIComponent) must return false'); + +assert.throws(TypeError, () => { + new encodeURIComponent(''); +}, '`new encodeURIComponent(\'\')` throws TypeError'); + diff --git a/test/built-ins/eval/not-a-constructor.js b/test/built-ins/eval/not-a-constructor.js new file mode 100644 index 0000000000..b79c1e960d --- /dev/null +++ b/test/built-ins/eval/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + eval does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(eval), false, 'isConstructor(eval) must return false'); + +assert.throws(TypeError, () => { + new eval(''); +}, '`new eval(\'\')` throws TypeError'); + diff --git a/test/built-ins/isFinite/not-a-constructor.js b/test/built-ins/isFinite/not-a-constructor.js new file mode 100644 index 0000000000..ae4c73b0fd --- /dev/null +++ b/test/built-ins/isFinite/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + isFinite does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(isFinite), false, 'isConstructor(isFinite) must return false'); + +assert.throws(TypeError, () => { + new isFinite(1); +}, '`new isFinite(1)` throws TypeError'); + diff --git a/test/built-ins/isNaN/not-a-constructor.js b/test/built-ins/isNaN/not-a-constructor.js new file mode 100644 index 0000000000..e794d7db62 --- /dev/null +++ b/test/built-ins/isNaN/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + isNaN does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(isNaN), false, 'isConstructor(isNaN) must return false'); + +assert.throws(TypeError, () => { + new isNaN(1); +}, '`new isNaN(1)` throws TypeError'); + diff --git a/test/built-ins/parseFloat/not-a-constructor.js b/test/built-ins/parseFloat/not-a-constructor.js new file mode 100644 index 0000000000..2168e1b374 --- /dev/null +++ b/test/built-ins/parseFloat/not-a-constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + parseFloat does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(parseFloat), false, 'isConstructor(parseFloat) must return false'); + +assert.throws(TypeError, () => { + new parseFloat(1); +}, '`new parseFloat(1)` throws TypeError'); + diff --git a/test/built-ins/parseInt/not-a-constructor.js b/test/built-ins/parseInt/not-a-constructor.js index 37c06a8a8a..35d500e8e6 100644 --- a/test/built-ins/parseInt/not-a-constructor.js +++ b/test/built-ins/parseInt/not-a-constructor.js @@ -1,14 +1,23 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. +// Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -info: The parseInt property can't be used as constructor -esid: sec-parseint-string-radix +esid: sec-ecmascript-standard-built-in-objects description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception + parseInt does not implement [[Construct]] +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] ---*/ +assert.sameValue(isConstructor(parseInt), false, 'isConstructor(parseInt) must return false'); + assert.throws(TypeError, () => { - new parseInt(); -}, '`new parseInt()` throws TypeError'); + new parseInt(1); +}, '`new parseInt(1)` throws TypeError'); +