| 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 3955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3966 TEST(ClassStaticPrototypeErrors) { | 3966 TEST(ClassStaticPrototypeErrors) { |
| 3967 const char* context_data[][2] = {{"class C {", "}"}, | 3967 const char* context_data[][2] = {{"class C {", "}"}, |
| 3968 {"(class {", "});"}, | 3968 {"(class {", "});"}, |
| 3969 {NULL, NULL}}; | 3969 {NULL, NULL}}; |
| 3970 | 3970 |
| 3971 const char* class_body_data[] = { | 3971 const char* class_body_data[] = { |
| 3972 "static prototype() {}", | 3972 "static prototype() {}", |
| 3973 "static get prototype() {}", | 3973 "static get prototype() {}", |
| 3974 "static set prototype(_) {}", | 3974 "static set prototype(_) {}", |
| 3975 "static *prototype() {}", | 3975 "static *prototype() {}", |
| 3976 "static 'prototype'() {}", |
| 3977 "static *'prototype'() {}", |
| 3978 "static prot\\u006ftype() {}", |
| 3979 "static 'prot\\u006ftype'() {}", |
| 3980 "static get 'prot\\u006ftype'() {}", |
| 3981 "static set 'prot\\u006ftype'(_) {}", |
| 3982 "static *'prot\\u006ftype'() {}", |
| 3976 NULL}; | 3983 NULL}; |
| 3977 | 3984 |
| 3978 static const ParserFlag always_flags[] = { | 3985 static const ParserFlag always_flags[] = { |
| 3979 kAllowClasses, | 3986 kAllowClasses, |
| 3980 kAllowHarmonyObjectLiterals | 3987 kAllowHarmonyObjectLiterals |
| 3981 }; | 3988 }; |
| 3982 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, | 3989 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, |
| 3983 always_flags, arraysize(always_flags)); | 3990 always_flags, arraysize(always_flags)); |
| 3984 } | 3991 } |
| 3985 | 3992 |
| 3986 | 3993 |
| 3987 TEST(ClassSpecialConstructorErrors) { | 3994 TEST(ClassSpecialConstructorErrors) { |
| 3988 const char* context_data[][2] = {{"class C {", "}"}, | 3995 const char* context_data[][2] = {{"class C {", "}"}, |
| 3989 {"(class {", "});"}, | 3996 {"(class {", "});"}, |
| 3990 {NULL, NULL}}; | 3997 {NULL, NULL}}; |
| 3991 | 3998 |
| 3992 const char* class_body_data[] = { | 3999 const char* class_body_data[] = { |
| 3993 "get constructor() {}", | 4000 "get constructor() {}", |
| 3994 "get constructor(_) {}", | 4001 "get constructor(_) {}", |
| 3995 "*constructor() {}", | 4002 "*constructor() {}", |
| 4003 "get 'constructor'() {}", |
| 4004 "*'constructor'() {}", |
| 4005 "get c\\u006fnstructor() {}", |
| 4006 "*c\\u006fnstructor() {}", |
| 4007 "get 'c\\u006fnstructor'() {}", |
| 4008 "get 'c\\u006fnstructor'(_) {}", |
| 4009 "*'c\\u006fnstructor'() {}", |
| 3996 NULL}; | 4010 NULL}; |
| 3997 | 4011 |
| 3998 static const ParserFlag always_flags[] = { | 4012 static const ParserFlag always_flags[] = { |
| 3999 kAllowClasses, | 4013 kAllowClasses, |
| 4000 kAllowHarmonyObjectLiterals | 4014 kAllowHarmonyObjectLiterals |
| 4001 }; | 4015 }; |
| 4002 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, | 4016 RunParserSyncTest(context_data, class_body_data, kError, NULL, 0, |
| 4003 always_flags, arraysize(always_flags)); | 4017 always_flags, arraysize(always_flags)); |
| 4004 } | 4018 } |
| 4005 | 4019 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4237 "for(const x = 4, y of [1,2,3]) {}", | 4251 "for(const x = 4, y of [1,2,3]) {}", |
| 4238 "for(const x = 1, y = 2 in []) {}", | 4252 "for(const x = 1, y = 2 in []) {}", |
| 4239 "for(const x,y in []) {}", | 4253 "for(const x,y in []) {}", |
| 4240 "for(const x = 1, y = 2 of []) {}", | 4254 "for(const x = 1, y = 2 of []) {}", |
| 4241 "for(const x,y of []) {}", | 4255 "for(const x,y of []) {}", |
| 4242 NULL}; | 4256 NULL}; |
| 4243 static const ParserFlag always_flags[] = {kAllowHarmonyScoping}; | 4257 static const ParserFlag always_flags[] = {kAllowHarmonyScoping}; |
| 4244 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, | 4258 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
| 4245 arraysize(always_flags)); | 4259 arraysize(always_flags)); |
| 4246 } | 4260 } |
| OLD | NEW |