source: webkit/trunk/JavaScriptCore/kjs/operations.h@ 12172

Last change on this file since 12172 was 12028, checked in by darin, 19 years ago

Reviewed by Geoff.

  • JavaScriptCore.xcodeproj/project.pbxproj: Removed both APPLE_CHANGES and HAVE_CONFIG_H from all targets.
  • README: Removed. This had obsolete information in it and it wasn't clear what to replace it with.
  • kjs/collector.h: Removed an APPLE_CHANGES if around something that's not really platform-specific (although it does use a platform-specific API at the moment).
  • kjs/collector.cpp: Removed a mistaken comment.
  • kjs/grammar.y:
  • kjs/internal.cpp:
  • kjs/object.h:
  • kjs/operations.cpp:
  • kjs/operations.h:
  • kjs/ustring.h: Use APPLE instead of APPLE_CHANGES for code that should be used only on Mac OS X.
  • kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include of the runtime.h header. Even though that header isn't needed at the moment on platforms other than Mac OS X, the conditional stuff should be in the header itself, not in this one client.
  • kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on any platform where pow is implemented corrrectly according to the IEEE standard. If it is needed on some, we can add it back with an appropriate #if for the platforms where it is needed.
  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten ([email protected])
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef _KJS_OPERATIONS_H_
24#define _KJS_OPERATIONS_H_
25
26namespace KJS {
27
28 class ExecState;
29 class JSValue;
30
31#if __APPLE__
32 inline bool isNaN(double d) { return isnan(d); }
33 inline bool isInf(double d) { return isinf(d); }
34 inline bool isPosInf(double d) { return isinf(d) && d > 0; }
35 inline bool isNegInf(double d) { return isinf(d) && d < 0; }
36#else
37 /**
38 * @return True if d is not a number (platform support required).
39 */
40 bool isNaN(double d);
41 /**
42 * @return True if d is infinite (platform support required).
43 */
44 bool isInf(double d);
45 bool isPosInf(double d);
46 bool isNegInf(double d);
47#endif
48
49 bool equal(ExecState *exec, JSValue *v1, JSValue *v2);
50 bool strictEqual(ExecState *exec, JSValue *v1, JSValue *v2);
51 /**
52 * This operator performs an abstract relational comparison of the two
53 * arguments that can be of arbitrary type. If possible, conversions to the
54 * string or number type will take place before the comparison.
55 *
56 * @return 1 if v1 is "less-than" v2, 0 if the relation is "greater-than-or-
57 * equal". -1 if the result is undefined.
58 */
59 int relation(ExecState *exec, JSValue *v1, JSValue *v2);
60 int maxInt(int d1, int d2);
61 int minInt(int d1, int d2);
62 /**
63 * Additive operator. Either performs an addition or substraction of v1
64 * and v2.
65 * @param oper '+' or '-' for an addition or substraction, respectively.
66 * @return The result of the operation.
67 */
68 JSValue *add(ExecState *exec, JSValue *v1, JSValue *v2, char oper);
69 /**
70 * Multiplicative operator. Either multiplies/divides v1 and v2 or
71 * calculates the remainder from an division.
72 * @param oper '*', '/' or '%' for a multiplication, division or
73 * modulo operation.
74 * @return The result of the operation.
75 */
76 JSValue *mult(ExecState *exec, JSValue *v1, JSValue *v2, char oper);
77
78};
79
80#endif
Note: See TracBrowser for help on using the repository browser.