Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"async": "~0.2.9",
"bindings": "~1.2.0",
"colony-compiler": "~0.6.23",
"colony-compiler": "0.7.x",
"mkdirp": "~0.3.5",
"semver": "^4.1.0"
},
Expand Down
9 changes: 8 additions & 1 deletion src/colony/lua/colony-init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ end

-- arguments objects

function js_arguments (...)
function js_arguments (strict, callee, ...)
local a, len = {}, select('#', ...)
for i=1,len do
local val, _ = select(i, ...)
Expand All @@ -515,6 +515,13 @@ function js_arguments (...)

local obj = global._obj(a);
obj.length = len
if strict then
js_define_getter(obj, 'callee', function (this)
error(js_new(global.TypeError, '\'caller\', \'callee\', and \'arguments\' properties may not be accessed on strict mode functions or the arguments objects for calls to them'))
end)
else
obj.callee = callee
end
get_unique_metatable(obj).arguments = true
return obj
end
Expand Down
10 changes: 10 additions & 0 deletions test/issues/issue-runtime-573.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var tap = require('../tap');

tap.count(1);

iCalled();

function iCalled() { callMeMaybe(); }
function callMeMaybe() {
tap.ok(arguments.callee== callMeMaybe,'function callee');
}