Add Context class in JavaScript