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
1 answer

Scala - Play - How to mock import play.api.libs.concurrent.CustomExecutionContext in Test and use it as an implicit param?

I have a test which is testing a class that expects an implicit CustomExecutionContext: @Singleton class MyRepo @Inject() (appConfigService: AppConfigService) (implicit ec: RepositoryDispatcherContext) Now I need to test this class and inject a…
guilhebl
  • 8,330
  • 10
  • 47
  • 66
0
votes
2 answers

Javascript hoisting - cant understand this

Trying to learn Js and cant understand why DOM element doesn't get the value: var Car = function(loc) { var obj = Object.create(Car.prototype); obj.loc = loc; obj.move = move; return obj; }; Car.prototype = { move : function() { …
Julius Dzidzevičius
  • 10,775
  • 11
  • 36
  • 81
0
votes
2 answers

Javascript - scope chain

I read a number of articles about the javascript scope chain and I thought I had a decent understanding of it. However, a very simple exercise made me realize I do not yet understand it at all. I created the following code. function foo () { var…
Jack Spar
  • 523
  • 1
  • 5
  • 6
0
votes
0 answers

How to change context of 'this' in object literal function with event parameter

I have the following code below which is an object literal with two functions and one property. My problem is that when function greetSomeone gets called, it's context is not person, but an event (eg jQuery or DOM event), therefore the context…
user3092075
  • 281
  • 1
  • 2
  • 9
0
votes
2 answers

when is argument object created?

In this blog post, it says that the argument object is created and assigned its value during creation of execution context, before any code is executed. However, in the book, YDKJS by Kyle Simpson, there is an example that looks like this,…
0
votes
0 answers

JavaScript's execution VS application context in a threaded language?

I'm trying to visualize what threads are in terms of implementation in memory. I don't have a com-sci background, so I apologize for any fundamental understanding errors (please point out such errors). My understanding of a process is a 'boxed' area…
Zach Smith
  • 8,458
  • 13
  • 59
  • 133
0
votes
0 answers

node - execution context of callback function

Hi i'm getting confused about the following execution context let fs = require('fs'); let text; fs.readFile('message.txt', 'utf8', function(err, contents) { text = contents; } console.log(text) text is undefined outside the callback…
Han Che
  • 8,239
  • 19
  • 70
  • 116
0
votes
1 answer

What is the difference between scala's Execution Context and play's Execution Context

Scala has its Execution Context as import scala.concurrent.ExecutionContext.Implicits.global Ans Play has its own Execution Context import play.api.libs.concurrent.Execution.Implicits.defaultContext Whats is the main difference and which one…
Arpit Suthar
  • 754
  • 1
  • 5
  • 19
0
votes
1 answer

Why doesn't ConfigureAwait(false) work with Task.Run/Task.Yield?

Here is a little test I wrote. Assert.False(ExecutionContext.IsFlowSuppressed()); // Precondition await Task.Run(() => Task.Yield()).ConfigureAwait(false); var isSuppressed =…
Tim Lovell-Smith
  • 15,310
  • 14
  • 76
  • 93
0
votes
0 answers

Javascript Execution context memory management

I have been struggling to get an answer for my question but not good. In javascript when the Interpreter initialize an execution context , is the size of it determined, if so what would happen if one of the data members (lets say array) exceeds this…
Amer Qarabsa
  • 6,412
  • 3
  • 20
  • 43
0
votes
2 answers

issue when access outer function scope in JS

Why the following happens? function f1() { this.myRefVar = 30; this.myRefVar2 = 30; var parent = this; return function() { this.myRefVar = 20; console.log('parent contains ' + Object.keys(parent).filter(function(k)…
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
0
votes
2 answers

Issue with this Javascript code (I think with the execution context)

On resize I want the code to run the first if statement: "I think this is too small". On the second resize I want it to run the first alternate: "I think this is too big". It only runs one, is it because the variable adjustment is local only and…
0
votes
1 answer

Javascript: Execute function with different execution context

Is there a way to change the execution context of a Javascript function manually at execution time? I am not talking about changing the this reference to point to a different object - I know this can be done with…
Johannes H.
  • 5,875
  • 1
  • 20
  • 40
0
votes
1 answer

Posting a Task to the Web Consoles Execution(Management) Context

In the apache brooklyn web interface we would like to display some content for the sytsem managers. The content is too long to be served as a simple sensor value. Our idea was to create a task and write the content into the output stream of the…
Bela Tamas Jozsa
  • 714
  • 5
  • 10
0
votes
4 answers

Understanding javascript hoisting and execution context

b(); console.log(a); var a = 'Hello World'; function b(){ console.log('Called b!'); } I have read about the term "hoisting", but it isn't pretty clear to me. Why does the function gets executed while the variable is set to undefined? The…
marukobotto
  • 759
  • 3
  • 12
  • 26