1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00
serenity/Libraries/LibJS/Tests
Andreas Kling ac7459cb40 LibJS: Hoist variable declarations to the nearest relevant scope
"var" declarations are hoisted to the nearest function scope, while
"let" and "const" are hoisted to the nearest block scope.

This is done by the parser, which keeps two scope stacks, one stack
for the current var scope and one for the current let/const scope.

When the interpreter enters a scope, we walk all of the declarations
and insert them into the variable environment.

We don't support the temporal dead zone for let/const yet.
2020-04-13 17:22:23 +02:00
..
array-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Array.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Array.prototype.pop.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Array.prototype.shift.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Array.prototype.toString.js LibJS: Handle empty values in Array.prototype.toString() 2020-04-08 20:01:42 +02:00
arrow-functions.js LibJS: Fix test files indentation (4 spaces) 2020-04-13 16:28:50 +02:00
binary-bitwise-operators-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Boolean.js LibJS: Fix test files indentation (4 spaces) 2020-04-13 16:28:50 +02:00
Boolean.prototype.js LibJS: Fix test files indentation (4 spaces) 2020-04-13 16:28:50 +02:00
Boolean.prototype.toString.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
Boolean.prototype.valueOf.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
constructor-basic.js LibJS: Implement basic support for the "new" keyword 2020-03-28 16:33:52 +01:00
continue-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.now.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getDate.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getDay.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getFullYear.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getHours.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getMilliseconds.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getMinutes.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getMonth.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getSeconds.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Date.prototype.getTime.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
do-while-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Error.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Error.prototype.name.js LibJS: Implement Error.prototype.name setter (#1776) 2020-04-13 11:19:53 +02:00
Error.prototype.toString.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
exception-ReferenceError.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
exponentiation-basic.js LibJS: Remove assert function from exponentiation-basic.js 2020-04-05 16:01:46 +02:00
for-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
for-no-curlies.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
function-length.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
function-missing-arg.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
function-this-in-arguments.js LibJS: Add globalThis 2020-04-09 15:58:49 +02:00
function-TypeError.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
Function.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Function.prototype.apply.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Function.prototype.call.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Function.prototype.toString.js LibJS: Tweak FunctionPrototype::to_string and constructors 2020-04-13 01:14:21 +02:00
Infinity-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
instanceof-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
invalid-lhs-in-assignment.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
let-scoping.js LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
logical-expressions-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
logical-expressions-short-circuit.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Math-constants.js LibJS: Simplify Math-constants.js test 2020-04-05 16:01:46 +02:00
Math.abs.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Math.ceil.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Math.cos.js LibJS: Add Math.{cos,sin,tan}() 2020-04-06 10:58:16 +02:00
Math.max.js LibJS: Return -Infinity in Math.max() with no argument 2020-04-05 19:30:47 +02:00
Math.min.js LibJS: Fix some tests for Math.min() 2020-04-06 15:14:34 +02:00
Math.sin.js LibJS: Add Math.{cos,sin,tan}() 2020-04-06 10:58:16 +02:00
Math.sqrt.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Math.tan.js LibJS: Add Math.{cos,sin,tan}() 2020-04-06 10:58:16 +02:00
Math.trunc.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
modulo-basic.js LibJS: Implement exponentiation (** operator) 2020-04-05 15:32:06 +02:00
NaN-basic.js LibJS: Return false for NaN numbers in Value::to_boolean() 2020-04-07 08:41:25 +02:00
Number-constants.js LibJS: Add Number constants 2020-04-07 21:28:43 +02:00
Number.isSafeInteger.js LibJS: Add Number.isSafeInteger() 2020-04-07 21:28:43 +02:00
Number.js LibJS: Handle Infinity in Value::to_number() 2020-04-12 14:39:38 +02:00
Number.prototype.js LibJS: Boolean, Number and String prototypes should have values too 2020-04-10 13:09:35 +02:00
numeric-literals-basic.js LibJS: Add numeric literal parsing for different bases and exponents 2020-04-05 16:01:22 +02:00
object-basic.js LibJS: Allow parsing numeric and string literals in object expressions 2020-04-07 09:05:16 +02:00
Object.defineProperty.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
Object.getOwnPropertyNames.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Object.getPrototypeOf.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Object.prototype.constructor.js LibJS: Add "constructor" property to constructor prototypes 2020-04-08 11:08:07 +02:00
Object.prototype.hasOwnProperty.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Object.prototype.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
Object.prototype.toString.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
parser-unary-associativity.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
run-tests LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
String.prototype.charAt.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
String.prototype.indexOf.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
String.prototype.js LibJS: Add String constructor :^) 2020-04-10 14:14:02 +02:00
String.prototype.padEnd.js LibJS: Add String.prototype.pad{Start,End}() 2020-04-10 16:37:04 +02:00
String.prototype.padStart.js LibJS: Add String.prototype.pad{Start,End}() 2020-04-10 16:37:04 +02:00
String.prototype.startsWith.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
String.prototype.toLowerCase.js LibJS: Remove mock String.prototype from tests 2020-04-10 15:51:39 +02:00
String.prototype.toString.js LibJS: Add String.prototype.toString() 2020-04-10 15:49:40 +02:00
String.prototype.toUpperCase.js LibJS: Remove mock String.prototype from tests 2020-04-10 15:51:39 +02:00
switch-basic-2.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
switch-basic-3.js LibJS: Fix test files indentation (4 spaces) 2020-04-13 16:28:50 +02:00
switch-basic.js LibJS: Fix test files indentation (4 spaces) 2020-04-13 16:28:50 +02:00
switch-break.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
ternary-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
throw-basic.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
to-number-basic.js LibJS: Handle Infinity in Value::to_number() 2020-04-12 14:39:38 +02:00
typeof-basic.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
var-multiple-declarator.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00
var-scoping.js LibJS: Hoist variable declarations to the nearest relevant scope 2020-04-13 17:22:23 +02:00
variable-declaration.js LibJS: Use assertNotReached() in tests 2020-04-13 16:28:50 +02:00
variable-undefined.js LibJS: Use the native assert() implementation now avaiable in 'js -t' 2020-04-05 15:28:45 +02:00