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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return isolate->context()->global_object()->GetProperty(*internalized_name); | 85 return isolate->context()->global_object()->GetProperty(*internalized_name); |
86 } | 86 } |
87 | 87 |
88 | 88 |
89 static void SetGlobalProperty(const char* name, Object* value) { | 89 static void SetGlobalProperty(const char* name, Object* value) { |
90 Isolate* isolate = CcTest::i_isolate(); | 90 Isolate* isolate = CcTest::i_isolate(); |
91 Handle<Object> object(value, isolate); | 91 Handle<Object> object(value, isolate); |
92 Handle<String> internalized_name = | 92 Handle<String> internalized_name = |
93 isolate->factory()->InternalizeUtf8String(name); | 93 isolate->factory()->InternalizeUtf8String(name); |
94 Handle<JSObject> global(isolate->context()->global_object()); | 94 Handle<JSObject> global(isolate->context()->global_object()); |
95 SetProperty(isolate, global, internalized_name, object, NONE, kNonStrictMode); | 95 Runtime::SetObjectProperty(isolate, global, internalized_name, object, NONE, |
| 96 kNonStrictMode); |
96 } | 97 } |
97 | 98 |
98 | 99 |
99 static Handle<JSFunction> Compile(const char* source) { | 100 static Handle<JSFunction> Compile(const char* source) { |
100 Isolate* isolate = CcTest::i_isolate(); | 101 Isolate* isolate = CcTest::i_isolate(); |
101 Handle<String> source_code( | 102 Handle<String> source_code( |
102 isolate->factory()->NewStringFromUtf8(CStrVector(source))); | 103 isolate->factory()->NewStringFromUtf8(CStrVector(source))); |
103 Handle<SharedFunctionInfo> shared_function = | 104 Handle<SharedFunctionInfo> shared_function = |
104 Compiler::Compile(source_code, | 105 Compiler::Compile(source_code, |
105 Handle<String>(), | 106 Handle<String>(), |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 CompileRun("function f() { a = 12345678 }; f();"); | 432 CompileRun("function f() { a = 12345678 }; f();"); |
432 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 433 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
433 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); | 434 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); |
434 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 435 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
435 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); | 436 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); |
436 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 437 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
437 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); | 438 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); |
438 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 439 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
439 } | 440 } |
440 #endif | 441 #endif |
OLD | NEW |