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 3837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3848 TEST(ClassStaticPrototypeErrors) { | 3848 TEST(ClassStaticPrototypeErrors) { |
3849 const char* context_data[][2] = {{"class C {", "}"}, | 3849 const char* context_data[][2] = {{"class C {", "}"}, |
3850 {"(class {", "});"}, | 3850 {"(class {", "});"}, |
3851 {NULL, NULL}}; | 3851 {NULL, NULL}}; |
3852 | 3852 |
3853 const char* class_body_data[] = { | 3853 const char* class_body_data[] = { |
3854 "static prototype() {}", | 3854 "static prototype() {}", |
3855 "static get prototype() {}", | 3855 "static get prototype() {}", |
3856 "static set prototype(_) {}", | 3856 "static set prototype(_) {}", |
3857 "static *prototype() {}", | 3857 "static *prototype() {}", |
| 3858 "static 'prototype'() {}", |
| 3859 "static *'prototype'() {}", |
| 3860 "static prot\u006ftype() {}", |
| 3861 "static 'prot\u006ftype'() {}", |
| 3862 "static get 'prot\u006ftype'() {}", |
| 3863 "static set 'prot\u006ftype'(_) {}", |
| 3864 "static *'prot\u006ftype'() {}", |
3858 NULL}; | 3865 NULL}; |
3859 | 3866 |
3860 static const ParserFlag always_flags[] = { | 3867 static const ParserFlag always_flags[] = { |
3861 kAllowClasses, | 3868 kAllowClasses, |
3862 kAllowHarmonyObjectLiterals | 3869 kAllowHarmonyObjectLiterals |
3863 }; | 3870 }; |
3864 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, | 3871 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, |
3865 always_flags, arraysize(always_flags)); | 3872 always_flags, arraysize(always_flags)); |
3866 } | 3873 } |
3867 | 3874 |
3868 | 3875 |
3869 TEST(ClassSpecialConstructorErrors) { | 3876 TEST(ClassSpecialConstructorErrors) { |
3870 const char* context_data[][2] = {{"class C {", "}"}, | 3877 const char* context_data[][2] = {{"class C {", "}"}, |
3871 {"(class {", "});"}, | 3878 {"(class {", "});"}, |
3872 {NULL, NULL}}; | 3879 {NULL, NULL}}; |
3873 | 3880 |
3874 const char* class_body_data[] = { | 3881 const char* class_body_data[] = { |
3875 "get constructor() {}", | 3882 "get constructor() {}", |
3876 "get constructor(_) {}", | 3883 "get constructor(_) {}", |
3877 "*constructor() {}", | 3884 "*constructor() {}", |
| 3885 "get 'constructor'() {}", |
| 3886 "*'constructor'() {}", |
| 3887 "get c\u006fnstructor() {}", |
| 3888 "*c\u006fnstructor() {}", |
| 3889 "get 'c\u006fnstructor'() {}", |
| 3890 "get 'c\u006fnstructor'(_) {}", |
| 3891 "*'c\u006fnstructor'() {}", |
3878 NULL}; | 3892 NULL}; |
3879 | 3893 |
3880 static const ParserFlag always_flags[] = { | 3894 static const ParserFlag always_flags[] = { |
3881 kAllowClasses, | 3895 kAllowClasses, |
3882 kAllowHarmonyObjectLiterals | 3896 kAllowHarmonyObjectLiterals |
3883 }; | 3897 }; |
3884 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, | 3898 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, |
3885 always_flags, arraysize(always_flags)); | 3899 always_flags, arraysize(always_flags)); |
3886 } | 3900 } |
3887 | 3901 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4080 | 4094 |
4081 const char* name_data[] = { | 4095 const char* name_data[] = { |
4082 "function* g() { ({yield}); }", | 4096 "function* g() { ({yield}); }", |
4083 NULL | 4097 NULL |
4084 }; | 4098 }; |
4085 | 4099 |
4086 static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals}; | 4100 static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals}; |
4087 RunParserSyncTest(context_data, name_data, kError, NULL, 0, | 4101 RunParserSyncTest(context_data, name_data, kError, NULL, 0, |
4088 always_flags, arraysize(always_flags)); | 4102 always_flags, arraysize(always_flags)); |
4089 } | 4103 } |
OLD | NEW |