Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: test/cctest/test-compiler.cc

Issue 20646006: Pipe a script's CORS status through V8 during compilation. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: . Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 static Handle<JSFunction> Compile(const char* source) { 99 static Handle<JSFunction> Compile(const char* source) {
100 Isolate* isolate = Isolate::Current(); 100 Isolate* isolate = Isolate::Current();
101 Handle<String> source_code( 101 Handle<String> source_code(
102 isolate->factory()->NewStringFromUtf8(CStrVector(source))); 102 isolate->factory()->NewStringFromUtf8(CStrVector(source)));
103 Handle<SharedFunctionInfo> shared_function = 103 Handle<SharedFunctionInfo> shared_function =
104 Compiler::Compile(source_code, 104 Compiler::Compile(source_code,
105 Handle<String>(), 105 Handle<String>(),
106 0, 106 0,
107 0, 107 0,
108 false,
108 Handle<Context>(isolate->native_context()), 109 Handle<Context>(isolate->native_context()),
109 NULL, 110 NULL,
110 NULL, 111 NULL,
111 Handle<String>::null(), 112 Handle<String>::null(),
112 NOT_NATIVES_CODE); 113 NOT_NATIVES_CODE);
113 return isolate->factory()->NewFunctionFromSharedFunctionInfo( 114 return isolate->factory()->NewFunctionFromSharedFunctionInfo(
114 shared_function, isolate->native_context()); 115 shared_function, isolate->native_context());
115 } 116 }
116 117
117 118
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 CompileRun("function f() { a = 12345678 }; f();"); 422 CompileRun("function f() { a = 12345678 }; f();");
422 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f")); 423 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f"));
423 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); 424 CompileRun("function f(x) { a = 12345678 + x}; f(1);");
424 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f")); 425 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f"));
425 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); 426 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
426 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f")); 427 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f"));
427 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); 428 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
428 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f")); 429 CheckCodeForUnsafeLiteral(GetJSFunction(CcTest::env()->Global(), "f"));
429 } 430 }
430 #endif 431 #endif
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698