aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-06-12 15:50:13 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-06-12 15:50:13 +0200
commita8449d7b4beb346099f57d64f0c58ab38cc2910f (patch)
treed12b81c3a4830009f2f3ddf1a0456270c08b3a97
parent2ff14d930ec8bee0c2c0190c1dd6f5584236342d (diff)
downloadfengari-a8449d7b4beb346099f57d64f0c58ab38cc2910f.tar.gz
fengari-a8449d7b4beb346099f57d64f0c58ab38cc2910f.tar.bz2
fengari-a8449d7b4beb346099f57d64f0c58ab38cc2910f.zip
lstrlib.js: missing charCodeAt and misspelled ms.src
-rw-r--r--src/lstrlib.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js
index ccb0c16..b19d4d8 100644
--- a/src/lstrlib.js
+++ b/src/lstrlib.js
@@ -1036,10 +1036,10 @@ const match = function(ms, s, p) {
}
case 'f'.charCodeAt(0): {
p += 2;
- if (ms.p[p] !== '[')
+ if (ms.p[p] !== '['.charCodeAt(0))
lauxlib.luaL_error(ms.L, lua.to_luastring("missing '[' after '%%f' in pattern"));
let ep = classend(ms, p); /* points to what is next */
- let previous = s === ms.src_init ? 0 : ms.s[s-1];
+ let previous = s === ms.src_init ? 0 : ms.src[s-1];
if (!matchbracketclass(ms, previous, p, ep - 1) && matchbracketclass(ms, ms.src[s], p, ep - 1)) {
p = ep; gotoinit = true; break;
}