mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4'
This commit is contained in:
parent
4401622eb1
commit
b77ad115f6
16832 changed files with 270819 additions and 87621 deletions
|
@ -0,0 +1,31 @@
|
|||
// Taken from https://en.wikipedia.org/wiki/JavaScript
|
||||
|
||||
// Declares a function-scoped variable named `x`, and implicitly assigns the
|
||||
// special value `undefined` to it. Variables without value are automatically
|
||||
// set to undefined.
|
||||
var x;
|
||||
|
||||
// Variables can be manually set to `undefined` like so
|
||||
var x2 = undefined;
|
||||
|
||||
// Declares a block-scoped variable named `y`, and implicitly sets it to
|
||||
// `undefined`. The `let` keyword was introduced in ECMAScript 2015.
|
||||
let y;
|
||||
|
||||
// Declares a block-scoped, un-reassignable variable named `z`, and sets it to
|
||||
// a string literal. The `const` keyword was also introduced in ECMAScript 2015,
|
||||
// and must be explicitly assigned to.
|
||||
|
||||
// The keyword `const` means constant, hence the variable cannot be reassigned
|
||||
// as the value is `constant`.
|
||||
const z = "this value cannot be reassigned!";
|
||||
|
||||
// Declares a variable named `myNumber`, and assigns a number literal (the value
|
||||
// `2`) to it.
|
||||
let myNumber = 2;
|
||||
|
||||
// Reassigns `myNumber`, setting it to a string literal (the value `"foo"`).
|
||||
// JavaScript is a dynamically-typed language, so this is legal.
|
||||
myNumber = "foo";
|
||||
|
||||
const target = "foo";
|
Loading…
Add table
Add a link
Reference in a new issue