Implementing escape sequences support with the exception of "\0" ("<NUL>") character and cases that depend on Unicode support.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-05-27 20:33:29 +03:00
parent 7025f97fdd
commit 8b28cac99e
9 changed files with 656 additions and 354 deletions
+2 -3
View File
@@ -1,7 +1,7 @@
./tests/jerry-test-suite/06/06-001.js
./tests/jerry-test-suite/06/06-002.js
./tests/jerry-test-suite/06/06-003.js
./tests/jerry-test-suite/06/06-004.js
./tests/jerry-test-suite/06/06-005.js
./tests/jerry-test-suite/07/07.06/07.06.01/07.06.01-001.js
./tests/jerry-test-suite/07/07.09/07.09-001.js
./tests/jerry-test-suite/07/07.09/07.09-002.js
@@ -31,7 +31,6 @@
./tests/jerry-test-suite/08/08.03/08.03-003.js
./tests/jerry-test-suite/08/08.03/08.03-004.js
./tests/jerry-test-suite/08/08.04/08.04-001.js
./tests/jerry-test-suite/08/08.04/08.04-002.js
./tests/jerry-test-suite/08/08.04/08.04-003.js
./tests/jerry-test-suite/08/08.04/08.04-004.js
./tests/jerry-test-suite/08/08.04/08.04-005.js
@@ -46,6 +45,7 @@
./tests/jerry-test-suite/08/08.04/08.04-014.js
./tests/jerry-test-suite/08/08.04/08.04-015.js
./tests/jerry-test-suite/08/08.04/08.04-016.js
./tests/jerry-test-suite/08/08.04/08.04-017.js
./tests/jerry-test-suite/08/08.05/08.05-001.js
./tests/jerry-test-suite/08/08.05/08.05-002.js
./tests/jerry-test-suite/08/08.05/08.05-003.js
@@ -868,7 +868,6 @@
./tests/jerry-test-suite/12/12.05/12.05-003.js
./tests/jerry-test-suite/12/12.05/12.05-004.js
./tests/jerry-test-suite/12/12.05/12.05-005.js
./tests/jerry-test-suite/12/12.05/12.05-006.js
./tests/jerry-test-suite/12/12.05/12.05-007.js
./tests/jerry-test-suite/12/12.05/12.05-008.js
./tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-001.js
+6 -3
View File
@@ -1,6 +1,9 @@
> Escape sequences
./tests/jerry-test-suite/06/06-001.js
./tests/jerry-test-suite/08/08.04/08.04-017.js
> Escape sequences (<NUL> character case)
./tests/jerry-test-suite/08/08.04/08.04-002.js
./tests/jerry-test-suite/12/12.05/12.05-006.js
> Unicode
./tests/jerry-test-suite/06/06-005.js
> Regular expressions
./tests/jerry-test-suite/07/07.08/07.08.05/07.08.05-001.js
+39
View File
@@ -0,0 +1,39 @@
// Copyright 2015 Samsung Electronics Co., Ltd.
//
// 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.
assert ('abcd\
efgh' === 'abcdefgh');
assert ('\'' === "'");
assert ("\'" === "'");
assert ('\"' === '"');
assert ("\"" === '"');
//
// TODO
// Extend the test by verifying character codes after String.charCodeAt would be implemented
//
assert ((new String ('\\')).length === 1);
assert ((new String ('\b')).length === 1);
assert ((new String ('\f')).length === 1);
assert ((new String ('\n')).length === 1);
assert ((new String ('\r')).length === 1);
assert ((new String ('\t')).length === 1);
assert ((new String ('\v')).length === 1);
// 'p' is not SingleEscapeCharacter
assert ('\p' === 'p');
var v\u0061riable = 'valu\u0065';
assert (variable === 'value');
@@ -0,0 +1,15 @@
// Copyright 2015 Samsung Electronics Co., Ltd.
//
// 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 str = '\x5t';
@@ -0,0 +1,15 @@
// Copyright 2015 Samsung Electronics Co., Ltd.
//
// 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 str = '\u004t';
@@ -0,0 +1,15 @@
// Copyright 2015 Samsung Electronics Co., Ltd.
//
// 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\u0028bcd;