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

Side by Side Diff: include/v8.h

Issue 2347933002: [modules] Introduce v8::Module to the API and return it from CompileModule (Closed)
Patch Set: Less maybe Created 4 years, 3 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 | « no previous file | src/api.h » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 1063
1064 /** 1064 /**
1065 * Returns zero based line number of the code_pos location in the script. 1065 * Returns zero based line number of the code_pos location in the script.
1066 * -1 will be returned if no information available. 1066 * -1 will be returned if no information available.
1067 */ 1067 */
1068 int GetLineNumber(int code_pos); 1068 int GetLineNumber(int code_pos);
1069 1069
1070 static const int kNoScriptId = 0; 1070 static const int kNoScriptId = 0;
1071 }; 1071 };
1072 1072
1073 /**
1074 * This is an unfinished experimental feature, and is only exposed
1075 * here for internal testing purposes. DO NOT USE.
1076 *
1077 * A compiled JavaScript module.
1078 */
1079 class V8_EXPORT Module {
1080 public:
1081 /**
1082 * ModuleDeclarationInstantiation
1083 *
1084 * Returns false if an exception occurred during instantiation.
1085 */
1086 V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context);
1087
1088 /**
1089 * ModuleEvaluation
1090 */
1091 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context);
1092 };
1073 1093
1074 /** 1094 /**
1075 * A compiled JavaScript script, tied to a Context which was active when the 1095 * A compiled JavaScript script, tied to a Context which was active when the
1076 * script was compiled. 1096 * script was compiled.
1077 */ 1097 */
1078 class V8_EXPORT Script { 1098 class V8_EXPORT Script {
1079 public: 1099 public:
1080 /** 1100 /**
1081 * A shorthand for ScriptCompiler::Compile(). 1101 * A shorthand for ScriptCompiler::Compile().
1082 */ 1102 */
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 * 1386 *
1367 * The easiest way to do so is to clear the embedder's cache on any 1387 * The easiest way to do so is to clear the embedder's cache on any
1368 * such change. 1388 * such change.
1369 * 1389 *
1370 * Alternatively, this tag can be stored alongside the cached data and 1390 * Alternatively, this tag can be stored alongside the cached data and
1371 * compared when it is being used. 1391 * compared when it is being used.
1372 */ 1392 */
1373 static uint32_t CachedDataVersionTag(); 1393 static uint32_t CachedDataVersionTag();
1374 1394
1375 /** 1395 /**
1376 * Compile an ES6 module. 1396 * This is an unfinished experimental feature, and is only exposed
1397 * here for internal testing purposes. DO NOT USE.
1377 * 1398 *
1378 * This is an unfinished experimental feature, and is only exposed 1399 * Compile an ES module, returning a Module that encapsulates
1379 * here for internal testing purposes. 1400 * the compiled code.
1380 * Only parsing works at the moment. Do not use.
1381 * 1401 *
1382 * TODO(adamk): Script is likely the wrong return value for this; 1402 * Corresponds to the ParseModule abstract operation in the
1383 * should return some new Module type. 1403 * ECMAScript specification.
1384 */ 1404 */
1385 static V8_WARN_UNUSED_RESULT MaybeLocal<Script> CompileModule( 1405 static V8_WARN_UNUSED_RESULT MaybeLocal<Module> CompileModule(
1386 Local<Context> context, Source* source, 1406 Isolate* isolate, Source* source);
1387 CompileOptions options = kNoCompileOptions);
1388 1407
1389 /** 1408 /**
1390 * Compile a function for a given context. This is equivalent to running 1409 * Compile a function for a given context. This is equivalent to running
1391 * 1410 *
1392 * with (obj) { 1411 * with (obj) {
1393 * return function(args) { ... } 1412 * return function(args) { ... }
1394 * } 1413 * }
1395 * 1414 *
1396 * It is possible to specify multiple context extensions (obj in the above 1415 * It is possible to specify multiple context extensions (obj in the above
1397 * example). 1416 * example).
(...skipping 8130 matching lines...) Expand 10 before | Expand all | Expand 10 after
9528 */ 9547 */
9529 9548
9530 9549
9531 } // namespace v8 9550 } // namespace v8
9532 9551
9533 9552
9534 #undef TYPE_CHECK 9553 #undef TYPE_CHECK
9535 9554
9536 9555
9537 #endif // INCLUDE_V8_H_ 9556 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698