OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2836 last_location = NULL; | 2836 last_location = NULL; |
2837 v8::ExtensionConfiguration config(1, bDeps); | 2837 v8::ExtensionConfiguration config(1, bDeps); |
2838 v8::Handle<Context> context = Context::New(&config); | 2838 v8::Handle<Context> context = Context::New(&config); |
2839 CHECK(context.IsEmpty()); | 2839 CHECK(context.IsEmpty()); |
2840 CHECK_NE(last_location, NULL); | 2840 CHECK_NE(last_location, NULL); |
2841 } | 2841 } |
2842 | 2842 |
2843 | 2843 |
2844 static const char* js_code_causing_huge_string_flattening = | 2844 static const char* js_code_causing_huge_string_flattening = |
2845 "var str = 'X';" | 2845 "var str = 'X';" |
2846 "for (var i = 0; i < 29; i++) {" | 2846 "for (var i = 0; i < 30; i++) {" |
2847 " str = str + str;" | 2847 " str = str + str;" |
2848 "}" | 2848 "}" |
2849 "str.match(/X/);"; | 2849 "str.match(/X/);"; |
2850 | 2850 |
2851 | 2851 |
2852 void OOMCallback(const char* location, const char* message) { | 2852 void OOMCallback(const char* location, const char* message) { |
2853 exit(0); | 2853 exit(0); |
2854 } | 2854 } |
2855 | 2855 |
2856 | 2856 |
(...skipping 4931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7788 LocalContext context; | 7788 LocalContext context; |
7789 v8::TryCatch try_catch; | 7789 v8::TryCatch try_catch; |
7790 const char *source = "function foo() { FAIL.FAIL; }; foo();"; | 7790 const char *source = "function foo() { FAIL.FAIL; }; foo();"; |
7791 v8::Handle<v8::String> src = v8::String::New(source); | 7791 v8::Handle<v8::String> src = v8::String::New(source); |
7792 v8::Handle<v8::String> origin = v8::String::New("stack-trace-test"); | 7792 v8::Handle<v8::String> origin = v8::String::New("stack-trace-test"); |
7793 v8::Script::New(src, origin)->Run(); | 7793 v8::Script::New(src, origin)->Run(); |
7794 CHECK(try_catch.HasCaught()); | 7794 CHECK(try_catch.HasCaught()); |
7795 v8::String::Utf8Value stack(try_catch.StackTrace()); | 7795 v8::String::Utf8Value stack(try_catch.StackTrace()); |
7796 CHECK(strstr(*stack, "at foo (stack-trace-test") != NULL); | 7796 CHECK(strstr(*stack, "at foo (stack-trace-test") != NULL); |
7797 } | 7797 } |
OLD | NEW |