v8

switch statement and scopes in ES2015

£可爱£侵袭症+ 提交于 2021-02-08 23:44:52
问题 Consider this ES2015 module and the behavior when run in node v4.4.5. 'use strict' const outer = 1 switch ('foo') { case 'bar': const heyBar = 'HEY_BAR' break case 'baz': const heyBaz = 'HEY_BAZ' break default: const heyDefault = 'HEY_DEFAULT' } console.log( outer, // 1, makes sense, same top-level scope heyBar, // undefined. huh? I thought switch did NOT create a child scope heyBaz, // undefined. huh? I thought switch did NOT create a child scope heyDefault) // 'HEY_DEFAULT' makes sense This

switch statement and scopes in ES2015

☆樱花仙子☆ 提交于 2021-02-08 23:44:00
问题 Consider this ES2015 module and the behavior when run in node v4.4.5. 'use strict' const outer = 1 switch ('foo') { case 'bar': const heyBar = 'HEY_BAR' break case 'baz': const heyBaz = 'HEY_BAZ' break default: const heyDefault = 'HEY_DEFAULT' } console.log( outer, // 1, makes sense, same top-level scope heyBar, // undefined. huh? I thought switch did NOT create a child scope heyBaz, // undefined. huh? I thought switch did NOT create a child scope heyDefault) // 'HEY_DEFAULT' makes sense This

Node 12 (v8) - converting deprecated code to the “maybe” version

a 夏天 提交于 2021-02-08 10:38:37
问题 I decided to update Node to 12.11. Because of this, I'm getting gyp compilation errors in some node modules that I'm using. I have some experience with C++, but I've never used v8. I've managed to fix most errors related to previously deprecated and now removed functions, but there's one kind of a problem that I'm unable to solve: v8::Local<v8::Object> obj = size->ToObject(); if(obj->Has(columns)) w->ws_col = obj->Get(columns)->Uint32Value(); if(obj->Has(rows)) w->ws_row = obj->Get(rows)-

When does V8 starts compiling and executing the code in relation to the event loop stack?

会有一股神秘感。 提交于 2021-02-08 10:20:14
问题 I have been curious of how js code is executed from beginning to the end. I have read about the event loop and seen this great video, how stack frames look like here,and also read about how the V8 engine compiles js code here. Question : When does V8 starts compiling and executing the code in relation to the event loop stack ? is it when the function is about to get popped out of the stack? or do all functions get compiled, right before they are placed on the stack ? therefore the proccess of

When does V8 starts compiling and executing the code in relation to the event loop stack?

∥☆過路亽.° 提交于 2021-02-08 10:19:26
问题 I have been curious of how js code is executed from beginning to the end. I have read about the event loop and seen this great video, how stack frames look like here,and also read about how the V8 engine compiles js code here. Question : When does V8 starts compiling and executing the code in relation to the event loop stack ? is it when the function is about to get popped out of the stack? or do all functions get compiled, right before they are placed on the stack ? therefore the proccess of

Why does time-based GAS Trigger get disabled for unknown reason in V8?

纵然是瞬间 提交于 2021-02-07 20:22:11
问题 I have (amongst others) the following four functions. fallback() newSubmission() installSubmissionTrigger() uninstallSubmissionTrigger() I have a trigger that: Runs on form submission. Calls fallback() that posts something to the Spreadsheet for review. fallback calls installSubmissionTrigger() . installSubmissionTrigger creates a time-based trigger running every minute. The trigger calls newSubmission() . newSubmission does something I want and calls uninstallSubmissionTrigger() .

Why does time-based GAS Trigger get disabled for unknown reason in V8?

时光毁灭记忆、已成空白 提交于 2021-02-07 20:20:24
问题 I have (amongst others) the following four functions. fallback() newSubmission() installSubmissionTrigger() uninstallSubmissionTrigger() I have a trigger that: Runs on form submission. Calls fallback() that posts something to the Spreadsheet for review. fallback calls installSubmissionTrigger() . installSubmissionTrigger creates a time-based trigger running every minute. The trigger calls newSubmission() . newSubmission does something I want and calls uninstallSubmissionTrigger() .

Is js native array.flat slow for depth=1?

为君一笑 提交于 2021-02-04 16:36:45
问题 This gist is a small benchmark I wrote comparing the performance for 4 alternatives for flattening arrays of depth=1 in JS (the code can be copied as-is into the google console). If I'm not missing anything, the native Array.prototype.flat has the worst performance by far - on the order of 30-50 times slower than any of the alternatives. Update : I've created a benchmark on jsperf. It should be noted that the 4th implementation in this benchmark is consistently the most performant - often

HTB-靶机-Frolic

随声附和 提交于 2021-02-02 12:20:12
本篇文章仅用于技术交流学习和研究的目的,严禁使用文章中的技术用于非法目的和破坏,否则造成一切后果与发表本文章的作者无关 靶机是作者购买VIP使用退役靶机操作,显示IP地址为10.10.10.111 本次使用https://github.com/Tib3rius/AutoRecon 进行自动化全方位扫描 执行命令 autorecon 10.10.10.111 -o ./Frolic-autorecon 爆破到目录admin访问下 没发现啥东西,查看下网页源代码 看到一个js文件 发现有个success.html的路径 访问结果如上,经过谷歌搜索确认跟密码学有关,解密地址:https://www.splitbrain.org/_static/ook/ 得到上面的一个路径,再访问一把 得到上面的base64编码信息,将其解码重定向到一个文件中 sudo echo ' UEsDBBQACQAIAMOJN00j/lsUsAAAAGkCAAAJABwAaW5kZXgucGhwVVQJAAOFfKdbhXynW3V4CwABBAAAAAAEAAAAAF5E5hBKn3OyaIopmhuVUPBuC6m/U3PkAkp3GhHcjuWgNOL22Y9r7nrQEopVyJbsK1i6f+BQyOES4baHpOrQu+J4XxPATolb

Node.js架构剖析

梦想与她 提交于 2021-02-02 11:57:13
原文链接: http://www.ayqy.net/blog/node-js-architecture-overview/ 一.Node.js 缔造的传奇 I have a job now, and this guy is the reason why I have that now. His hobby project is what I use for living. Thanks. —— Shajan Jacob 2009 年 Ryan Dahl 在 JSConf EU 大会上推出了 Node.js,最初是希望能够通过异步模型突破传统 Web 服务器的高并发瓶颈,之后愈渐发展成熟,应用越来越广,出现了繁荣的 Node.js 生态 借助 Node.js 走出浏览器之后,JavaScript 语言也 一发不可收拾 : Any application that can be written in JavaScript, will eventually be written in JavaScript. —— Jeff Atwood (摘自 The Principle of Least Power ) 早在 2017 年,NPM 就凭借茫茫多的社区模块成为了 世界上最大的 package registry ,目前模块数量已经 超过 125 万 ,并且仍在快速增长中(每天新增900多个