Implement seeking in the pre-scanner info. (#3126)
After changing the lexing position, the current position of the scanner info must be moved as well. Fixes #3101 Fixes #3102 JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Dániel Bátyai
parent
0eae2f6207
commit
40e63d1207
@@ -0,0 +1,17 @@
|
||||
// Copyright JS Foundation and other contributors, http://js.foundation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
for ( ; ; ( ) => 0) {
|
||||
for ( ; $; $) ;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright JS Foundation and other contributors, http://js.foundation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
while ( $(($) => {}) ) {
|
||||
while ($);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// Copyright JS Foundation and other contributors, http://js.foundation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
var a = 0;
|
||||
var count = 0;
|
||||
while ( function() { while (++a < 0) ; } (), a < 4) {
|
||||
while (++count < 0) ;
|
||||
}
|
||||
assert(count == 3);
|
||||
|
||||
for (a = 0, count = 0; function() { while (++a < 0) ; } (), a < 4 ; ) {
|
||||
while (++count < 0) ;
|
||||
}
|
||||
assert(count == 3);
|
||||
|
||||
a = 0;
|
||||
count = 0;
|
||||
switch (100) {
|
||||
default:
|
||||
while (++a < 2) ;
|
||||
break;
|
||||
|
||||
case (function () { for (var a = 0; a <= 1; a++) count ++; return a; })():
|
||||
while (++a < 100) ;
|
||||
break;
|
||||
|
||||
case (function () { for (var a = 0; a <= 2; a++) count ++; return a; })():
|
||||
while (++a < 100) ;
|
||||
break;
|
||||
|
||||
case (function () { for (var a = 0; a <= 3; a++) count ++; return a; })():
|
||||
while (++a < 100) ;
|
||||
break;
|
||||
|
||||
case (function () { for (var a = 0; a <= 4; a++) count ++; return a; })():
|
||||
while (++a < 100) ;
|
||||
break;
|
||||
}
|
||||
|
||||
assert (count == 14);
|
||||
assert (a == 2);
|
||||
Reference in New Issue
Block a user