Lines Matching defs:Script
31 // Matches Script::Type from objects.h
36 // Matches Script::CompilationType from objects.h
92 // objects between script tags in a browser setting.
129 * Setup the Script function and constructor.
131 %FunctionSetInstanceClassName(Script, 'Script');
132 %SetProperty(Script.prototype, 'constructor', Script, DONT_ENUM);
133 %SetCode(Script, function(x) {
134 // Script objects can only be created by the VM.
253 var script = %MessageGetScript(message);
254 var location = script.locationFromPosition(start_position, true);
263 var script = %MessageGetScript(message);
265 var location = script.locationFromPosition(start_position, true);
307 Script.prototype.lineFromPosition = function(position) {
346 Script.prototype.locationFromPosition = function (position,
376 * start position of the source for the function within the full script source.
384 Script.prototype.locationFromLine = function (opt_line, opt_column, opt_offset_position) {
385 // Default is the first line in the script. Lines in the script is relative
417 * Get a slice of source code from the script. The boundaries for the slice is
422 * inclusive). Default is the number of lines in the script
426 Script.prototype.sourceSlice = function (opt_from_line, opt_to_line) {
453 Script.prototype.sourceLine = function (opt_line) {
454 // Default is the first line in the script. Lines in the script are relative
479 Script.prototype.lineCount = function() {
486 * Returns the name of script if available, contents of sourceURL comment
492 * @return {?string} script name if present, value for //@ sourceURL comment
495 Script.prototype.nameOrSourceURL = function() {
526 * script : script object for the source
536 * @param {Script} script The Script object for which this is a location
544 function SourceLocation(script, position, line, column, start, end) {
545 this.script = script;
612 return %_CallFunction(this.script.source, this.start, this.end, StringSubstring);
617 * Class for a source slice. A source slice is a part of a script source with
619 * script : script object for the source
627 * @param {Script} script The Script object for the source slice
634 function SourceSlice(script, from_line, to_line, from_position, to_position) {
635 this.script = script;
649 return %_CallFunction(this.script.source,
659 var script = %MessageGetScript(message);
661 var location = script.locationFromPosition(start_position, false);
724 var script = %FunctionGetScript(this.fun);
725 return script && script.compilation_type == COMPILATION_TYPE_EVAL;
729 var script = %FunctionGetScript(this.fun);
730 return FormatEvalOrigin(script);
734 var script = %FunctionGetScript(this.fun);
735 return script ? script.nameOrSourceURL() : null;
751 var script = %FunctionGetScript(this.fun);
752 if (script && script.compilation_type == COMPILATION_TYPE_EVAL)
786 var script = %FunctionGetScript(this.fun);
787 return script ? script.name : null;
793 var script = %FunctionGetScript(this.fun);
795 if (script) {
796 location = script.locationFromPosition(this.pos, true);
804 var script = %FunctionGetScript(this.fun);
806 if (script) {
807 location = script.locationFromPosition(this.pos, true);
813 var script = %FunctionGetScript(this.fun);
814 return script ? (script.type == TYPE_NATIVE) : false;
828 function FormatEvalOrigin(script) {
829 var sourceURL = script.nameOrSourceURL();
834 if (script.eval_from_function_name) {
835 eval_origin += script.eval_from_function_name;
840 var eval_from_script = script.eval_from_script;
843 // eval script originated from another eval.
846 // eval script originated from "real" source.
849 var location = eval_from_script.locationFromPosition(script.eval_from_script_position, true);
995 // overwriting allows leaks of error objects between script blocks