| OLD | NEW |
| 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 Loading... |
| 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 V8_WARN_UNUSED_RESULT Maybe<bool> Instantiate(Local<Context> context); |
| 1085 |
| 1086 /** |
| 1087 * ModuleEvaluation |
| 1088 */ |
| 1089 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); |
| 1090 }; |
| 1073 | 1091 |
| 1074 /** | 1092 /** |
| 1075 * A compiled JavaScript script, tied to a Context which was active when the | 1093 * A compiled JavaScript script, tied to a Context which was active when the |
| 1076 * script was compiled. | 1094 * script was compiled. |
| 1077 */ | 1095 */ |
| 1078 class V8_EXPORT Script { | 1096 class V8_EXPORT Script { |
| 1079 public: | 1097 public: |
| 1080 /** | 1098 /** |
| 1081 * A shorthand for ScriptCompiler::Compile(). | 1099 * A shorthand for ScriptCompiler::Compile(). |
| 1082 */ | 1100 */ |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 * | 1384 * |
| 1367 * The easiest way to do so is to clear the embedder's cache on any | 1385 * The easiest way to do so is to clear the embedder's cache on any |
| 1368 * such change. | 1386 * such change. |
| 1369 * | 1387 * |
| 1370 * Alternatively, this tag can be stored alongside the cached data and | 1388 * Alternatively, this tag can be stored alongside the cached data and |
| 1371 * compared when it is being used. | 1389 * compared when it is being used. |
| 1372 */ | 1390 */ |
| 1373 static uint32_t CachedDataVersionTag(); | 1391 static uint32_t CachedDataVersionTag(); |
| 1374 | 1392 |
| 1375 /** | 1393 /** |
| 1376 * Compile an ES6 module. | 1394 * This is an unfinished experimental feature, and is only exposed |
| 1395 * here for internal testing purposes. DO NOT USE. |
| 1377 * | 1396 * |
| 1378 * This is an unfinished experimental feature, and is only exposed | 1397 * Compile an ES module, returning a Module that encapsulates |
| 1379 * here for internal testing purposes. | 1398 * the compiled code. |
| 1380 * Only parsing works at the moment. Do not use. | |
| 1381 * | 1399 * |
| 1382 * TODO(adamk): Script is likely the wrong return value for this; | 1400 * Corresponds to the ParseModule abstract operation in the |
| 1383 * should return some new Module type. | 1401 * ECMAScript specification. |
| 1384 */ | 1402 */ |
| 1385 static V8_WARN_UNUSED_RESULT MaybeLocal<Script> CompileModule( | 1403 static V8_WARN_UNUSED_RESULT MaybeLocal<Module> CompileModule( |
| 1386 Local<Context> context, Source* source, | 1404 Isolate* isolate, Source* source); |
| 1387 CompileOptions options = kNoCompileOptions); | |
| 1388 | 1405 |
| 1389 /** | 1406 /** |
| 1390 * Compile a function for a given context. This is equivalent to running | 1407 * Compile a function for a given context. This is equivalent to running |
| 1391 * | 1408 * |
| 1392 * with (obj) { | 1409 * with (obj) { |
| 1393 * return function(args) { ... } | 1410 * return function(args) { ... } |
| 1394 * } | 1411 * } |
| 1395 * | 1412 * |
| 1396 * It is possible to specify multiple context extensions (obj in the above | 1413 * It is possible to specify multiple context extensions (obj in the above |
| 1397 * example). | 1414 * example). |
| (...skipping 8130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9528 */ | 9545 */ |
| 9529 | 9546 |
| 9530 | 9547 |
| 9531 } // namespace v8 | 9548 } // namespace v8 |
| 9532 | 9549 |
| 9533 | 9550 |
| 9534 #undef TYPE_CHECK | 9551 #undef TYPE_CHECK |
| 9535 | 9552 |
| 9536 | 9553 |
| 9537 #endif // INCLUDE_V8_H_ | 9554 #endif // INCLUDE_V8_H_ |
| OLD | NEW |