How JavaScript core methods are implemented? -


is there reference or online site in can see how javascript core library methods push(), join(), split() etc implemented other language (glib c)

it varies implementation (within reason, implementation has fundamentally follow the spec). can see details of how v8 (chrome's engine) , spidermonkey (mozilla's) work, they're both open source:

for example, how v8 implements array#push (the line number in link rot):

function arraypush() {   if (is_null_or_undefined(this) && !is_undetectable(this)) {     throw maketypeerror("called_on_null_or_undefined",                         ["array.prototype.push"]);   }    var n = to_uint32(this.length);   var m = %_argumentslength();   (var = 0; < m; i++) {     this[i+n] = %_arguments(i);   }   this.length = n + m;   return this.length; } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -