Questions tagged [executioncontext]

Refers to concept of an environment where code is evaluated and executed. This refers to global and function execution contexts, how control is switched between, how binding occurs in context etc.

Execution context is abstract concept of programming and is closely related to executing code itself and order how it will executed (execution stack), how pointers to objects are created and used and how they're divided from each other. Because of abstract nature of concept itself Execution context is closely tied to particular implementation in programming languages (Javascript for example). Check related tags

Resources

Related tags

196 questions
0
votes
2 answers

Can i run javascript in global execution context without eval

I am writing php framework that extracts Javascript blocks to merge, minify and execute them asynchronously. So i like to delay Javascript code execution, to do that i wrap the javascript in MyLib.then(function(){ //orignial code from the…
0
votes
1 answer

Future map's (waiting) execution context. Stops execution with FixedThreadPool

// 1 fixed thread implicit val waitingCtx = scala.concurrent.ExecutionContext.fromExecutor(Executors.newFixedThreadPool(1)) // "map" will use waitingCtx val ss = (1 to 1000).map {n => // if I change it to 10 000 program will be…
ses
  • 13,174
  • 31
  • 123
  • 226
0
votes
1 answer

Javascript: Understanding the Weird Parts - function scope not working as described

I have tried to rewrite this a million ways and can't figure out how Tony Alicea produces the outcome 1, 2, undefined, 1 from this code: function b() { var myVar; console.log(myVar); } function a() { myVar = 2; console.log(myVar) …
0
votes
1 answer

How javascript retains the outer function's execution context when an inner function is returned?

I'm reading these two blogs: execution context and scope chain published by David Shariff diving depth into javascript's execution context and scope chain concept. One thing not clear to me after reading the above blogs is how javascript prevents a…
Aaron Shen
  • 8,124
  • 10
  • 44
  • 86
0
votes
2 answers

How can I get the execution context of a javascript function inside V8 engine

I want to know the JS functions' calling relationship by getting the execution context or more specifically scope chain of a JS function. Consider this example: function one() { var a = 1; two(); function two() { var b = 2; …
wangrl
  • 5
  • 5
0
votes
1 answer

Are Execution Context and Variable Object actually same thing in JavaScript?

Title says it all. I am so confused about whole concept of execution context in JavaScript. I understand that each execution context is associated with one variable object, and variable object stores declared variables, functions and formal…
ringord
  • 908
  • 3
  • 11
  • 27
0
votes
0 answers

storing Map/List datatype in jobExecutionContext

there's a spring batch job which stores map/list in jobexeutioncontext for biz logic, and if it failed first-time and tried restart it, it always occurred error like below : java.lang.InstantiationError: java.util.Map$Entry at…
Bumz
  • 1
0
votes
1 answer

Accessing a custom dispatcher defined in application.conf inside a Scala trait

I'm doing a few operations on Futures inside an trait. trait MyTrait { //Future based operations } Instead of using ExecutionContext.Implicits.global for my Future, I want to use one that is defined in my application.conf. akka { …
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
0
votes
1 answer

Lifetime of Nested Execution Contexts

I am following along with an article on javascript closures. In trying to learn the particulars of execution context, I came across a result that surprised me. var globalVar = 'g'; var inner; var outer = function() { var outerVar = 'o'; inner =…
SimplGy
  • 20,079
  • 15
  • 107
  • 144
0
votes
1 answer

how does javascript execution context work in firefox extensions with multiple windows?

I am writing what should be a fairly straightforward firefox extension. But this is my first firefox-extension and my first javascript program, and I'm used to C and assembly-language where nothing is hidden, so I'm having a difficult time…
honestann
  • 1,374
  • 12
  • 19
0
votes
1 answer

Need an execution context for combination of async and TPL code

I'm looking for an execution context which plays nicely with async/await and with the TPL at the same time in the following way (expected behavior): async Task ReadContext(string slot) { // Perform some async code ... return…
-1
votes
1 answer

Functions, arrow functions, closures and ExecutionContext

I'm trying to understand arrow functions in JavaScript and have a few questions regarding how they interact with ExecutionContext/environment and closures. How I understand the model: To the best of my understanding, the "specification" model in JS…
Petrroll
  • 741
  • 7
  • 29
-1
votes
1 answer

why my async code is not executing inspite of being the free call stack

As per my knowledge async code is executed when the call stack is empty and execution of the async code is finished in web API But In a given code why my async code which is setTimeout function and Promise which resolve quickly -- is not getting…
-1
votes
1 answer

How do block scopes have access to enclosing scope

i do understand that due to lexical scoping, block scopes can access the enclosing scope variables. But what i do not understand is how it really works. ex: function first(){ let i=10; function second(){ let j=20; console.log(i); …
Manishpant
  • 37
  • 1
  • 5
-1
votes
1 answer

Call Stack order of operations in Javascript - JS foundational concept

When running this piece of code, the JS engine pushes three(), two(), one() to the call stack, and in this order. My question is: Does the string "I'm function ONE!!!" return after one() is popped off the stack OR after two() and three() are popped…
Eug
  • 165
  • 1
  • 2
  • 11
1 2 3
13
14