~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to test/mjsunit/harmony/proxies-function.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
611
611
 
612
612
 
613
613
 
 
614
// Passing a proxy function to higher-order library functions.
 
615
 
 
616
function TestHigherOrder(f) {
 
617
  assertEquals(6, [6, 2].map(f)[0])
 
618
  assertEquals(4, [5, 2].reduce(f, 4))
 
619
  assertTrue([1, 2].some(f))
 
620
  assertEquals("a.b.c", "a.b.c".replace(".", f))
 
621
}
 
622
 
 
623
TestHigherOrder(function(x) { return x })
 
624
TestHigherOrder(function(x) { "use strict"; return x })
 
625
TestHigherOrder(Proxy.createFunction({}, function(x) { return x }))
 
626
TestHigherOrder(CreateFrozen({}, function(x) { return x }))
 
627
 
 
628
 
 
629
 
614
630
// TODO(rossberg): Ultimately, I want to have the following test function
615
631
// run through, but it currently fails on so many cases (some not even
616
632
// involving proxies), that I leave that for later...