Skip to content

Commit

Permalink
Update the website to use 2.3.0 (refs #1189).
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Jun 17, 2015
1 parent 7016050 commit 8dcd1fc
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 29 deletions.
48 changes: 48 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
2015-06-16: Version 2.3.0

* Support ES6 generator (issue 1033)
* Improve parsing of regular expressions with `u` flag (issue 1179)

2015-04-17: Version 2.2.0

* Support ES6 import and export declarations (issue 1000)
* Fix line terminator before arrow not recognized as error (issue 1009)
* Support ES6 destructuring (issue 1045)
* Support ES6 template literal (issue 1074)
* Fix the handling of invalid/incomplete string escape sequences (issue 1106)
* Fix ES3 static member access restriction (issue 1120)
* Support for `super` in ES6 class (issue 1147)

2015-03-09: Version 2.1.0

* Support ES6 class (issue 1001)
* Support ES6 rest parameter (issue 1011)
* Expand the location of property getter, setter, and methods (issue 1029)
* Enable TryStatement transition to a single handler (issue 1031)
* Support ES6 computed property name (issue 1037)
* Tolerate unclosed block comment (issue 1041)
* Support ES6 lexical declaration (issue 1065)

2015-02-06: Version 2.0.0

* Support ES6 arrow function (issue 517)
* Support ES6 Unicode code point escape (issue 521)
* Improve the speed and accuracy of comment attachment (issue 522)
* Support ES6 default parameter (issue 519)
* Support ES6 regular expression flags (issue 557)
* Fix scanning of implicit octal literals (issue 565)
* Fix the handling of automatic semicolon insertion (issue 574)
* Support ES6 method definition (issue 620)
* Support ES6 octal integer literal (issue 621)
* Support ES6 binary integer literal (issue 622)
* Support ES6 object literal property value shorthand (issue 624)

2015-03-03: Version 1.2.5

* Fix scanning of implicit octal literals (issue 565)

2015-02-05: Version 1.2.4

* Fix parsing of LeftHandSideExpression in ForInStatement (issue 560)
* Fix the handling of automatic semicolon insertion (issue 574)

2015-01-18: Version 1.2.3

* Fix division by this (issue 616)
Expand Down
2 changes: 2 additions & 0 deletions LICENSE.BSD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Expand Down
68 changes: 39 additions & 29 deletions esprima.js
Original file line number Diff line number Diff line change
Expand Up @@ -1233,28 +1233,37 @@
}

function testRegExp(pattern, flags) {
var tmp = pattern;
// The BMP character to use as a replacement for astral symbols when
// translating an ES6 "u"-flagged pattern to an ES5-compatible
// approximation.
// Note: replacing with '\uFFFF' enables false positives in unlikely
// scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
// pattern that would not be detected by this substitution.
var astralSubstitute = '\uFFFF',
tmp = pattern;

if (flags.indexOf('u') >= 0) {
// Replace each astral symbol and every Unicode escape sequence
// that possibly represents an astral symbol or a paired surrogate
// with a single ASCII symbol to avoid throwing on regular
// expressions that are only valid in combination with the `/u`
// flag.
// Note: replacing with the ASCII symbol `x` might cause false
// negatives in unlikely scenarios. For example, `[\u{61}-b]` is a
// perfectly valid pattern that is equivalent to `[a-b]`, but it
// would be replaced by `[x-b]` which throws an error.
tmp = tmp
.replace(/\\u\{([0-9a-fA-F]+)\}/g, function ($0, $1) {
if (parseInt($1, 16) <= 0x10FFFF) {
return 'x';
// Replace every Unicode escape sequence with the equivalent
// BMP character or a constant ASCII code point in the case of
// astral symbols. (See the above note on `astralSubstitute`
// for more information.)
.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
var codePoint = parseInt($1 || $2, 16);
if (codePoint > 0x10FFFF) {
throwUnexpectedToken(null, Messages.InvalidRegExp);
}
throwUnexpectedToken(null, Messages.InvalidRegExp);
if (codePoint <= 0xFFFF) {
return String.fromCharCode(codePoint);
}
return astralSubstitute;
})
// Replace each paired surrogate with a single ASCII symbol to
// avoid throwing on regular expressions that are only valid in
// combination with the "u" flag.
.replace(
/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
'x'
/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
astralSubstitute
);
}

Expand Down Expand Up @@ -3674,10 +3683,11 @@
delegate = match('*');
if (delegate) {
lex();
}

if (!match(';') && !match('}') && lookahead.type !== Token.EOF) {
argument = parseExpression();
} else {
if (!match(';') && !match('}') && lookahead.type !== Token.EOF) {
argument = parseExpression();
}
}
}

Expand Down Expand Up @@ -4808,15 +4818,15 @@
lex();
} else {
key = parseObjectPropertyKey();
}
if (key && key.name === 'static' && (lookaheadPropertyName() || match('*'))) {
token = lookahead;
isStatic = true;
computed = match('[');
if (match('*')) {
lex();
} else {
key = parseObjectPropertyKey();
if (key.name === 'static' && (lookaheadPropertyName() || match('*'))) {
token = lookahead;
isStatic = true;
computed = match('[');
if (match('*')) {
lex();
} else {
key = parseObjectPropertyKey();
}
}
}
method = tryParseMethodDefinition(token, key, computed, method);
Expand Down Expand Up @@ -5398,7 +5408,7 @@
}

// Sync with *.json manifests.
exports.version = '2.2.0';
exports.version = '2.3.0';

exports.tokenize = tokenize;

Expand Down

0 comments on commit 8dcd1fc

Please sign in to comment.