From a8449d7b4beb346099f57d64f0c58ab38cc2910f Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Mon, 12 Jun 2017 15:50:13 +0200 Subject: lstrlib.js: missing charCodeAt and misspelled ms.src --- src/lstrlib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-70-g09d2