Ignore:
Timestamp:
May 26, 2015, 2:17:22 PM (10 years ago)
Author:
Yusuke Suzuki
Message:

Reflect nits for r184863
https://bugs.webkit.org/show_bug.cgi?id=145107

Reviewed by Darin Adler.

  1. Added the copyright line.
  2. Added an optional argument (/*, end */). To do so, fixed generate-js-builtins.
  3. Dropped the unnecessary variable thisValue.
  4. Fix the type error messages. This is also found in StringIterator.prototype.js.
  5. Added tests for 0 arguments.
  • builtins/Array.prototype.js:

(copyWithin):

  • builtins/StringIterator.prototype.js:

(next):

  • generate-js-builtins:
  • tests/stress/array-copywithin.js:
  • tests/stress/string-iterators.js:
Location:
trunk/Source/JavaScriptCore/builtins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/builtins/Array.prototype.js

    r184863 r184871  
    11/*
    22 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
     3 * Copyright (C) 2015 Yusuke Suzuki <[email protected]>.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    457458}
    458459
    459 function copyWithin(target, start)
     460function copyWithin(target, start /*, end */)
    460461{
    461462    "use strict";
     
    471472    }
    472473
    473     var thisValue = this;
    474     if (thisValue === null || thisValue === undefined)
    475         throw new @TypeError("Array.copyWithin requires that |this| be not null or undefined");
    476     var thisObject = @Object(thisValue);
     474    if (this === null || this === undefined)
     475        throw new @TypeError("Array.copyWithin requires that |this| not be null or undefined");
     476    var thisObject = @Object(this);
    477477
    478478    var length = @ToLength(thisObject.length);
  • trunk/Source/JavaScriptCore/builtins/StringIterator.prototype.js

    r182118 r184871  
    2828
    2929    if (this == null)
    30         throw new @TypeError("%StringIteratorPrototype%.next requires that |this| be not null or undefined");
     30        throw new @TypeError("%StringIteratorPrototype%.next requires that |this| not be null or undefined");
    3131
    3232    var position = this.@stringIteratorNextIndex;
Note: See TracChangeset for help on using the changeset viewer.