| Index: test/lexer/cornercases/octals.js
|
| diff --git a/src/harmony-math.js b/test/lexer/cornercases/octals.js
|
| similarity index 67%
|
| copy from src/harmony-math.js
|
| copy to test/lexer/cornercases/octals.js
|
| index a4d3f2e8a5e9c5936630571644605402dee1199d..6a81dd68de6c1f7b0b8a5d0617cbabd3ba13f946 100644
|
| --- a/src/harmony-math.js
|
| +++ b/test/lexer/cornercases/octals.js
|
| @@ -25,36 +25,34 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -'use strict';
|
| -
|
| -// ES6 draft 09-27-13, section 20.2.2.28.
|
| -function MathSign(x) {
|
| - x = TO_NUMBER_INLINE(x);
|
| - if (x > 0) return 1;
|
| - if (x < 0) return -1;
|
| - if (x === 0) return x;
|
| - return NAN;
|
| -}
|
| -
|
| -
|
| -// ES6 draft 09-27-13, section 20.2.2.34.
|
| -function MathTrunc(x) {
|
| - x = TO_NUMBER_INLINE(x);
|
| - if (x > 0) return MathFloor(x);
|
| - if (x < 0) return MathCeil(x);
|
| - if (x === 0) return x;
|
| - return NAN;
|
| -}
|
| -
|
| -
|
| -function ExtendMath() {
|
| - %CheckIsBootstrapping();
|
| -
|
| - // Set up the non-enumerable functions on the Math object.
|
| - InstallFunctions($Math, DONT_ENUM, $Array(
|
| - "sign", MathSign,
|
| - "trunc", MathTrunc
|
| - ));
|
| -}
|
| -
|
| -ExtendMath();
|
| +// Octal numbers and octal escapes in strings are not allowed in the strict
|
| +// mode.
|
| +
|
| +var octal_number = 031;
|
| +var not_octal_number = 0;
|
| +var again_not = 019;
|
| +
|
| +"octal inside \01 string"
|
| +"this is not octal \0"
|
| +"this is an octal escape followed by 9: \019"
|
| +"doesn't need to start with 0: \11"
|
| +
|
| +'octal inside \01 string'
|
| +'this is not octal \0'
|
| +'this is an octal escape followed by 9: \01'
|
| +'doesn\'t need to start with 0: \11'
|
| +
|
| +// Even more complicated cases: two octals in one string:
|
| +"foo\00\00"
|
| +'foo\00\00'
|
| +
|
| +// Different lengths of octals:
|
| +"bar\0" // not an octal
|
| +"bar\00"
|
| +"bar\000" // Not an octal according to Ecma
|
| +"bar\0000" // First 3 recognized as octal
|
| +
|
| +'bar\0' // not an octal
|
| +'bar\00'
|
| +'bar\000' // Not an octal according to Ecma
|
| +'bar\0000' // First 3 recognized as octal
|
|
|