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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 CHECK(function != NULL); | 1029 CHECK(function != NULL); |
1030 | 1030 |
1031 // Check scope types and positions. | 1031 // Check scope types and positions. |
1032 i::Scope* scope = function->scope(); | 1032 i::Scope* scope = function->scope(); |
1033 CHECK(scope->is_global_scope()); | 1033 CHECK(scope->is_global_scope()); |
1034 CHECK_EQ(scope->start_position(), 0); | 1034 CHECK_EQ(scope->start_position(), 0); |
1035 CHECK_EQ(scope->end_position(), kProgramSize); | 1035 CHECK_EQ(scope->end_position(), kProgramSize); |
1036 CHECK_EQ(scope->inner_scopes()->length(), 1); | 1036 CHECK_EQ(scope->inner_scopes()->length(), 1); |
1037 | 1037 |
1038 i::Scope* inner_scope = scope->inner_scopes()->at(0); | 1038 i::Scope* inner_scope = scope->inner_scopes()->at(0); |
1039 CHECK_EQ(inner_scope->type(), source_data[i].scope_type); | 1039 CHECK_EQ(inner_scope->scope_type(), source_data[i].scope_type); |
1040 CHECK_EQ(inner_scope->start_position(), kPrefixLen); | 1040 CHECK_EQ(inner_scope->start_position(), kPrefixLen); |
1041 // The end position of a token is one position after the last | 1041 // The end position of a token is one position after the last |
1042 // character belonging to that token. | 1042 // character belonging to that token. |
1043 CHECK_EQ(inner_scope->end_position(), kPrefixLen + kInnerLen); | 1043 CHECK_EQ(inner_scope->end_position(), kPrefixLen + kInnerLen); |
1044 } | 1044 } |
1045 } | 1045 } |
1046 | 1046 |
1047 | 1047 |
1048 i::Handle<i::String> FormatMessage(i::ScriptDataImpl* data) { | 1048 i::Handle<i::String> FormatMessage(i::ScriptDataImpl* data) { |
1049 i::Isolate* isolate = i::Isolate::Current(); | 1049 i::Isolate* isolate = i::Isolate::Current(); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 " b = function() { \n" | 1309 " b = function() { \n" |
1310 " 01; \n" | 1310 " 01; \n" |
1311 " }; \n" | 1311 " }; \n" |
1312 "}; \n"; | 1312 "}; \n"; |
1313 v8::Script::Compile(v8::String::New(script)); | 1313 v8::Script::Compile(v8::String::New(script)); |
1314 CHECK(try_catch.HasCaught()); | 1314 CHECK(try_catch.HasCaught()); |
1315 v8::String::Utf8Value exception(try_catch.Exception()); | 1315 v8::String::Utf8Value exception(try_catch.Exception()); |
1316 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.", | 1316 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.", |
1317 *exception); | 1317 *exception); |
1318 } | 1318 } |
OLD | NEW |