2016-12-14 ruki
lua原生并没有提供try-catch的语法来捕获异常处理,但是提供了pcall/xpcall等接口,可在保护模式下执行lua函数。 因此,可以通过封装这两个接口,来实现try-catch块的捕获机制。 我们可以先来看下,封装后的try-catch使用方式: ```lua try { -- try 代码块 function () error("error message") end, -- catch 代码块 catch { -- 发生异常后,被执行 function (errors) print(errors) end } } ``` 上面 继续阅读 »
2015-01-25 W.Y.
调试 JavaScript 也许是一场噩梦:一些错误非常难理解,并且给出的错误行号并不是总是很有帮助。如果有一个列表,列举这些错误的意思和如何修复它们,将对我们非常有帮助。 本文列举了 JavaScript 中一些奇怪的错误。对于相同的错误不同的浏览器可能给出不同的提示,所以分别给出了不同的例子。 more 如何阅读错误 进入正题之前,我们先快速分析一下错误消息的结构,这对我们理解错误消息非常有用,同时也将有助于你理解那些没有在本文中列举的错误。 Chrome 中一个典型的错误看起来像这样: Uncaught TypeError: undefined is not a function 该错误的结构如下: *Uncau 继续阅读 »
2019-01-21 Xie Jingyi
This chapter develop a small language of numbers and booleans, serving as a straightforward vehicle for the introduction of serveral fundamental concepts like, abstract syntax tree, evaluation and runtime errors. Syntax BNF-like Definition Terms of this language are defined as below: t ::= true false i 继续阅读 »
2016-02-25 Oliver Wang
最近在 mac 上用 terminal 启动 python 的时候经常会提示我,端口被占用了,像这样 bash 0 errors found February 25, 2016 - 18:25:21 Django version 1.6.7, using settings 'green.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. Error: That port is already in use. ps aux | grep python shell (kkh)➜ green 继续阅读 »