| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 #define CHECK_SIMPLE(input, simple) CHECK_EQ(simple, CheckSimple(input)); | 164 #define CHECK_SIMPLE(input, simple) CHECK_EQ(simple, CheckSimple(input)); |
| 165 #define CHECK_MIN_MAX(input, min, max) \ | 165 #define CHECK_MIN_MAX(input, min, max) \ |
| 166 { MinMaxPair min_max = CheckMinMaxMatch(input); \ | 166 { MinMaxPair min_max = CheckMinMaxMatch(input); \ |
| 167 CHECK_EQ(min, min_max.min_match); \ | 167 CHECK_EQ(min, min_max.min_match); \ |
| 168 CHECK_EQ(max, min_max.max_match); \ | 168 CHECK_EQ(max, min_max.max_match); \ |
| 169 } | 169 } |
| 170 | 170 |
| 171 | 171 |
| 172 void TestRegExpParser(bool lookbehind) { | 172 void TestRegExpParser(bool lookbehind) { |
| 173 FLAG_harmony_regexp_lookbehind = lookbehind; | 173 FLAG_harmony_regexp_lookbehind = lookbehind; |
| 174 FLAG_harmony_unicode_regexps = true; | |
| 175 | 174 |
| 176 CHECK_PARSE_ERROR("?"); | 175 CHECK_PARSE_ERROR("?"); |
| 177 | 176 |
| 178 CheckParseEq("abc", "'abc'"); | 177 CheckParseEq("abc", "'abc'"); |
| 179 CheckParseEq("", "%"); | 178 CheckParseEq("", "%"); |
| 180 CheckParseEq("abc|def", "(| 'abc' 'def')"); | 179 CheckParseEq("abc|def", "(| 'abc' 'def')"); |
| 181 CheckParseEq("abc|def|ghi", "(| 'abc' 'def' 'ghi')"); | 180 CheckParseEq("abc|def|ghi", "(| 'abc' 'def' 'ghi')"); |
| 182 CheckParseEq("^xxx$", "(: @^i 'xxx' @$i)"); | 181 CheckParseEq("^xxx$", "(: @^i 'xxx' @$i)"); |
| 183 CheckParseEq("ab\\b\\d\\bcd", "(: 'ab' @b [0-9] @b 'cd')"); | 182 CheckParseEq("ab\\b\\d\\bcd", "(: 'ab' @b [0-9] @b 'cd')"); |
| 184 CheckParseEq("\\w|\\d", "(| [0-9 A-Z _ a-z] [0-9])"); | 183 CheckParseEq("\\w|\\d", "(| [0-9 A-Z _ a-z] [0-9])"); |
| (...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2024 v8::Local<v8::String> external = | 2023 v8::Local<v8::String> external = |
| 2025 v8::String::NewExternalOneByte(isolate, new UncachedExternalString()) | 2024 v8::String::NewExternalOneByte(isolate, new UncachedExternalString()) |
| 2026 .ToLocalChecked(); | 2025 .ToLocalChecked(); |
| 2027 CHECK(v8::Utils::OpenHandle(*external)->map() == | 2026 CHECK(v8::Utils::OpenHandle(*external)->map() == |
| 2028 CcTest::i_isolate()->heap()->short_external_one_byte_string_map()); | 2027 CcTest::i_isolate()->heap()->short_external_one_byte_string_map()); |
| 2029 v8::Local<v8::Object> global = env->Global(); | 2028 v8::Local<v8::Object> global = env->Global(); |
| 2030 global->Set(env.local(), v8_str("external"), external).FromJust(); | 2029 global->Set(env.local(), v8_str("external"), external).FromJust(); |
| 2031 CompileRun("var re = /y(.)/; re.test('ab');"); | 2030 CompileRun("var re = /y(.)/; re.test('ab');"); |
| 2032 ExpectString("external.substring(1).match(re)[1]", "z"); | 2031 ExpectString("external.substring(1).match(re)[1]", "z"); |
| 2033 } | 2032 } |
| OLD | NEW |