git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #2391 from rightfold/master
c2bd953Phil Freeman
examples/passing/HasOwnProperty.pursnew file+5
@@ -0,0 +1,5 @@
1+module Main where
2+
3+import Control.Monad.Eff.Console (log)
4+
5+main = log ({hasOwnProperty: "Hi"} {hasOwnProperty = "Done"}).hasOwnProperty
src/Language/PureScript/CodeGen/JS.hs+1−1
@@ -293,7 +293,7 @@ moduleToJs (Module coms mn imps exps foreigns decls) foreign_ =
293 evaluate = JSVariableIntroduction Nothing evaluatedObj (Just obj)
293 evaluate = JSVariableIntroduction Nothing evaluatedObj (Just obj)
294 objAssign = JSVariableIntroduction Nothing newObj (Just $ JSObjectLiteral Nothing [])
294 objAssign = JSVariableIntroduction Nothing newObj (Just $ JSObjectLiteral Nothing [])
295 copy = JSForIn Nothing key jsEvaluatedObj $ JSBlock Nothing [JSIfElse Nothing cond assign Nothing]
295 copy = JSForIn Nothing key jsEvaluatedObj $ JSBlock Nothing [JSIfElse Nothing cond assign Nothing]
296− cond = JSApp Nothing (JSAccessor Nothing "hasOwnProperty" jsEvaluatedObj) [jsKey]
296+ cond = JSApp Nothing (JSAccessor Nothing "call" (JSAccessor Nothing "hasOwnProperty" (JSObjectLiteral Nothing []))) [jsEvaluatedObj, jsKey]
297 assign = JSBlock Nothing [JSAssignment Nothing (JSIndexer Nothing jsKey jsNewObj) (JSIndexer Nothing jsKey jsEvaluatedObj)]
297 assign = JSBlock Nothing [JSAssignment Nothing (JSIndexer Nothing jsKey jsNewObj) (JSIndexer Nothing jsKey jsEvaluatedObj)]
298 stToAssign (s, js) = JSAssignment Nothing (accessorString s jsNewObj) js
298 stToAssign (s, js) = JSAssignment Nothing (accessorString s jsNewObj) js
299 extend = map stToAssign sts
299 extend = map stToAssign sts