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 17 matching lines...) Expand all Loading... |
28 // TODO(jochen): Remove this after the setting is turned on globally. | 28 // TODO(jochen): Remove this after the setting is turned on globally. |
29 #define V8_IMMINENT_DEPRECATION_WARNINGS | 29 #define V8_IMMINENT_DEPRECATION_WARNINGS |
30 | 30 |
31 #include <stdlib.h> | 31 #include <stdlib.h> |
32 #include <wchar.h> | 32 #include <wchar.h> |
33 | 33 |
34 #include "src/v8.h" | 34 #include "src/v8.h" |
35 | 35 |
36 #include "src/compiler.h" | 36 #include "src/compiler.h" |
37 #include "src/disasm.h" | 37 #include "src/disasm.h" |
38 #include "src/parser.h" | 38 #include "src/parsing/parser.h" |
39 #include "test/cctest/cctest.h" | 39 #include "test/cctest/cctest.h" |
40 | 40 |
41 using namespace v8::internal; | 41 using namespace v8::internal; |
42 | 42 |
43 static Handle<Object> GetGlobalProperty(const char* name) { | 43 static Handle<Object> GetGlobalProperty(const char* name) { |
44 Isolate* isolate = CcTest::i_isolate(); | 44 Isolate* isolate = CcTest::i_isolate(); |
45 return Object::GetProperty( | 45 return Object::GetProperty( |
46 isolate, isolate->global_object(), name).ToHandleChecked(); | 46 isolate, isolate->global_object(), name).ToHandleChecked(); |
47 } | 47 } |
48 | 48 |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 CompileRun("function f() { a = 12345678 }; f();"); | 756 CompileRun("function f() { a = 12345678 }; f();"); |
757 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 757 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
758 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); | 758 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); |
759 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 759 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
760 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); | 760 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); |
761 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 761 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
762 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); | 762 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); |
763 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 763 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
764 } | 764 } |
765 #endif | 765 #endif |
OLD | NEW |