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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 STATIC_ASCII_VECTOR("foo")); | 231 STATIC_ASCII_VECTOR("foo")); |
232 Handle<Object> fun1 = Object::GetProperty( | 232 Handle<Object> fun1 = Object::GetProperty( |
233 isolate->global_object(), foo_string).ToHandleChecked(); | 233 isolate->global_object(), foo_string).ToHandleChecked(); |
234 CHECK(fun1->IsJSFunction()); | 234 CHECK(fun1->IsJSFunction()); |
235 | 235 |
236 Handle<Object> argv[] = { isolate->factory()->InternalizeOneByteString( | 236 Handle<Object> argv[] = { isolate->factory()->InternalizeOneByteString( |
237 STATIC_ASCII_VECTOR("hello")) }; | 237 STATIC_ASCII_VECTOR("hello")) }; |
238 Execution::Call(isolate, | 238 Execution::Call(isolate, |
239 Handle<JSFunction>::cast(fun1), | 239 Handle<JSFunction>::cast(fun1), |
240 global, | 240 global, |
241 ARRAY_SIZE(argv), | 241 arraysize(argv), |
242 argv).Check(); | 242 argv).Check(); |
243 } | 243 } |
244 | 244 |
245 | 245 |
246 // Regression 236. Calling InitLineEnds on a Script with undefined | 246 // Regression 236. Calling InitLineEnds on a Script with undefined |
247 // source resulted in crash. | 247 // source resulted in crash. |
248 TEST(Regression236) { | 248 TEST(Regression236) { |
249 CcTest::InitializeVM(); | 249 CcTest::InitializeVM(); |
250 Isolate* isolate = CcTest::i_isolate(); | 250 Isolate* isolate = CcTest::i_isolate(); |
251 Factory* factory = isolate->factory(); | 251 Factory* factory = isolate->factory(); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 CompileRun("function f() { a = 12345678 }; f();"); | 440 CompileRun("function f() { a = 12345678 }; f();"); |
441 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 441 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
442 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); | 442 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); |
443 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 443 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
444 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); | 444 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); |
445 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 445 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
446 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); | 446 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); |
447 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 447 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
448 } | 448 } |
449 #endif | 449 #endif |
OLD | NEW |