Chrome DevTools错误:“无法保存到临时变量。” [英] Chrome DevTools error: "Failed to save to temp variable."

查看:1522
本文介绍了Chrome DevTools错误:“无法保存到临时变量。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用

<1>我做错了什么?



2)为什么会发生这种情况?



Chrome:50.0.2661.102(64位)
OSX El Capitan 10.11.4

解决方案

我可以看到Store As Global Variable不起作用的两个原因:



。1。错误的控制台上下文选择



这可以说是一个Chrome错误,但只能将对象设置为全局对象记录对象的代码。



实际上,这意味着您可能需要选择正确的IFrame或Web Worker。



例如,在jsFiddle上:





在普通的jsFiddle编辑器页面上下文我收到一个错误。但是,如果我将上下文更改为小提琴本身的内容,它就会起作用:





<强> 2。垃圾收集



为了让Chrome为您提供对象的引用,对象仍然必须在内存中。如果不是这种情况,它只能引发一个错误。



然而,我非常确定,在控制台中显示强制V8保持对价值。


I am using Node Monkey to debug my NodeJS app.

It happens frequently that when I click "Store as Global Variable" in my Chrome Console it says "Failed to save to temp variable."

console.log({why:'dont', you:'work?'})

It happens also in this jsfiddle

1) Am I doing something wrong?

2) Why this happens?

Chrome: 50.0.2661.102 (64-bit) OSX El Capitan 10.11.4

解决方案

I can see two reasons why Store As Global Variable wouldn't work:

1. Wrong Console Context Selected

This is arguably a Chrome bug, but you can only store an object as a global if the console is set to the same context as the code that logged the object.

In practice this means you might need to select the correct IFrame or web worker.

For example, on jsFiddle:

In the normal jsFiddle editor page context I'm getting an error. But it works if I change the context to the contents of the fiddle itself:

2. Garbage Collection

In order for Chrome to give you a reference to the object the object still has to be in memory. If that isn't the case it can only throw an error.

However, I'm pretty sure that being shown in the console forces V8 to keep a reference to the value.

这篇关于Chrome DevTools错误:“无法保存到临时变量。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆